xsnmsubmsp
VSX Scalar Negative Multiply-Subtract Type-M Single-Precision
xsnmsubmsp XT,XA,XB
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.
Encoding
Binary Layout
60
0:5
XT
6:10
XA
11:15
XB
16:20
1224
21:31
Operands
-
XT
Target VSR. In the Type-M form it also supplies the multiplier, and it receives the negated result. -
XA
First source VSR, the multiplicand. -
XB
Second source VSR, subtracted from the product.
Example
xsnmsubmsp
Related
More in VSX
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
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].
Operation
VSR[XT].dword[0] ← -( VSR[XA].dword[0] × VSR[XT].dword[0] - VSR[XB].dword[0] )
The result is rounded to single precision and FPSCR exception flags are updated.
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.