Skip to content

Commit

Permalink
Add -ffp-contract=off to .bazelrc.
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 Ansell <tansell@google.com>
  • Loading branch information
mithro committed Jan 10, 2024
1 parent 0f59694 commit b8dfdac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# limitations under the License.

build --cxxopt "-std=c++17"
build --cxxopt "-ffp-contract=off"
build --host_cxxopt "-std=c++17"
build --host_cxxopt "-ffp-contract=off"
build --crosstool_top=@llvm_toolchain//:toolchain

build:ciremotebuild --crosstool_top=@llvm_toolchain//:toolchain
Expand Down

0 comments on commit b8dfdac

Please sign in to comment.