Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCC per default enables one optimization for x86_64 that can change the result of floating-point operations: -ffp-contract=fast. This allows the compiler to do floating-point expression contraction such as combining multiplication and addition instructions with an FMA instruction. However, the FMA instruction omits the rounding done in the multiplication instruction, making the calculations produce different results for some input values. Disabling floating-point contraction with -ffp-contract=off makes GCC generate code that produces a consistent result for x86_64. See https://kristerw.github.io/2021/11/09/fp-contract/ The `fft_test` checks that this is working correctly. Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
- Loading branch information