xscmpgeqp

VSX Scalar Compare Greater Than or Equal Quad-Precision

xscmpgeqp VRT,VRA,VRB

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

Details

The instruction compares the quad-precision floating-point value in VSR[VRA+32] with the value in VSR[VRB+32]. If the first value is greater than or equal to the second, VSR[VRT+32] is set to all 1s; otherwise, it is set to all 0s. Special handling is provided for NaN and QNaN values.

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
src1 ←bfp_CONVERT_FROM_BFP128(VSR[VRA+32])
src2 ←bfp_CONVERT_FROM_BFP128(VSR[VRB+32])
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 bfp_COMPARE_GE(src1, src2)=1 then
      VSR[VRT+32] ← 0xFFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF
   else
      VSR[VRT+32] ← 0x0000_0000_0000_0000_0000_0000_0000_0000
end

Programming Note

xscmpgeqp can be used to implement the C/C++ conditional operation, RESULT = (x>=y) ? a : b. xscmpgeqp vGE,vX,vY xxsel vRESULT,vA,vB,vGE xscmpgeqp can also be used to implement the C/C++ conditional operation, RESULT = (x<=y) ? a : b. xscmpgeqp vLE,vY,vX xxsel vRESULT,vA,vB,vLE

Example

xscmpgeqp v1, v2, v3

Encoding

Binary Layout
18
0
VRT
6
VRA
11
VRB
16
 
Format X-form
Opcode 0xFC000188
Extension VSX
Registers Altered FPSCR

Operands

  • VRT
    Target Vector-Scalar Register
  • VRA
    Source Vector-Scalar Register
  • VRB
    Source Vector-Scalar Register