Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,6 @@ var ASYNCIFY_IMPORTS_EXCEPT_JS_LIBS = [];

var WARN_DEPRECATED = true;

// Enable fast math optimizations in wasm-opt when -ffast-math is passed.
// This enables aggressive floating-point optimizations that may violate
// IEEE 754 semantics but can improve performance.
var FAST_MATH = 0;

// WebGL 2 provides new garbage-free entry points to call to WebGL. Use
// those always when possible.
// We currently set this to false for certain browser when large memory sizes
Expand Down
5 changes: 3 additions & 2 deletions tools/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def __init__(self):
self.sanitize_minimal_runtime = False
self.sanitize = set()
self.lib_dirs = []
self.fast_math = False


def is_int(s):
Expand Down Expand Up @@ -302,7 +303,7 @@ def consume_arg_file():
settings.DEBUG_LEVEL = max(settings.DEBUG_LEVEL, 1)
elif requested_level == 'fast':
# -Ofast typically includes -ffast-math semantics
settings.FAST_MATH = 1
options.fast_math = True
requested_level = 3
settings.SHRINK_LEVEL = 0
else:
Expand Down Expand Up @@ -552,7 +553,7 @@ def consume_arg_file():
elif arg == '-fignore-exceptions':
settings.DISABLE_EXCEPTION_CATCHING = 1
elif arg == '-ffast-math':
settings.FAST_MATH = 1
options.fast_math = True
elif check_arg('--default-obj-ext'):
exit_with_error('--default-obj-ext is no longer supported by emcc')
elif arg.startswith('-fsanitize=cfi'):
Expand Down
6 changes: 3 additions & 3 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def should_run_binaryen_optimizer():
return settings.OPT_LEVEL >= 2


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