xsmincdp

VSX Scalar Minimum Type-C Double-Precision

xsmincdp XT, XA, XB

Computes the minimum of two double-precision floating-point numbers and handles NaNs according to Type-C rules.

Details

If either src1 or src2 is a NaN, result is src2. Otherwise, if src1 is less than src2, result is src1. Otherwise, result is src2. The contents of doubleword 0 of VSR[XT] are set to the value result. The contents of doubleword 1 of VSR[XT] are set to 0.

Pseudocode Operation

if 'xsmincdp' then
    src1 <- VSR[XA]
    src2 <- VSR[XB]
    if src2 is QNaN or SNaN then
        fx(VXSNAN)
    else if src2 is -Infinity then
        T(src2) <- src2
    else if src2 is +Zero then
        T(src2) <- src2
    else if src2 is +NZF then
        T(src2) <- M(src1, src2)
    else if src2 is +Infinity then
        T(src2) <- src2
    VSR[XT] <- T(src2)

Programming Note

['xsmincdp can be used to implement the C/C++/Java conditional operator (x

Example

xsmincdp vs1, vs2, vs3

Encoding

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

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B