[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
reproducibility of fma() when the addend is qNaN
Yesterday I wrote:
If a QNaN addend is detected, the multiplication operands have to be
pretested too to know whether Invalid needs to be signalled -- or a
dummy fma() multiplication with a zero addend carried out (it would
have to be fma, as ordinary multiplication could overflow or underflow).
I had intended to say that dummy multiplication could NOT be used because
of the risk of overflow or underflow -- and I would have been right. It's
true that the fma() multiplication cannot overflow or underflow, but the
subsequent addition can. So each operand has to be tested for zero and
the other for infinity, and vice versa -- lots of branches, though in most
cases heavily biased and hence easy to predict. Luckily this is all under
a single unlikely branch, namely that of a QNaN addend test.
Michel.
Sent: 2007-10-15 00:10:52 UTC