fnmsub
Floating Negative Multiply-Subtract
-(A*C - B)
Details
Floating Negative Multiply-Subtract computes -(A*C - B) using fused multiply-subtract, where the intermediate product is not rounded. The result is rounded to the target precision according to the current rounding mode in FPSCR. FPSCR is updated with FPRF, FR, FI, and exception flags based on the result.
Pseudocode Operation
FRT ← -((FRA × FRC) - FRB)
Update FPSCR[FPRF, FR, FI, exception flags]
Programming Note
The fnmsub instruction is commonly used in scenarios requiring efficient floating-point arithmetic operations, such as in scientific computations or graphics processing. Ensure that the input registers FRA, FRC, and FRB are properly aligned to avoid precision loss. Be aware of potential exceptions like underflow or overflow, which can be managed by checking the FPSCR register after execution.
Example
Encoding
Operands
-
FRT
Target -
FRA
A -
FRC
C -
FRB
B