summaryrefslogtreecommitdiff
path: root/test/emcc_O2_hello_world.fromasm
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/emcc_O2_hello_world.fromasm
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/emcc_O2_hello_world.fromasm')
-rw-r--r--test/emcc_O2_hello_world.fromasm176
1 files changed, 70 insertions, 106 deletions
diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm
index 40f7d3585..5aa32979b 100644
--- a/test/emcc_O2_hello_world.fromasm
+++ b/test/emcc_O2_hello_world.fromasm
@@ -158,22 +158,19 @@
(tee_local $1
(i32.add
(i32.shl
- (i32.shl
- (tee_local $10
- (i32.add
- (i32.xor
- (i32.and
- (get_local $2)
- (i32.const 1)
- )
+ (tee_local $10
+ (i32.add
+ (i32.xor
+ (i32.and
+ (get_local $2)
(i32.const 1)
)
- (get_local $6)
+ (i32.const 1)
)
+ (get_local $6)
)
- (i32.const 1)
)
- (i32.const 2)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -339,83 +336,80 @@
(tee_local $11
(i32.add
(i32.shl
- (i32.shl
- (tee_local $10
- (i32.add
+ (tee_local $10
+ (i32.add
+ (i32.or
(i32.or
(i32.or
(i32.or
- (i32.or
- (tee_local $2
- (i32.and
- (i32.shr_u
- (tee_local $7
- (i32.shr_u
- (get_local $2)
- (get_local $1)
- )
- )
- (i32.const 5)
- )
- (i32.const 8)
- )
- )
- (get_local $1)
- )
- (tee_local $7
+ (tee_local $2
(i32.and
(i32.shr_u
- (tee_local $0
+ (tee_local $7
(i32.shr_u
- (get_local $7)
(get_local $2)
+ (get_local $1)
)
)
- (i32.const 2)
+ (i32.const 5)
)
- (i32.const 4)
+ (i32.const 8)
)
)
+ (get_local $1)
)
- (tee_local $0
+ (tee_local $7
(i32.and
(i32.shr_u
- (tee_local $11
+ (tee_local $0
(i32.shr_u
- (get_local $0)
(get_local $7)
+ (get_local $2)
)
)
- (i32.const 1)
+ (i32.const 2)
)
- (i32.const 2)
+ (i32.const 4)
)
)
)
- (tee_local $11
+ (tee_local $0
(i32.and
(i32.shr_u
- (tee_local $19
+ (tee_local $11
(i32.shr_u
- (get_local $11)
(get_local $0)
+ (get_local $7)
)
)
(i32.const 1)
)
- (i32.const 1)
+ (i32.const 2)
)
)
)
- (i32.shr_u
- (get_local $19)
- (get_local $11)
+ (tee_local $11
+ (i32.and
+ (i32.shr_u
+ (tee_local $19
+ (i32.shr_u
+ (get_local $11)
+ (get_local $0)
+ )
+ )
+ (i32.const 1)
+ )
+ (i32.const 1)
+ )
)
)
+ (i32.shr_u
+ (get_local $19)
+ (get_local $11)
+ )
)
- (i32.const 1)
)
- (i32.const 2)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -539,16 +533,13 @@
(set_local $11
(i32.add
(i32.shl
- (i32.shl
- (tee_local $19
- (i32.shr_u
- (get_local $17)
- (i32.const 3)
- )
+ (tee_local $19
+ (i32.shr_u
+ (get_local $17)
+ (i32.const 3)
)
- (i32.const 1)
)
- (i32.const 2)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -1259,16 +1250,13 @@
(set_local $1
(i32.add
(i32.shl
- (i32.shl
- (tee_local $7
- (i32.shr_u
- (get_local $1)
- (i32.const 3)
- )
+ (tee_local $7
+ (i32.shr_u
+ (get_local $1)
+ (i32.const 3)
)
- (i32.const 1)
)
- (i32.const 2)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -2346,11 +2334,8 @@
(set_local $11
(i32.add
(i32.shl
- (i32.shl
- (get_local $6)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $6)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -4370,11 +4355,8 @@
(tee_local $23
(i32.add
(i32.shl
- (i32.shl
- (get_local $6)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $6)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -4535,11 +4517,8 @@
(set_local $0
(i32.add
(i32.shl
- (i32.shl
- (get_local $6)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $6)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -5281,11 +5260,8 @@
(set_local $18
(i32.add
(i32.shl
- (i32.shl
- (get_local $3)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $3)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -5760,11 +5736,8 @@
(tee_local $0
(i32.add
(i32.shl
- (i32.shl
- (get_local $2)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $2)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -6122,11 +6095,8 @@
(tee_local $4
(i32.add
(i32.shl
- (i32.shl
- (get_local $7)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $7)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -7143,11 +7113,8 @@
(tee_local $7
(i32.add
(i32.shl
- (i32.shl
- (get_local $14)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $14)
+ (i32.const 3)
)
(i32.const 216)
)
@@ -7298,11 +7265,8 @@
(set_local $1
(i32.add
(i32.shl
- (i32.shl
- (get_local $3)
- (i32.const 1)
- )
- (i32.const 2)
+ (get_local $3)
+ (i32.const 3)
)
(i32.const 216)
)