How is FNMSUB.S different from FMUL plus add/subtract?
FNMSUB.S is fused: the product is not first rounded into an intermediate FP result; the whole expression is rounded once at the end according to rm.
single-precision negated fused multiply-subtract: rd = -(rs1 * rs2) + rs3, with one final rounding according to rm.
FNMSUB.S uses the R4 four-register format for single-precision negated fused multiply-subtract. The rs1*rs2 product is not rounded or written as an intermediate result; it is combined with rs3 as one fused expression, rounded once according to rm, and written to rd.
Shows the F-extension single-precision R4 fused multiply operation flow: decode fields, read FP operands, perform FNMSUB semantics, then write rd.
The word is split as an R4-type instruction; FNMSUB.S uses its dedicated major opcode 1001011, not the ordinary OP-FP opcode.
This animation accepts only whitelisted finite exact examples, and the computed result must also stay in the whitelist; NaN, infinity, and rounding-boundary paths are covered in static text. Invalid input is not used for calculation.
This animation accepts only whitelisted finite exact examples, and the computed result must also stay in the whitelist; NaN, infinity, and rounding-boundary paths are covered in static text. Invalid input is not used for calculation.
This animation shows only F-extension ISA-visible R4 encoding, example numeric results, and fflags relationship; it does not model FPU pipelines, latency, every IEEE 754 corner case, or microarchitecture.
FNMSUB.S's key points are R4 encoding and fused semantics: rs3 is a real third source register, and the product plus/minus term forms one exact intermediate expression that is rounded only once.
Understand this scenario with real code like «fnmsub.s f0, f1, f2, f3, rne # f0 = -(rs1 * rs2) + rs3».
Understand this scenario with real code like «fnmsub.s f0, f1, f2, f3, rne # f0 = -(rs1 * rs2) + rs3».
FNMSUB.S is fused: the product is not first rounded into an intermediate FP result; the whole expression is rounded once at the end according to rm.
It needs rd, rs1, rs2, rs3, and rm fields; bits 31..27 hold rs3, not an ordinary R-type funct5 field.
It can set FP exception flags under the official FP rules, such as inexact, overflow, underflow, or invalid operation; the default animation uses exact finite values, so it shows fflags remaining 0.