diff options
-rw-r--r-- | src/preamble.js | 6 | ||||
-rwxr-xr-x | tests/runner.py | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js index 05269c6e..a7731e7f 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -742,17 +742,19 @@ Module['writeArrayToMemory'] = writeArrayToMemory; {{{ unSign }}} {{{ reSign }}} -if (!Math.imul) Math.imul = function(a, b) { #if PRECISE_I32_MUL +if (!Math.imul) Math.imul = function(a, b) { var ah = a >>> 16; var al = a & 0xffff; var bh = b >>> 16; var bl = b & 0xffff; return (al*bl + ((ah*bl + al*bh) << 16))|0; +}; #else +Math.imul = function(a, b) { return (a*b)|0; // fast but imprecise -#endif }; +#endif // A counter of dependencies for calling run(). If we need to // do asynchronous work before running, increment this and diff --git a/tests/runner.py b/tests/runner.py index 46d040e1..7417524a 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1153,6 +1153,8 @@ m_divisor is 1091269979 self.do_run(src, '3217489085') def test_i32_mul_semiprecise(self): + if Settings.ASM_JS: return self.skip('asm is always fully precise') + Settings.PRECISE_I32_MUL = 0 # we want semiprecise here src = r''' |