From 0f596948fcc0d3c184b20929bcf661558b64cc84 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 10 Jan 2024 12:34:50 -0800 Subject: [PATCH] Adding `-ffp-contract=off` flag. 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 @ https://github.com/The-OpenROAD-Project/OpenROAD/pull/4518 Signed-off-by: Tim 'mithro' Ansell --- dependency_support/org_theopenroadproject/build_helper.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/dependency_support/org_theopenroadproject/build_helper.bzl b/dependency_support/org_theopenroadproject/build_helper.bzl index 6756f802..a3b04e8f 100644 --- a/dependency_support/org_theopenroadproject/build_helper.bzl +++ b/dependency_support/org_theopenroadproject/build_helper.bzl @@ -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",