xsnmaddasp

VSX Scalar Negative Multiply-Add Single-Precision Type-A

xsnmaddasp XT,XA,XB

Performs a negative multiply-add operation on single-precision floating-point values.

Details

For xsnmaddasp, the double-precision floating-point value in doubleword element 0 of VSR[XA] is multiplied by the double-precision floating-point value in doubleword element 0 of VSR[XB], and then added to the double-precision floating-point value in doubleword element 0 of VSR[XT]. The result is negated, rounded to single-precision format, and placed into doubleword element 0 of VSR[XT] in double-precision format.

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
reset_xflags()
src1 ←bfp_CONVERT_FROM_BFP64(VSR[32×AX+A].dword[0])
src2 ←bfp_CONVERT_FROM_BFP64(VSR[32×TX+T].dword[0])
src3 ←bfp_CONVERT_FROM_BFP64(VSR[32×BX+B].dword[0])
v ←bfp_MULTIPLY_ADD(src1, src3, src2)
rnd ←bfp_NEGATE(bfp_ROUND_TO_BFP32(FPSCR.RN, v))
result32 ←bfp32_CONVERT_FROM_BFP(rnd)
result64 ←bfp64_CONVERT_FROM_BFP(rnd)
vxsnan_flag=1 then SetFX(FPSCR.VXSNAN)
vximz_flag=1 then SetFX(FPSCR.VXIMZ)
vxisi_flag=1 then SetFX(FPSCR.VXISI)
ox_flag=1 then SetFX(FPSCR.OX)
ux_flag=1 then SetFX(FPSCR.UX)
xx_flag=1 then SetFX(FPSCR.XX)
vx_flag  ←vxsnan_flag | vximz_flag | vxisi_flag
vex_flag ←FPSCR.VE & vx_flag
if vex_flag=0 then do
    VSR[32×TX+T].dword[0] ←result64
    VSR[32×TX+T].dword[1] ←0x0000_0000_0000_0000
    FPSCR.FPRF ←fprf_CLASS_BFP32(result32)
    FPSCR.FR  ←inc_flag
    FPSCR.FI  ←xx_flag
else do
    FPSCR.FR  ←0b0
    FPSCR.FI  ←0b0
end

Programming Note

See Table 7.32, “Scalar Floating-Point Final Result with Negation,” on page 669.

Example

xsnmaddasp vs1, vs2, vs3

Encoding

Binary Layout
1111
0
0001
6
0000
11
0000
16
0000
21
0000
29
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
 
Format XX3-form
Opcode 0xF0000408
Extension VSX
Registers Altered FPSCR, VSR[XT], VSR[XA], VSR[XB]

Operands

  • XT
    Target Vector-Scalar Register
  • XA
    Source Vector-Scalar Register
  • XB
    Source Vector-Scalar Register