fnmsub

Floating Negative Multiply-Subtract

fnmsub FRT, FRA, FRC, FRB

-(A*C - B)

Details

The fnmsub instruction performs a floating-point multiply-subtract operation. It multiplies the values in registers FRA and FRC, then subtracts the value in register FRB from the result of the multiplication. The final result is rounded to the target precision and placed into register FRT.

Pseudocode Operation

FRT ← [(FRA) × (FRC)] - (FRB)

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