Skip to content

Commit f198b51

Browse files
committed
Bug 1746545 - Use -fno-finite-math-only in SWGL. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D136990 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/7949a09f4700715f407092a4a2710c1dd89fc36c
1 parent c025437 commit f198b51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

swgl/build.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,18 @@ fn main() {
181181
// that we're more likely to be throughput bound vs latency bound. Having fewer
182182
// instructions makes things easier on the processor and in places where it matters we can
183183
// probably explicitly use reciprocal instructions and avoid the refinement step.
184+
// Also, allow checks for non-finite values which fast-math may disable.
184185
if tool.is_like_msvc() {
185186
build.flag("/fp:fast")
186187
.flag("-Xclang")
187-
.flag("-mrecip=none");
188+
.flag("-mrecip=none")
189+
.flag("/clang:-fno-finite-math-only");
188190
} else if tool.is_like_clang() {
189191
// gcc only supports -mrecip=none on some targets so to keep
190192
// things simple we don't use -ffast-math with gcc at all
191193
build.flag("-ffast-math")
192-
.flag("-mrecip=none");
194+
.flag("-mrecip=none")
195+
.flag("-fno-finite-math-only");
193196
}
194197
}
195198

0 commit comments

Comments
 (0)