summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/Oz.wast26
-rw-r--r--test/lit/passes/inlining-optimizing_optimize-level=3.wast90
-rw-r--r--test/wasm2js/emscripten.2asm.js.opt6
-rw-r--r--test/wasm2js/i64-rotate.2asm.js.opt115
-rw-r--r--test/wasm2js/i64-shifts.2asm.js.opt18
-rw-r--r--test/wasm2js/unary-ops.2asm.js.opt22
6 files changed, 147 insertions, 130 deletions
diff --git a/test/lit/passes/Oz.wast b/test/lit/passes/Oz.wast
index 2ded890f7..31b2e03b9 100644
--- a/test/lit/passes/Oz.wast
+++ b/test/lit/passes/Oz.wast
@@ -17,14 +17,13 @@
;; CHECK: (func $basics (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $0)
- ;; CHECK-NEXT: (local.get $1)
- ;; CHECK-NEXT: )
- ;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $0)
- ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.tee $0
+ ;; CHECK-NEXT: (i32.add
+ ;; CHECK-NEXT: (local.get $0)
+ ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $basics (export "localcse") (param $x i32) ($param $y i32) (result i32) ;; -O3 does localcse
@@ -41,9 +40,11 @@
;; CHECK: (func $8 (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
;; CHECK-NEXT: (i32.store
;; CHECK-NEXT: (local.tee $0
- ;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $1)
- ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (local.tee $1
+ ;; CHECK-NEXT: (i32.add
+ ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.and
@@ -55,10 +56,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
;; CHECK-NEXT: (local.tee $0
- ;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $1)
- ;; CHECK-NEXT: (i32.const 4)
- ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.or
;; CHECK-NEXT: (i32.load
diff --git a/test/lit/passes/inlining-optimizing_optimize-level=3.wast b/test/lit/passes/inlining-optimizing_optimize-level=3.wast
index 9d0ba919b..4a4f21f94 100644
--- a/test/lit/passes/inlining-optimizing_optimize-level=3.wast
+++ b/test/lit/passes/inlining-optimizing_optimize-level=3.wast
@@ -299,11 +299,13 @@
;; CHECK-NEXT: (local $12 i32)
;; CHECK-NEXT: (local $13 i32)
;; CHECK-NEXT: (local.set $8
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.tee $4
+ ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $STACKTOP
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.get $4)
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -314,12 +316,14 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (call $abort)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $6
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.set $4
+ ;; CHECK-NEXT: (local.tee $0
+ ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $STACKTOP
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -331,7 +335,7 @@
;; CHECK-NEXT: (call $abort)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
- ;; CHECK-NEXT: (local.get $6)
+ ;; CHECK-NEXT: (local.get $4)
;; CHECK-NEXT: (local.get $8)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $0
@@ -339,12 +343,14 @@
;; CHECK-NEXT: (i32.const 8)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $1
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.set $2
+ ;; CHECK-NEXT: (local.tee $1
+ ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $STACKTOP
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: (i32.const 224)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -355,24 +361,24 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (call $abort)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $2
+ ;; CHECK-NEXT: (local.set $1
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (i32.const 120)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $4
+ ;; CHECK-NEXT: (local.set $5
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (i32.const 136)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $5
+ ;; CHECK-NEXT: (local.set $6
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: (local.tee $3
;; CHECK-NEXT: (local.tee $7
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (i32.const 80)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -393,14 +399,14 @@
;; CHECK-NEXT: (i32.const 4)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.get $5)
+ ;; CHECK-NEXT: (local.get $6)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
- ;; CHECK-NEXT: (local.get $2)
+ ;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: (i32.load
- ;; CHECK-NEXT: (local.get $6)
+ ;; CHECK-NEXT: (local.get $4)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
@@ -409,8 +415,8 @@
;; CHECK-NEXT: (call $_printf_core
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (i32.const 672)
- ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (local.get $7)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.const 0)
@@ -444,7 +450,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (if
;; CHECK-NEXT: (i32.load
- ;; CHECK-NEXT: (local.tee $5
+ ;; CHECK-NEXT: (local.tee $6
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: (i32.const 48)
@@ -455,8 +461,8 @@
;; CHECK-NEXT: (call $_printf_core
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: (i32.const 672)
- ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (local.get $7)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -473,7 +479,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
;; CHECK-NEXT: (local.get $9)
- ;; CHECK-NEXT: (local.get $4)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
;; CHECK-NEXT: (local.tee $12
@@ -482,7 +488,7 @@
;; CHECK-NEXT: (i32.const 28)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.get $4)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
;; CHECK-NEXT: (local.tee $11
@@ -491,10 +497,10 @@
;; CHECK-NEXT: (i32.const 20)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.get $4)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
- ;; CHECK-NEXT: (local.get $5)
+ ;; CHECK-NEXT: (local.get $6)
;; CHECK-NEXT: (i32.const 80)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
@@ -505,16 +511,16 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (local.get $4)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: (i32.const 80)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.set $2
+ ;; CHECK-NEXT: (local.set $1
;; CHECK-NEXT: (call $_printf_core
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: (i32.const 672)
- ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (local.get $7)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -547,7 +553,7 @@
;; CHECK-NEXT: (local.get $10)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
- ;; CHECK-NEXT: (local.get $5)
+ ;; CHECK-NEXT: (local.get $6)
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
@@ -583,10 +589,10 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $STACKTOP
- ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $STACKTOP
- ;; CHECK-NEXT: (local.get $6)
+ ;; CHECK-NEXT: (local.get $4)
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $STACKTOP
;; CHECK-NEXT: (local.get $8)
@@ -4085,11 +4091,13 @@
;; CHECK-NEXT: (local $47 i32)
;; CHECK-NEXT: (local $48 i32)
;; CHECK-NEXT: (local.set $13
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.tee $5
+ ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $STACKTOP
;; CHECK-NEXT: (i32.add
- ;; CHECK-NEXT: (global.get $STACKTOP)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: (i32.const 624)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -5818,19 +5826,21 @@
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
;; CHECK-NEXT: (f64.store
- ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: (local.tee $5
+ ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: (local.get $14)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.load
- ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $30
;; CHECK-NEXT: (if (result i32)
;; CHECK-NEXT: (i32.lt_s
;; CHECK-NEXT: (i32.load offset=4
- ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
@@ -5875,12 +5885,14 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (f64.store
- ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: (local.tee $5
+ ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: (local.get $14)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.load
- ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $7
@@ -5888,7 +5900,7 @@
;; CHECK-NEXT: (i32.lt_u
;; CHECK-NEXT: (i32.and
;; CHECK-NEXT: (i32.load offset=4
- ;; CHECK-NEXT: (global.get $tempDoublePtr)
+ ;; CHECK-NEXT: (local.get $5)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.const 2146435072)
;; CHECK-NEXT: )
diff --git a/test/wasm2js/emscripten.2asm.js.opt b/test/wasm2js/emscripten.2asm.js.opt
index 5d14ea4b3..57df79dfc 100644
--- a/test/wasm2js/emscripten.2asm.js.opt
+++ b/test/wasm2js/emscripten.2asm.js.opt
@@ -185,14 +185,16 @@ function asmFunc(env) {
function bools($0) {
$0 = $0 | 0;
+ var $1 = 0;
bools(HEAP8[0] & 1);
bools(HEAP8[0] & 1);
bools(HEAP16[0] & 1);
bools(HEAP16[0] & 1);
bools(HEAP32[0] & 1);
bools(HEAPU8[0] & 2);
- bools($0 ^ 1);
- if ($0 ^ 1) {
+ $1 = $0 ^ 1;
+ bools($1);
+ if ($1) {
bools(2)
}
if ($0 ^ 2) {
diff --git a/test/wasm2js/i64-rotate.2asm.js.opt b/test/wasm2js/i64-rotate.2asm.js.opt
index ecffd160a..33c3d5350 100644
--- a/test/wasm2js/i64-rotate.2asm.js.opt
+++ b/test/wasm2js/i64-rotate.2asm.js.opt
@@ -16,98 +16,101 @@ function asmFunc(env) {
var i64toi32_i32$HIGH_BITS = 0;
function legalstub$1($0, $1, $2, $3, $4, $5) {
var $6 = 0, $7 = 0, $8 = 0;
- $3 = $0;
- $8 = $2 & 63;
- $6 = $8;
- $0 = $6 & 31;
+ $8 = $0;
+ $0 = 0;
+ $7 = $2 & 63;
+ $6 = $7;
+ $3 = $6 & 31;
if ($6 >>> 0 >= 32) {
- $0 = -1 >>> $0 | 0
+ $3 = -1 >>> $3 | 0
} else {
- $7 = -1 >>> $0 | 0;
- $0 = (1 << $0) - 1 << 32 - $0 | -1 >>> $0;
+ $6 = -1 >>> $3 | 0;
+ $0 = $6;
+ $3 = $0 | (1 << $3) - 1 << 32 - $3;
}
- $6 = $0 & $3;
- $0 = $1 & $7;
- $7 = $8 & 31;
- if ($8 >>> 0 >= 32) {
- $0 = $6 << $7;
- $8 = 0;
+ $6 = $3 & $8;
+ $0 = $0 & $1;
+ $3 = $7 & 31;
+ if ($7 >>> 0 >= 32) {
+ $0 = $6 << $3;
+ $6 = 0;
} else {
- $0 = (1 << $7) - 1 & $6 >>> 32 - $7 | $0 << $7;
- $8 = $6 << $7;
+ $0 = (1 << $3) - 1 & $6 >>> 32 - $3 | $0 << $3;
+ $6 = $6 << $3;
}
- $7 = $0;
- $6 = 0 - $2 & 63;
- $0 = $6;
- $2 = $0 & 31;
- if ($0 >>> 0 >= 32) {
- $0 = -1 << $2;
- $2 = 0;
+ $3 = $0;
+ $2 = 0 - $2 & 63;
+ $7 = $2;
+ $0 = $7 & 31;
+ if ($7 >>> 0 >= 32) {
+ $0 = -1 << $0;
+ $7 = 0;
} else {
- $0 = (1 << $2) - 1 & -1 >>> 32 - $2 | -1 << $2;
- $2 = -1 << $2;
+ $7 = -1 << $0;
+ $0 = $7 | (1 << $0) - 1 & -1 >>> 32 - $0;
}
- $3 = $2 & $3;
+ $8 = $7 & $8;
$1 = $0 & $1;
- $0 = $6 & 31;
- if ($6 >>> 0 >= 32) {
+ $0 = $2 & 31;
+ if ($2 >>> 0 >= 32) {
$2 = 0;
$0 = $1 >>> $0 | 0;
} else {
$2 = $1 >>> $0 | 0;
- $0 = ((1 << $0) - 1 & $1) << 32 - $0 | $3 >>> $0;
+ $0 = ((1 << $0) - 1 & $1) << 32 - $0 | $8 >>> $0;
}
- $0 = $0 | $8;
- i64toi32_i32$HIGH_BITS = $2 | $7;
+ $0 = $0 | $6;
+ i64toi32_i32$HIGH_BITS = $2 | $3;
return ($0 | 0) == ($4 | 0) & ($5 | 0) == (i64toi32_i32$HIGH_BITS | 0);
}
function legalstub$2($0, $1, $2, $3, $4, $5) {
var $6 = 0, $7 = 0, $8 = 0, $9 = 0;
- $3 = $0;
- $8 = $2 & 63;
- $0 = $8;
- $6 = $0 & 31;
- if ($0 >>> 0 >= 32) {
- $0 = -1 << $6;
- $6 = 0;
+ $9 = $0;
+ $7 = $2 & 63;
+ $3 = $7;
+ $0 = $3 & 31;
+ if ($3 >>> 0 >= 32) {
+ $0 = -1 << $0;
+ $3 = 0;
} else {
- $0 = (1 << $6) - 1 & -1 >>> 32 - $6 | -1 << $6;
- $6 = -1 << $6;
+ $3 = -1 << $0;
+ $0 = $3 | (1 << $0) - 1 & -1 >>> 32 - $0;
}
- $9 = $6 & $3;
- $7 = $0 & $1;
- $6 = $8 & 31;
- if ($8 >>> 0 >= 32) {
+ $8 = $3 & $9;
+ $6 = $0 & $1;
+ $3 = $7 & 31;
+ if ($7 >>> 0 >= 32) {
$0 = 0;
- $8 = $7 >>> $6 | 0;
+ $7 = $6 >>> $3 | 0;
} else {
- $0 = $7 >>> $6 | 0;
- $8 = ((1 << $6) - 1 & $7) << 32 - $6 | $9 >>> $6;
+ $0 = $6 >>> $3 | 0;
+ $7 = ((1 << $3) - 1 & $6) << 32 - $3 | $8 >>> $3;
}
- $6 = $0;
- $7 = 0 - $2 & 63;
- $0 = $7;
+ $3 = $0;
+ $6 = 0 - $2 & 63;
+ $0 = $6;
$2 = $0 & 31;
if ($0 >>> 0 >= 32) {
$0 = 0;
$2 = -1 >>> $2 | 0;
} else {
- $0 = -1 >>> $2 | 0;
- $2 = (1 << $2) - 1 << 32 - $2 | -1 >>> $2;
+ $8 = -1 >>> $2 | 0;
+ $0 = $8;
+ $2 = $0 | (1 << $2) - 1 << 32 - $2;
}
- $2 = $2 & $3;
+ $2 = $2 & $9;
$1 = $0 & $1;
- $0 = $7 & 31;
- if ($7 >>> 0 >= 32) {
+ $0 = $6 & 31;
+ if ($6 >>> 0 >= 32) {
$1 = $2 << $0;
$0 = 0;
} else {
$1 = (1 << $0) - 1 & $2 >>> 32 - $0 | $1 << $0;
$0 = $2 << $0;
}
- $0 = $0 | $8;
- i64toi32_i32$HIGH_BITS = $1 | $6;
+ $0 = $0 | $7;
+ i64toi32_i32$HIGH_BITS = $1 | $3;
return ($0 | 0) == ($4 | 0) & ($5 | 0) == (i64toi32_i32$HIGH_BITS | 0);
}
diff --git a/test/wasm2js/i64-shifts.2asm.js.opt b/test/wasm2js/i64-shifts.2asm.js.opt
index 3bc6cac10..4981ca880 100644
--- a/test/wasm2js/i64-shifts.2asm.js.opt
+++ b/test/wasm2js/i64-shifts.2asm.js.opt
@@ -14,25 +14,27 @@ function asmFunc(env) {
var nan = NaN;
var infinity = Infinity;
function legalstub$1($0, $1, $2, $3, $4, $5) {
- $3 = $2 & 31;
+ $3 = $0;
+ $0 = $2 & 31;
if (($2 & 63) >>> 0 >= 32) {
- $1 = $0 << $3;
+ $1 = $3 << $0;
$0 = 0;
} else {
- $1 = (1 << $3) - 1 & $0 >>> 32 - $3 | $1 << $3;
- $0 = $0 << $3;
+ $1 = (1 << $0) - 1 & $3 >>> 32 - $0 | $1 << $0;
+ $0 = $3 << $0;
}
return ($0 | 0) == ($4 | 0) & ($1 | 0) == ($5 | 0);
}
function legalstub$2($0, $1, $2, $3, $4, $5) {
- $3 = $2 & 31;
+ $3 = $0;
+ $0 = $2 & 31;
if (($2 & 63) >>> 0 >= 32) {
$2 = $1 >> 31;
- $0 = $1 >> $3;
+ $0 = $1 >> $0;
} else {
- $2 = $1 >> $3;
- $0 = ((1 << $3) - 1 & $1) << 32 - $3 | $0 >>> $3;
+ $2 = $1 >> $0;
+ $0 = ((1 << $0) - 1 & $1) << 32 - $0 | $3 >>> $0;
}
return ($0 | 0) == ($4 | 0) & ($2 | 0) == ($5 | 0);
}
diff --git a/test/wasm2js/unary-ops.2asm.js.opt b/test/wasm2js/unary-ops.2asm.js.opt
index 027c9164d..ecf227753 100644
--- a/test/wasm2js/unary-ops.2asm.js.opt
+++ b/test/wasm2js/unary-ops.2asm.js.opt
@@ -46,23 +46,23 @@ function asmFunc(env) {
function legalstub$2($0, $1_1, $2, $3) {
var $4 = 0, $5 = 0, $6_1 = 0, $7_1 = 0;
- $7_1 = $2;
+ $5 = $0;
$4 = $1_1;
while (1) {
- $2 = $5;
$1_1 = $6_1;
- if ($0 | $4) {
- $1_1 = $0;
- $0 = $1_1 - 1 & $1_1;
- $4 = $4 - ($1_1 >>> 0 < 1) & $4;
- $5 = $5 + 1 | 0;
- $6_1 = $5 >>> 0 < 1 ? $6_1 + 1 | 0 : $6_1;
+ $0 = $7_1;
+ if ($5 | $4) {
+ $0 = $5;
+ $5 = $0 - 1 & $0;
+ $4 = $4 - ($0 >>> 0 < 1) & $4;
+ $6_1 = $6_1 + 1 | 0;
+ $7_1 = $6_1 >>> 0 < 1 ? $7_1 + 1 | 0 : $7_1;
continue;
}
break;
};
- i64toi32_i32$HIGH_BITS = $1_1;
- return ($2 | 0) == ($7_1 | 0) & ($3 | 0) == (i64toi32_i32$HIGH_BITS | 0);
+ i64toi32_i32$HIGH_BITS = $0;
+ return ($1_1 | 0) == ($2 | 0) & ($3 | 0) == (i64toi32_i32$HIGH_BITS | 0);
}
function legalstub$3($0, $1_1, $2) {
@@ -87,7 +87,7 @@ function asmFunc(env) {
function legalstub$9($0, $1_1, $2, $3) {
var $4 = 0, $5 = 0, $6_1 = 0, $7_1 = 0;
__inlined_func$__wasm_ctz_i64 : {
- if ($0 | $1_1) {
+ if ($1_1 | $0) {
$4 = $1_1 - 1 | 0;
$5 = $4 + 1 | 0;
$6_1 = $4;