xsmaxcqp

VSX Scalar Maximum Type-C Quad-Precision

xsmaxcqp vD, vA, vB

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

Details

Compares two quad-precision floating-point values in VSRs and returns the maximum, using Type-C comparison rules (NaN handling as per VSX specification). Results are written to the VSR specified by XT. No exception or condition register fields are altered unless Rc=1 for VSX comparisons.

Pseudocode Operation

fD ← max(fA, fB) using Type-C comparison
if fA is NaN or fB is NaN then
  fD ← QNaN
end if

Programming Note

xsmaxcqp can be used to implement the C/C++ conditional operation (x>y)?x:y for quad-precision arguments. VSR[VRT+32] ←result

Example

xsmaxcqp vd, va, vb

Encoding

Binary Layout
63
0
FRT
6
FRA
11
FRB
16
674
21
Rc
31
 
Format X-form
Opcode 0xFC000548
Extension VSX
Registers Altered FPSCR (FX, VXSNAN)

Operands

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