xsminjdp

Vector Scalar Minimum of Double-Precision Floating-Point Values

xsminjdp XT, XA, XB

Compares two double-precision floating-point values and selects the minimum value, handling special cases like NaNs and zeros.

Encoding

Binary Layout
111100
0:5
XA
6:10
XB
11:15
XT
16:20
000000
21:30
010001101000
31
 
Format XX3-form
Opcode 0xF00004C0
Extension VSX

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B

Example

xsminjdp vs1, vs2, vs3

Registers Altered

FPSCR (FX, VXSNAN)

Related

More in VSX

Reference

Description

Computes the minimum of two double-precision floating-point scalar values using Java-compliant semantics, where +0.0 is less 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 ← minj_dp(XA_dp, XB_dp)

Programming Note

xsminjdp can be used to implement the Java min() function for single-precision and double-precision arguments. Java only recognizes the concept of a NaN, but does not distinguish any difference between different NaN encodings, including between a QNaN and a SNaN. As a result, a SNaN operand is propagated as a SNaN (i.e., not converted to a QNaN). Despite Java not recognizing the concept of exception status, VXSNAN is set to 1 if either operand is a SNaN. 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.