xsnmsubmsp

VSX Scalar Negative Multiply-Subtract Type-M Single-Precision

xsnmsubmsp

Performs a scalar negative multiply-subtract operation in single-precision floating-point, storing the result using the Type-M (multiplicand) form where the target register provides one of the multiplicand operands.

Details

Performs a VSX scalar negative multiply-subtract operation on single-precision floating-point values using the Type-M form, where the target register (VRT) provides the subtrahend multiplicand operand. Computes −(VRA × VRT − VRB) and stores the result in VRT. This operation uses the FPSCR rounding mode and may set exception flags FPSCR[VXSNAN, VXISI, VXSQRT, VXCVI, XX, ZX, UX, OX].

Pseudocode Operation

VRT[0:31] ← −(VRA[0:31] × VRT[0:31] − VRB[0:31])
Update FPSCR exception flags based on floating-point result

Programming Note

The xsnmsubmsp instruction is useful for performing complex floating-point calculations involving multiplication, subtraction, and negation in a single operation. Ensure that the target register (XT) is properly aligned and contains valid single-precision floating-point values to avoid undefined behavior. This instruction operates at user privilege level and may raise exceptions if operands are out of range or if there are NaNs involved.

Example

xsnmsubmsp

Encoding

Binary Layout
60
0
XT
6
XA
11
XB
16
1224
21
 
Format XX3-form
Opcode 0xF00004C8
Extension VSX

Operands

  • VRT
    Target and first source VSX register (scalar single-precision)
  • VRA
    Second source VSX register (scalar single-precision multiplicand)
  • VRB
    Third source VSX register (scalar single-precision subtrahend)