[PATCH] Allow FMAs in safe math mode in some cases when one operand of the fmul is either exactly 0.0 or exactly 1.0.

Stephen Lin swlin at post.harvard.edu
Wed Jul 10 00:37:36 PDT 2013


> What is the behavior of FMA if the intermediate result overflows?
> E.g. what does 2 * __DBL_MAX__ - __DBL_MAX__ give as FMA?
>
> Joerg

I could be wrong but I don't think it even makes sense to ask about
the intermediate result overflowing; I think the operation is defined
as given whatever value would be obtained via an infinite-precision
real number calculation, rounded at the end to the nearest
representable double at the end, so there's no intermediate register
to overflow. Presumably the result would be __DBL_MAX__ in the case
you give.



More information about the llvm-commits mailing list