How is FMSUB.D 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.
Double-precision fused multiply-subtract: rd = (rs1 * rs2) - rs3, rounded once.
FMSUB.D uses the R4 four-register format for double-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.D'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.d f0, f1, f2, f3 # f0 = f1*f2-f3».
Understand this scenario with real code like «fmsub.d 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.