fmsub

Floating Multiply-Subtract

fmsub FRT, FRA, FRC, FRB

Multiplies two floating-point values and subtracts a third.

Details

The fmsub 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 product. The result is rounded to the target precision and stored in register FRT.

Pseudocode Operation

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

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

fmsub f1, f2, f4, f3

Encoding

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

Operands

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