summaryrefslogtreecommitdiff
path: root/test/wasm2js/i64-rotate.2asm.js.opt
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-01-10 06:37:00 -0800
committerGitHub <noreply@github.com>2020-01-10 06:37:00 -0800
commit263d2d5025c98092f781c8b8d9eb7ac6df6aadab (patch)
tree4994c331c247a7c78d241f655b10a93e59027593 /test/wasm2js/i64-rotate.2asm.js.opt
parent98747d97f089354091d115fb300006f3cc506a0c (diff)
downloadbinaryen-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/i64-rotate.2asm.js.opt')
-rw-r--r--test/wasm2js/i64-rotate.2asm.js.opt16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/wasm2js/i64-rotate.2asm.js.opt b/test/wasm2js/i64-rotate.2asm.js.opt
index 69fefab76..a3e2091fc 100644
--- a/test/wasm2js/i64-rotate.2asm.js.opt
+++ b/test/wasm2js/i64-rotate.2asm.js.opt
@@ -35,9 +35,9 @@ function asmFunc(global, env, buffer) {
$5 = $6;
$3 = $5 & 31;
if (32 <= $5 >>> 0) {
- $3 = -1 >>> $3
+ $3 = -1 >>> $3 | 0
} else {
- $4 = -1 >>> $3;
+ $4 = -1 >>> $3 | 0;
$3 = (1 << $3) - 1 << 32 - $3 | -1 >>> $3;
}
$5 = $3 & $0;
@@ -66,9 +66,9 @@ function asmFunc(global, env, buffer) {
$1 = $4 & 31;
if (32 <= $4 >>> 0) {
$2 = 0;
- $0 = $3 >>> $1;
+ $0 = $3 >>> $1 | 0;
} else {
- $2 = $3 >>> $1;
+ $2 = $3 >>> $1 | 0;
$0 = ((1 << $1) - 1 & $3) << 32 - $1 | $0 >>> $1;
}
$0 = $0 | $6;
@@ -92,9 +92,9 @@ function asmFunc(global, env, buffer) {
$5 = $6 & 31;
if (32 <= $6 >>> 0) {
$4 = 0;
- $6 = $3 >>> $5;
+ $6 = $3 >>> $5 | 0;
} else {
- $4 = $3 >>> $5;
+ $4 = $3 >>> $5 | 0;
$6 = ((1 << $5) - 1 & $3) << 32 - $5 | $7 >>> $5;
}
$7 = $4;
@@ -102,9 +102,9 @@ function asmFunc(global, env, buffer) {
$5 = $3 & 31;
if (32 <= $3 >>> 0) {
$4 = 0;
- $2 = -1 >>> $5;
+ $2 = -1 >>> $5 | 0;
} else {
- $4 = -1 >>> $5;
+ $4 = -1 >>> $5 | 0;
$2 = (1 << $5) - 1 << 32 - $5 | -1 >>> $5;
}
$0 = $2 & $0;