summaryrefslogtreecommitdiff
path: root/test/emcc_hello_world.fromasm.imprecise
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2017-02-13 17:47:48 -0800
committerAlon Zakai (kripken) <alonzakai@gmail.com>2017-02-16 22:45:40 -0800
commitff8705ef08502411093cef7a90c7f30833147af1 (patch)
treea87e230a8bcab95a9ff8d25b60657dc9ba8d5508 /test/emcc_hello_world.fromasm.imprecise
parentced44f4fd543b50980d4bf674fa6a30f9c31790f (diff)
downloadbinaryen-ff8705ef08502411093cef7a90c7f30833147af1.tar.gz
binaryen-ff8705ef08502411093cef7a90c7f30833147af1.tar.bz2
binaryen-ff8705ef08502411093cef7a90c7f30833147af1.zip
optimize a compare of a load_s and a sign-extend into a load_u and a cheaper zero-extend
Diffstat (limited to 'test/emcc_hello_world.fromasm.imprecise')
-rw-r--r--test/emcc_hello_world.fromasm.imprecise38
1 files changed, 13 insertions, 25 deletions
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 1fa81ba43..52fa498da 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -1861,15 +1861,12 @@
(loop $while-in
(if
(i32.eq
- (i32.load8_s
+ (i32.load8_u
(get_local $2)
)
- (i32.shr_s
- (i32.shl
- (get_local $4)
- (i32.const 24)
- )
- (i32.const 24)
+ (i32.and
+ (get_local $4)
+ (i32.const 255)
)
)
(block
@@ -1938,20 +1935,14 @@
)
(if
(i32.ne
- (i32.load8_s
+ (i32.load8_u
(get_local $2)
)
- (i32.shr_s
- (i32.shl
- (tee_local $1
- (i32.and
- (get_local $1)
- (i32.const 255)
- )
- )
- (i32.const 24)
+ (tee_local $1
+ (i32.and
+ (get_local $1)
+ (i32.const 255)
)
- (i32.const 24)
)
)
(block
@@ -2032,15 +2023,12 @@
(loop $while-in5
(br_if $label$break$L8
(i32.eq
- (i32.load8_s
+ (i32.load8_u
(get_local $2)
)
- (i32.shr_s
- (i32.shl
- (get_local $1)
- (i32.const 24)
- )
- (i32.const 24)
+ (i32.and
+ (get_local $1)
+ (i32.const 255)
)
)
)