summaryrefslogtreecommitdiff
path: root/test/wasm2js/select.2asm.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-04-25 17:10:06 -0700
committerGitHub <noreply@github.com>2019-04-25 17:10:06 -0700
commit78a4f9ef1afd6c209a5c69a8e7906ffe33575f58 (patch)
tree0f7443f2ca32ce1a6131a6cc95212de9b5ececb1 /test/wasm2js/select.2asm.js
parent21f014f4bd0ea1086895d8674f1473af222eb416 (diff)
downloadbinaryen-78a4f9ef1afd6c209a5c69a8e7906ffe33575f58.tar.gz
binaryen-78a4f9ef1afd6c209a5c69a8e7906ffe33575f58.tar.bz2
binaryen-78a4f9ef1afd6c209a5c69a8e7906ffe33575f58.zip
wasm2js2: optimize call_indirect and select operands (#2056)
Don't use temp vars to reorder them unless we need to.
Diffstat (limited to 'test/wasm2js/select.2asm.js')
-rw-r--r--test/wasm2js/select.2asm.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/wasm2js/select.2asm.js b/test/wasm2js/select.2asm.js
index 07de1de95..efe720c21 100644
--- a/test/wasm2js/select.2asm.js
+++ b/test/wasm2js/select.2asm.js
@@ -28,8 +28,7 @@ function asmFunc(global, env, buffer) {
lhs = lhs | 0;
rhs = rhs | 0;
cond = cond | 0;
- var wasm2js_i32$0 = 0, wasm2js_i32$1 = 0, wasm2js_i32$2 = 0;
- return (wasm2js_i32$0 = lhs, wasm2js_i32$1 = rhs, wasm2js_i32$2 = cond, wasm2js_i32$2 ? wasm2js_i32$0 : wasm2js_i32$1) | 0;
+ return (cond ? lhs : rhs) | 0;
}
function $1(lhs, lhs$hi, rhs, rhs$hi, cond) {
@@ -38,13 +37,13 @@ function asmFunc(global, env, buffer) {
rhs = rhs | 0;
rhs$hi = rhs$hi | 0;
cond = cond | 0;
- var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, i64toi32_i32$2 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0, wasm2js_i32$2 = 0;
+ var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, i64toi32_i32$2 = 0;
i64toi32_i32$0 = lhs$hi;
i64toi32_i32$0 = rhs$hi;
i64toi32_i32$4 = cond;
i64toi32_i32$0 = lhs$hi;
- i64toi32_i32$3 = (wasm2js_i32$0 = lhs, wasm2js_i32$1 = rhs, wasm2js_i32$2 = i64toi32_i32$4, wasm2js_i32$2 ? wasm2js_i32$0 : wasm2js_i32$1);
- i64toi32_i32$2 = (wasm2js_i32$0 = i64toi32_i32$0, wasm2js_i32$1 = rhs$hi, wasm2js_i32$2 = i64toi32_i32$4, wasm2js_i32$2 ? wasm2js_i32$0 : wasm2js_i32$1);
+ i64toi32_i32$3 = i64toi32_i32$4 ? lhs : rhs;
+ i64toi32_i32$2 = i64toi32_i32$4 ? i64toi32_i32$0 : rhs$hi;
i64toi32_i32$HIGH_BITS = i64toi32_i32$2;
return i64toi32_i32$3 | 0;
}
@@ -53,16 +52,14 @@ function asmFunc(global, env, buffer) {
lhs = Math_fround(lhs);
rhs = Math_fround(rhs);
cond = cond | 0;
- var wasm2js_f32$0 = Math_fround(0), wasm2js_f32$1 = Math_fround(0), wasm2js_i32$0 = 0;
- return Math_fround((wasm2js_f32$0 = lhs, wasm2js_f32$1 = rhs, wasm2js_i32$0 = cond, wasm2js_i32$0 ? wasm2js_f32$0 : wasm2js_f32$1));
+ return Math_fround(cond ? lhs : rhs);
}
function $3(lhs, rhs, cond) {
lhs = +lhs;
rhs = +rhs;
cond = cond | 0;
- var wasm2js_f64$0 = 0.0, wasm2js_f64$1 = 0.0, wasm2js_i32$0 = 0;
- return +(wasm2js_f64$0 = lhs, wasm2js_f64$1 = rhs, wasm2js_i32$0 = cond, wasm2js_i32$0 ? wasm2js_f64$0 : wasm2js_f64$1);
+ return +(cond ? lhs : rhs);
}
function $4(cond) {