[PATCH] PR16258 - fadd with undef not folded

Duncan Sands baldrick at free.fr
Mon Jun 10 09:02:30 PDT 2013


Hi Stephen,

On 10/06/13 17:53, Stephen Canon wrote:
> On Jun 10, 2013, at 8:50 AM, Duncan Sands <baldrick at free.fr
> <mailto:baldrick at free.fr>> wrote:
>
>>>> If undef can't be achieved, it might still be possible to fold to a NaN
>>>> or some other special value.
>>>
>>> Folding to NaN sounds workable to me.
>>
>> So if Y is a well-chosen NaN (or will any NaN do?) then fadd X, Y will always
>> be equal to Y?  Does the same go for fmul, fsub and fdiv?
>
> If Y is any NaN, then the result of any IEEE-754 basic operation (add, sub, mul,
> div, sqrt, ... ) will be NaN (it will not “be equal to Y", because NaNs compare
> unequal to everything).

by equal I meant: the same bit pattern.

Ciao, Duncan.




More information about the llvm-commits mailing list