Concerns regarding the -ffp-contract=fast default
Florian Weimer
fweimer@redhat.com
Mon Sep 18 16:41:55 GMT 2023
* Alexander Monakov:
>> > Contracting 'x + x - x' to fma(x, 2, -x) would be fine.
>>
>> It still changes the result, doesn't it?
>
> I don't follow. I doesn't change the result for infinities (produces
> a NaN). It changes the result when x is so large that 'x + x' is
> not representable (exponent would overflow), but that's exactly what
> contraction is about?
Okay, you meant “changing the result” as in “changing the result in a
permitted way”. Sorry, was confused. So this is a bad example all
around. Are there better ones (that don't involve FMA)?
Thanks,
Florian
More information about the Gcc
mailing list