fmsub
Floating Multiply-Subtract
Multiplies two floating-point values and subtracts a third.
Details
Performs a fused multiply-subtract operation: (FRA × FRC) − FRB in extended precision, then rounds to double-precision and places the result in FRT. FPSCR exception flags and FPRF are updated; this provides higher precision than separate multiply and subtract instructions.
Pseudocode Operation
FRT ← Round((FRA × FRC) − FRB)
FPSCR[FPRF, XX, ZX, UX, OX, VXISI] ← updated based on operation
Programming Note
The fmsub instruction is useful for performing fused multiply-subtract operations, which can help reduce rounding errors. Ensure that the input registers are properly aligned and contain valid floating-point numbers to avoid exceptions. This operation requires FPSCR to manage precision and exception flags.
Example
Encoding
Operands
-
FRT
Target -
FRA
A -
FRC
C -
FRB
B