Concerns regarding the -ffp-contract=fast default
Alexander Monakov
amonakov@ispras.ru
Mon Sep 18 11:12:29 GMT 2023
On Mon, 18 Sep 2023, Florian Weimer via Gcc wrote:
> x - x is different because replacing it with 0 doesn't seem to be a
> valid contraction because it's incorrect for NaNs. x + x - x seems to
> be different in this regard, but in our implementation, there might be a
> quirk about sNaNs and qNaNs.
Sorry, do you mean contracting 'x + x - x' to 'x'? That is not allowed
due to different result and lack of FP exception for infinities.
Contracting 'x + x - x' to fma(x, 2, -x) would be fine.
Alexander
More information about the Gcc
mailing list