xscmpgedp
VSX Scalar Compare Greater Than or Equal (Double-Precision)
Compares two double-precision floating-point values and sets the target vector register based on the comparison result.
Details
The instruction compares the double-precision floating-point value in doubleword 0 of VSR[XA] with the double-precision floating-point value in doubleword 0 of VSR[XB]. If the first value is greater than or equal to the second, it sets the target vector register's doubleword 0 to 0xFFFF_FFFF_FFFF_FFFF and doubleword 1 to 0x0000_0000_0000_0000. Otherwise, both doublewords are set to 0x0000_0000_0000_0000.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
src1 ←bfp_CONVERT_FROM_BFP64(VSR[32×AX+A].dword[0])
src2 ←bfp_CONVERT_FROM_BFP64(VSR[32×BX+B].dword[0])
if src1.class.SNaN=1 | src2.class.SNaN=1 then do
vxsnan_flag ←0b1
if FPSCR.VE=0 then vxvc_flag ←0b1
end else
vxvc_flag ←src1.class.QNaN | src2.class.QNaN
vex_flag ←FPSCR.VE & (vxsnan_flag | vxvc_flag)
if vxsnan_flag=1 then SetFX(FPSCR.VXSNAN)
if vxvc_flag=1 then SetFX(FPSCR.VXVC)
if vex_flag=0 then do
if src1 >= src2 then
VSR[32×TX+T].dword[0] ←0xFFFF_FFFF_FFFF_FFFF
VSR[32×TX+T].dword[1] ←0x0000_0000_0000_0000
end else do
VSR[32×TX+T].dword[0] ←0x0000_0000_0000_0000
VSR[32×TX+T].dword[1] ←0x0000_0000_0000_0000
end
end
Programming Note
xscmpgedp can be used to implement the C/C++/Java conditional operation, RESULT = (x>=y) ? a : b. xscmpgedp fGE,fX,fY xxsel fRESULT,fA,fB,fGE xscmpgedp can also be used to implement the C/C++/Java conditional operation, RESULT = (x<=y) ? a : b. xscmpgedp fLE,fY,fX xxsel fRESULT,fA,fB,fLE
Example
Encoding
Operands
-
XT
Target Vector-Specific Register -
XA
Source Vector-Specific Register -
XB
Source Vector-Specific Register