4 ms·
In the spec, the pseudocode defines them as FMADD: addend + ( op1 * op2) FMSUB: addend + (-op1 * op2) FNMADD: -addend + (-op1 * op2) FNMSUB: -a
by pm215 5y ago
In the spec, the pseudocode defines them as
FMADD: addend + ( op1 * op2)
FMSUB: addend + (-op1 * op2)
FNMADD: -addend + (-op1 * op2)
FNMSUB: -addend + ( op1 * op2)
which is to say that in all three cases the result is the output of a fused multiply-add; the difference is just whether (a) the addend and (b) op1 are negated before feeding them in.
IEEE 754-2008 only defines that you have to provide a fusedMultiplyAdd() operation, so it's up to the CPU architecture whether folding in the free negations is something they want to provide, and if so, where exactly the negation is done.