fmadd

Floating Multiply-Add

fmadd FRT,FRA,FRC,FRB
fmadd. FRT,FRA,FRC,FRB

Performs (A * C) + B with a single rounding step. (The classic FMA).

Details

The instruction multiplies the contents of register FRA by the contents of register FRC, then adds the result to the contents of register FRB. The final result is placed into register FRT.

Pseudocode Operation

FRT ←[(FRA)×(FRC)] + (FRB)
if 'fmadd.' then
    CR1 <- result class and sign

Programming Note

When Rc=1, CR1 is set from the FPSCR[FX, FEX, VX, OX] bits immediately after the operation completes.

Example

fmadd f1, f2, f3, f4

Encoding

Binary Layout
63
0
FRT
6
FRA
11
FRB
16
FRC
21
29
26
Rc
 
Format A-form
Opcode 0xFC00003A
Extension Floating-Point
Registers Altered FPSCR, CR1, CR0

Operands

  • FRT
    Target FPR
  • FRA
    Multiplier
  • FRC
    Multiplicand
  • FRB
    Addend