diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-25 16:07:55 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-25 16:07:55 -0500 |
commit | 87961191d46590e485cb1ab97b4cd95e692a5794 (patch) | |
tree | afcca3ade18c9fb102327a2415d746e67ec1389c /src | |
parent | 6475478ff1ff227aea169fdb9a33ea87a5c52082 (diff) |
always replace Math.imul in non-precise i32 mul mode, and disable test for that in asm since asm alaways assumes precision
Diffstat (limited to 'src')
-rw-r--r-- | src/preamble.js | 6 |
1 files changed, 4 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 |