Skip to content

Commit fae1074

Browse files
authored
Remove FAST_MATH internal settings (#25634)
This was just added #25513, but using a setting for this was overkill.
1 parent fcb4648 commit fae1074

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/settings_internal.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,6 @@ var ASYNCIFY_IMPORTS_EXCEPT_JS_LIBS = [];
260260

261261
var WARN_DEPRECATED = true;
262262

263-
// Enable fast math optimizations in wasm-opt when -ffast-math is passed.
264-
// This enables aggressive floating-point optimizations that may violate
265-
// IEEE 754 semantics but can improve performance.
266-
var FAST_MATH = 0;
267-
268263
// WebGL 2 provides new garbage-free entry points to call to WebGL. Use
269264
// those always when possible.
270265
// We currently set this to false for certain browser when large memory sizes

tools/cmdline.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def __init__(self):
112112
self.sanitize_minimal_runtime = False
113113
self.sanitize = set()
114114
self.lib_dirs = []
115+
self.fast_math = False
115116

116117

117118
def is_int(s):
@@ -302,7 +303,7 @@ def consume_arg_file():
302303
settings.DEBUG_LEVEL = max(settings.DEBUG_LEVEL, 1)
303304
elif requested_level == 'fast':
304305
# -Ofast typically includes -ffast-math semantics
305-
settings.FAST_MATH = 1
306+
options.fast_math = True
306307
requested_level = 3
307308
settings.SHRINK_LEVEL = 0
308309
else:
@@ -552,7 +553,7 @@ def consume_arg_file():
552553
elif arg == '-fignore-exceptions':
553554
settings.DISABLE_EXCEPTION_CATCHING = 1
554555
elif arg == '-ffast-math':
555-
settings.FAST_MATH = 1
556+
options.fast_math = True
556557
elif check_arg('--default-obj-ext'):
557558
exit_with_error('--default-obj-ext is no longer supported by emcc')
558559
elif arg.startswith('-fsanitize=cfi'):

tools/link.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def should_run_binaryen_optimizer():
360360
return settings.OPT_LEVEL >= 2
361361

362362

363-
def get_binaryen_passes():
363+
def get_binaryen_passes(options):
364364
passes = []
365365
optimizing = should_run_binaryen_optimizer()
366366
# wasm-emscripten-finalize will strip the features section for us
@@ -392,7 +392,7 @@ def get_binaryen_passes():
392392
passes += ['--pass-arg=post-emscripten-side-module']
393393
if optimizing:
394394
passes += [building.opt_level_to_str(settings.OPT_LEVEL, settings.SHRINK_LEVEL)]
395-
if settings.FAST_MATH:
395+
if options.fast_math:
396396
passes += ['--fast-math']
397397
# when optimizing, use the fact that low memory is never used (1024 is a
398398
# hardcoded value in the binaryen pass). we also cannot do it when the stack
@@ -2292,7 +2292,7 @@ def phase_binaryen(target, options, wasm_target):
22922292
# run wasm-opt if we have work for it: either passes, or if we are using
22932293
# source maps (which requires some extra processing to keep the source map
22942294
# but remove DWARF)
2295-
passes = get_binaryen_passes()
2295+
passes = get_binaryen_passes(options)
22962296
if passes:
22972297
# if asyncify is used, we will use it in the next stage, and so if it is
22982298
# the only reason we need intermediate debug info, we can stop keeping it

0 commit comments

Comments
 (0)