How is FMSUB.S different from FMUL plus add/subtract?
The fused instruction performs one final rounding; two separate instructions round the product first and then round the add/subtract result.
Single-precision fused multiply-subtract: rd = (rs1 * rs2) - rs3, rounded once.
FMSUB.S uses the R4 four-register format for single-precision fused multiply-subtract. The multiply and add/subtract are fused, so the exact intermediate result is rounded only once at the end according to rm before being written to rd.
FMSUB.S's key property is fusion: the product and add/subtract term are not written as an intermediate result and are rounded once at the final step.
Understand this scenario with real code like «fmsub.s f0, f1, f2, f3 # f0 = f1*f2-f3».
Understand this scenario with real code like «fmsub.s f0, f1, f2, f3 # f0 = f1*f2-f3».
The fused instruction performs one final rounding; two separate instructions round the product first and then round the add/subtract result.
It needs rd, rs1, rs2, and rs3 register fields for the two multiply sources and the add/subtract term.