[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.

Steve Canon scanon at apple.com
Wed Jul 10 03:46:51 PDT 2013


On Jul 10, 2013, at 3:37 AM, Stephen Lin <swlin at post.harvard.edu> wrote:

>> 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.

Correct.



More information about the llvm-commits mailing list