fnmsub

Floating Negative Multiply-Subtract

fnmsub FRT, FRA, FRC, FRB

-(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

fnmsub f1, f2, f4, f3

Encoding

Binary Layout
63
0
FRT
6
FRA
11
FRB
16
FRC
21
30
26
/
31
 
Format A-form
Opcode 0xFC00003C
Extension Floating-Point
Registers Altered FPSCR

Operands

  • FRT
    Target
  • FRA
    A
  • FRC
    C
  • FRB
    B