xscmpgtdp

VSX Scalar Compare Greater Than Double-Precision

xscmpgtdp XT,XA,XB

Compares two double-precision floating-point values and sets the target vector register based on the comparison.

Details

Compares the double-precision floating-point value in the scalar portion of XA with that in XB and sets the corresponding elements in XT to all 1s (true) or all 0s (false) based on whether XA > XB. This VSX scalar instruction operates on the preferred slot (upper doubleword) of the registers. The comparison does not set condition registers but produces a vector result; quiet NaN operands compare as false without signaling.

Pseudocode Operation

if XA[0] > XB[0] then
  XT[0] ← 0xFFFFFFFFFFFFFFFF
else
  XT[0] ← 0x0000000000000000
end if
XT[1] ← undefined

Programming Note

xscmpgtdp can be used to implement the C/C++/Java conditional operation, RESULT = (x>y) ? a : b. xscmpgtdp fGT,fX,fY xxsel fRESULT,fA,fB,fGT xscmpgtdp can also be used to implement the C/C++/Java conditional operation, RESULT = (x<y) ? a : b. xscmpgtdp fLT,fY,fX xxsel fRESULT,fA,fB,fLT

Example

xscmpgtdp vs1, vs2, vs3

Encoding

Binary Layout
T
11
A
16
B
21
AX
29
BX
30
TX
31
 
Format XX3-form
Opcode 0xF0000058
Extension VSX
Registers Altered FPSCR (FX, VXSNAN, VXVC)

Operands

  • XT
    Target Vector Register
  • XA
    Source Vector Register
  • XB
    Source Vector Register