summaryrefslogtreecommitdiff
path: root/test/unit.fromasm.imprecise
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-02-16 22:42:31 -0800
committerGitHub <noreply@github.com>2017-02-16 22:42:31 -0800
commitc6ea79d1532face076c2dfeb8eadb58319e4e5fd (patch)
tree12a840d94dda462827a8874371bb9858948ea42b /test/unit.fromasm.imprecise
parent0728a53fb6bf0540b9789c7bcd26e195800c5ecc (diff)
downloadbinaryen-c6ea79d1532face076c2dfeb8eadb58319e4e5fd.tar.gz
binaryen-c6ea79d1532face076c2dfeb8eadb58319e4e5fd.tar.bz2
binaryen-c6ea79d1532face076c2dfeb8eadb58319e4e5fd.zip
Optimize "squared" operations (#905)
* optimize 'almost' sign extends: when we can remove one entirely, then extra shifts can be left behind. with that in place, we can then optimize 'squared' operations like shl on shl, as doing so does not break our sign extend opts
Diffstat (limited to 'test/unit.fromasm.imprecise')
-rw-r--r--test/unit.fromasm.imprecise11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 10c1c025c..64fde3832 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -664,14 +664,11 @@
)
)
(call $loadSigned
- (i32.shr_s
- (i32.shl
- (i32.load16_u
- (get_local $0)
- )
- (i32.const 24)
+ (i32.shl
+ (i32.load16_s
+ (get_local $0)
)
- (i32.const 16)
+ (i32.const 8)
)
)
)