xsmaxcqp

VSX Scalar Maximum Type-C Quad-Precision

xsmaxcqp vD, vA, vB

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

Encoding

Binary Layout
63
0:5
FRT
6:10
FRA
11:15
FRB
16:20
674
21:30
Rc
31
 
Format X-form
Opcode 0xFC000548
Extension VSX

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

Example

xsmaxcqp vd, va, vb

Registers Altered

FPSCR (FX, VXSNAN)

Related

More in VSX

Reference

Description

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.

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