xsmaxcdp
VSX Scalar Maximum Type-C Double-Precision
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
Encoding
Operands
-
XT
Target -
XA
Src A -
XB
Src B