xsmaxcdp

VSX Scalar Maximum Type-C Double-Precision

xsmaxcdp XT, XA, XB

Computes the maximum of two double-precision floating-point values and stores the result in a vector scalar register.

Details

Computes the maximum of two double-precision floating-point scalar values and stores the result in the target VSR. The operation follows the IEEE 754 maximum semantics where positive zero is greater than negative zero, and any comparison with NaN returns NaN. This instruction is part of the VSX category and does not set CR or XER flags.

Pseudocode Operation

XT_dp ← maxc_dp(XA_dp, XB_dp)

Programming Note

xsmaxcdp can be used to implement the C/C++/Java conditional operation (x>y)?x:y for single-precision and double-precision arguments. Previous versions of the architecture allowed the contents of doubleword 1 of the result register to be undefined. However, all processors that support this instruction write 0s into doubleword 1 of the result register, as is required by this version of the architecture.

Example

xsmaxcdp vs1, vs2, vs3

Encoding

Binary Layout
60
0
XT
6
XA
11
XB
16
152
21
 
Format XX3-form
Opcode 0xF0000400
Extension VSX
Registers Altered FPSCR (FX, VXSNAN)

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B