xsmaxdp

Vector Scalar Maximum Double-Precision Floating-Point

xsmaxdp XT, XA, XB

Compares the doubleword elements of two vector scalar registers and stores the maximum value in another vector scalar register.

Details

The xsmaxdp instruction compares the double-precision floating-point value in doubleword element 0 of VSR[XA] (src1) with the double-precision floating-point value in doubleword element 0 of VSR[XB] (src2). The result is placed in doubleword element 0 of VSR[XT], and doubleword element 1 of VSR[XT] is set to 0. If either src1 or src2 is a NaN, the result is determined according to the rules specified in Table 7.64.

Pseudocode Operation

if src1 is NaN or src2 is NaN then
    if VE=1 then
        suppress update of VSR[XT]
    else
        set VXSNAN to 1
        if src1 is SNaN then
            FX <- 1
        else if src2 is SNaN then
            FX <- 1
        end if
    end if
else
    if src1 > src2 then
        T(src1)
    else
        T(src2)
    end if
end if

Programming Note

['This instruction can be used to operate on single-precision source operands.', '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

xsmaxdp vs1, vs2, vs3

Encoding

Binary Layout
60
0
XT
6
XA
11
XB
16
160
21
 
Format XX3-form
Opcode 0xF00000A0
Extension VSX
Registers Altered FPSCR, VXSNAN

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B