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.
Encoding
Binary Layout
T
11:15
A
16:20
B
21:28
AX
29
BX
30
TX
31
Operands
-
XT
Target Vector Register -
XA
Source Vector Register -
XB
Source Vector Register
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
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.
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