File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -181,15 +181,18 @@ fn main() {
181
181
// that we're more likely to be throughput bound vs latency bound. Having fewer
182
182
// instructions makes things easier on the processor and in places where it matters we can
183
183
// probably explicitly use reciprocal instructions and avoid the refinement step.
184
+ // Also, allow checks for non-finite values which fast-math may disable.
184
185
if tool. is_like_msvc ( ) {
185
186
build. flag ( "/fp:fast" )
186
187
. flag ( "-Xclang" )
187
- . flag ( "-mrecip=none" ) ;
188
+ . flag ( "-mrecip=none" )
189
+ . flag ( "/clang:-fno-finite-math-only" ) ;
188
190
} else if tool. is_like_clang ( ) {
189
191
// gcc only supports -mrecip=none on some targets so to keep
190
192
// things simple we don't use -ffast-math with gcc at all
191
193
build. flag ( "-ffast-math" )
192
- . flag ( "-mrecip=none" ) ;
194
+ . flag ( "-mrecip=none" )
195
+ . flag ( "-fno-finite-math-only" ) ;
193
196
}
194
197
}
195
198
You can’t perform that action at this time.
0 commit comments