Skip to content

Commit

Permalink
Adding -ffp-contract=off flag.
Browse files Browse the repository at this point in the history
This is needed for floating point stability.

The global placement depends on the output of the FFT library. Without
`-ffp-contract=off` the current FFT library produces different results
dependent on if the compiler is targeting an x86 architecture which has
the "FMA instruction".

The FMA instruction omits the rounding done in the multiplication
instruction, making the calculations produce different results for some
input values

See https://kristerw.github.io/2021/11/09/fp-contract/

See also OpenROAD change @
The-OpenROAD-Project/OpenROAD#4518

Signed-off-by: Tim 'mithro' Ansell <[email protected]>
  • Loading branch information
mithro committed Jan 10, 2024
1 parent 14c1dfd commit 0f59694
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dependency_support/org_theopenroadproject/build_helper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ OPENROAD_BINARY_SRCS = OPENROAD_BINARY_SRCS_WITHOUT_MAIN + [

OPENROAD_COPTS = [
"-fexceptions",
"-ffp-contract=off", # Needed for floating point stability.
"-Wno-error",
"-Wall",
"-Wextra",
Expand Down

0 comments on commit 0f59694

Please sign in to comment.