xsmaxjdp

Vector Scalar Maximum of Double-Precision Floating-Point Values with Java Rounding

xsmaxjdp XT, XA, XB

Compares two double-precision floating-point values and returns the larger one, with specific handling for zero and NaN values.

Details

Computes the maximum of two double-precision floating-point scalar values using Java-compliant semantics, where -0.0 is greater than +0.0, and NaN handling follows Java rules. The result is stored in the target VSR. This instruction is part of the VSX category and does not update CR or XER.

Pseudocode Operation

XT_dp ← maxj_dp(XA_dp, XB_dp)

Programming Note

xsmaxjdp can be used to implement the Java max() function for single-precision and double-precision arguments. Despite Java not recognizing the concept of exception status, VXSNAN is set to 1 if either operand is an SNaN.

Example

xsmaxjdp vs1, vs2, vs3

Encoding

Binary Layout
18
0
T
6
A
11
B
16
144
21
AX
29
BX
30
TX
31
 
Format XX3-form
Opcode 0xF0000480
Extension VSX
Registers Altered FPSCR (FX, VXSNAN)

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B