diff options
author | Alon Zakai <azakai@google.com> | 2020-01-10 06:37:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 06:37:00 -0800 |
commit | 263d2d5025c98092f781c8b8d9eb7ac6df6aadab (patch) | |
tree | 4994c331c247a7c78d241f655b10a93e59027593 /test/wasm2js/stack-modified.2asm.js.opt | |
parent | 98747d97f089354091d115fb300006f3cc506a0c (diff) | |
download | binaryen-263d2d5025c98092f781c8b8d9eb7ac6df6aadab.tar.gz binaryen-263d2d5025c98092f781c8b8d9eb7ac6df6aadab.tar.bz2 binaryen-263d2d5025c98092f781c8b8d9eb7ac6df6aadab.zip |
wasm2js: Do not convert x >>> 0 | 0 to x >>> 0 (#2581)
isBinary was used where we should only accept
a signed binary, as removing the | 0 from an unsigned
value may be incorrect.
This does regress a few small things (as can be seen
in the diff). If it's important we can add more sophisticated
optimizations here, perhaps like an assumption that the
signedness of a local never matters.
Fixes emscripten-core/emscripten#10173
Diffstat (limited to 'test/wasm2js/stack-modified.2asm.js.opt')
-rw-r--r-- | test/wasm2js/stack-modified.2asm.js.opt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/wasm2js/stack-modified.2asm.js.opt b/test/wasm2js/stack-modified.2asm.js.opt index d321f6f67..2cd863f72 100644 --- a/test/wasm2js/stack-modified.2asm.js.opt +++ b/test/wasm2js/stack-modified.2asm.js.opt @@ -52,15 +52,15 @@ function asmFunc(global, env, buffer) { function _ZN17compiler_builtins3int3mul3Mul3mul17h070e9a1c69faec5bE($0_1, $1, $2, $3) { var $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0; - $4 = $2 >>> 16; - $5 = $0_1 >>> 16; + $4 = $2 >>> 16 | 0; + $5 = $0_1 >>> 16 | 0; $9 = Math_imul($4, $5); $6 = $2 & 65535; $7 = $0_1 & 65535; $8 = Math_imul($6, $7); - $5 = ($8 >>> 16) + Math_imul($5, $6) | 0; + $5 = ($8 >>> 16 | 0) + Math_imul($5, $6) | 0; $4 = ($5 & 65535) + Math_imul($4, $7) | 0; - $0_1 = (((Math_imul($1, $2) + $9 | 0) + Math_imul($0_1, $3) | 0) + ($5 >>> 16) | 0) + ($4 >>> 16) | 0; + $0_1 = (Math_imul($1, $2) + $9 | 0) + Math_imul($0_1, $3) + ($5 >>> 16) + ($4 >>> 16) | 0; $1 = $8 & 65535 | $4 << 16; i64toi32_i32$HIGH_BITS = $0_1; return $1; |