3 ms·
Sure it will: > -ffp-contract=fast enables floating-point expression contraction such as forming of fused multiply-add operations if the target has native supp
by zokier 3y ago
Sure it will:
> -ffp-contract=fast enables floating-point expression contraction such as forming of fused multiply-add operations if the target has native support for them
> The default is -ffp-contract=off for C in a standards compliant mode (-std=c11 or similar), -ffp-contract=fast otherwise.
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-ffp-contract https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#ind...
- gpderetta 3y agoOh, wow, forgot about fp-contract. It says it is off in C by default, what about C++?
- zokier 3y agoRead closer, it defaults to fast, not off
- planede 3y agoI would have expected to be a bug in the documentation? Why would they turn FMA off for standard compliant C mode, but not for standard compliant C++ mode? But the documentation does appear to be correct: https://godbolt.org/z/3bvP136oc https://godbolt.org/z/3bvP136oc Crazy.
- gpderetta 3y agoit defaults to off for standard-compliant mode. Which in my mind was the default mode as that's what we use everywhere I have worked in the last 15 years. But of course that's not the case. In any case, according to the sibling comment, the default is 'fast' even in std-compliant mode in C++, which I find very surprising. I'm not very familiar with that corner of the standard, but it must be looser than the equivalent wording in the C standard.