xscmpgtdp
VSX Scalar Compare Greater Than Double-Precision
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
Encoding
Operands
-
XT
Target Vector Register -
XA
Source Vector Register -
XB
Source Vector Register