summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2017-02-11 13:09:04 -0800
committerAlon Zakai (kripken) <alonzakai@gmail.com>2017-02-16 22:45:35 -0800
commit41eee37bc153a68b0f0c46162e21f825d1784499 (patch)
treecc16f97c01fef7a61761bbcbecfecd53df9af365 /test
parentc6ea79d1532face076c2dfeb8eadb58319e4e5fd (diff)
downloadbinaryen-41eee37bc153a68b0f0c46162e21f825d1784499.tar.gz
binaryen-41eee37bc153a68b0f0c46162e21f825d1784499.tar.bz2
binaryen-41eee37bc153a68b0f0c46162e21f825d1784499.zip
optimize sign-extends to ne
Diffstat (limited to 'test')
-rw-r--r--test/passes/optimize-instructions.txt32
-rw-r--r--test/passes/optimize-instructions.wast45
2 files changed, 77 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt
index 03f0f7074..25f2dfaa1 100644
--- a/test/passes/optimize-instructions.txt
+++ b/test/passes/optimize-instructions.txt
@@ -1079,4 +1079,36 @@
)
)
)
+ (func $sign-ext-ne (type $4) (param $0 i32) (param $1 i32)
+ (drop
+ (i32.ne
+ (i32.and
+ (get_local $0)
+ (i32.const 255)
+ )
+ (i32.const 232)
+ )
+ )
+ (drop
+ (i32.ne
+ (i32.and
+ (get_local $0)
+ (i32.const 255)
+ )
+ (i32.const 111)
+ )
+ )
+ (drop
+ (i32.ne
+ (i32.and
+ (get_local $0)
+ (i32.const 255)
+ )
+ (i32.and
+ (get_local $1)
+ (i32.const 255)
+ )
+ )
+ )
+ )
)
diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast
index c59bb3ade..191450897 100644
--- a/test/passes/optimize-instructions.wast
+++ b/test/passes/optimize-instructions.wast
@@ -1332,4 +1332,49 @@
)
)
)
+ (func $sign-ext-ne (param $0 i32) (param $1 i32)
+ ;; ne of sign-ext to const, can be a zext
+ (drop
+ (i32.ne
+ (i32.shr_s
+ (i32.shl
+ (get_local $0)
+ (i32.const 24)
+ )
+ (i32.const 24)
+ )
+ (i32.const 65000)
+ )
+ )
+ (drop
+ (i32.ne
+ (i32.shr_s
+ (i32.shl
+ (get_local $0)
+ (i32.const 24)
+ )
+ (i32.const 24)
+ )
+ (i32.const 111)
+ )
+ )
+ (drop
+ (i32.ne
+ (i32.shr_s
+ (i32.shl
+ (get_local $0)
+ (i32.const 24)
+ )
+ (i32.const 24)
+ )
+ (i32.shr_s
+ (i32.shl
+ (get_local $1)
+ (i32.const 24)
+ )
+ (i32.const 24)
+ )
+ )
+ )
+ )
)