diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-17 14:02:35 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-17 14:03:35 -0800 |
commit | a481dec416597879d56b0254e7c255b71c1b36e2 (patch) | |
tree | 67635f560131c98215c86c7bea7d96bb48d05aef | |
parent | bae7c6e93962e4cb25ee5fa532bee5ba7f8f237c (diff) |
check all i64 functions for whether we need to include precise i64 code
-rwxr-xr-x | emscripten.py | 10 | ||||
-rw-r--r-- | tests/test_core.py | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/emscripten.py b/emscripten.py index c96c56a0..a1b6a606 100755 --- a/emscripten.py +++ b/emscripten.py @@ -801,9 +801,13 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, # Settings changes assert settings['TARGET_LE32'] == 1 settings['TARGET_LE32'] = 2 - if 'i64Add' in metadata['declares']: # TODO: others, once we split them up - settings['PRECISE_I64_MATH'] = 2 - metadata['declares'] = filter(lambda i64_func: i64_func not in ['getHigh32', 'setHigh32', '__muldi3', '__divdi3', '__remdi3', '__udivdi3', '__uremdi3'], metadata['declares']) # FIXME: do these one by one as normal js lib funcs + i64_funcs = ['i64Add', 'i64Subtract', '__muldi3', '__divdi3', '__udivdi3', '__remdi3', '__uremdi3'] + for i64_func in i64_funcs: + if i64_func in metadata['declares']: + settings['PRECISE_I64_MATH'] = 2 + break + + metadata['declares'] = filter(lambda i64_func: i64_func not in ['getHigh32', 'setHigh32', '__muldi3', '__divdi3', '__remdi3', '__udivdi3', '__uremdi3'], metadata['declares']) # FIXME: do these one by one as normal js lib funcs # Integrate info from backend settings['DEFAULT_LIBRARY_FUNCS_TO_INCLUDE'] = list( diff --git a/tests/test_core.py b/tests/test_core.py index 1349c6c8..4245f069 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -352,8 +352,6 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co ''' self.do_run(src, '*4903566027370624, 153236438355333*') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') - code = open(os.path.join(self.get_dir(), 'src.cpp.o.js')).read() assert 'goog.math.Long' not in code, 'i64 precise math should not have been included if not actually used' |