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.

Encoding

Binary Layout
18
0:5
T
6:10
A
11:15
B
16:20
144
21:28
AX
29
BX
30
TX
31
 
Format XX3-form
Opcode 0xF0000480
Extension VSX

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B

Example

xsmaxjdp vs1, vs2, vs3

Registers Altered

FPSCR (FX, VXSNAN)

Related

More in VSX

Reference

Description

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.

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.