xsmincqp

VSX Scalar Minimum Type-C Quad-Precision

xsmincqp vD, vA, vB

Compares two quad-precision floating-point values and selects the minimum value.

Details

The xsmincqp instruction compares the contents of VSR[VRA+32] and VSR[VRB+32], and stores the smaller value into VSR[VRT+32]. If either operand is a NaN, the result is the second operand. If an SNaN is encountered, an Invalid Operation exception occurs.

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])
vxsnan_flag ←(src1.class.SNaN=1) |
             (src2.class.SNaN=1)

if (src1.class.SNaN=1) | (src1.class.QNaN=1) |
   (src2.class.SNaN=1) | (src2.class.QNaN=1) then
   result ←VSR[VRB+32]
else if bfp_COMPARE_LT(src1,src2) then
   result ←VSR[VRA+32]
else
   result ←VSR[VRB+32]
vex_flag ←FPSCR.VE & vxsnan_flag

if vxsnan_flag=1 then SetFX(VXSNAN)

if vex_flag=0 then
   VSR[VRT+32] ←result

Programming Note

xsmincqp can be used to implement the C/C++ conditional operator (x

Example

xsmincqp vd, va, vb

Encoding

Binary Layout
63
0
FRT
6
FRA
11
FRB
16
710
21
Rc
31
 
Format X-form
Opcode 0xFC00058C
Extension VSX
Registers Altered FPSCR.FX, FPSCR.VXSNAN

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B
  • VRT
    Target Vector Register
  • VRA
    Source Vector Register
  • VRB
    Source Vector Register