summaryrefslogtreecommitdiff
path: root/test/emcc_hello_world.fromasm.imprecise
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2020-06-22 22:15:53 +0300
committerGitHub <noreply@github.com>2020-06-22 12:15:53 -0700
commita3acdae356fc53eecdb52338d9bdd82310afa8a7 (patch)
treed87618ce2b20b5be1042f576a341a4dda570ad03 /test/emcc_hello_world.fromasm.imprecise
parent721f15831ca547de98992f9ce6158d822b94d167 (diff)
downloadbinaryen-a3acdae356fc53eecdb52338d9bdd82310afa8a7.tar.gz
binaryen-a3acdae356fc53eecdb52338d9bdd82310afa8a7.tar.bz2
binaryen-a3acdae356fc53eecdb52338d9bdd82310afa8a7.zip
More optimizations for pow of two and pos/neg one const on the right (#2870)
Diffstat (limited to 'test/emcc_hello_world.fromasm.imprecise')
-rw-r--r--test/emcc_hello_world.fromasm.imprecise92
1 files changed, 31 insertions, 61 deletions
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 4c5d7afd2..ce1db8ea2 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -7014,78 +7014,48 @@
)
(func $_fmt_u (; has Stack IR ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
- (local $4 i32)
(if
- (i32.or
- (i32.and
- (i32.eqz
- (local.get $1)
- )
- (i32.gt_u
- (local.get $0)
- (i32.const -1)
- )
- )
- (i32.gt_u
- (local.get $1)
- (i32.const 0)
- )
+ (i32.gt_u
+ (local.get $1)
+ (i32.const 0)
)
- (local.set $0
- (loop $while-in (result i32)
- (i32.store8
- (local.tee $2
- (i32.add
- (local.get $2)
- (i32.const -1)
- )
- )
- (i32.or
- (call $___uremdi3
- (local.get $0)
- (local.get $1)
- (i32.const 10)
- )
- (i32.const 48)
+ (loop $while-in
+ (i32.store8
+ (local.tee $2
+ (i32.add
+ (local.get $2)
+ (i32.const -1)
)
)
- (local.set $3
- (call $___udivdi3
+ (i32.or
+ (call $___uremdi3
(local.get $0)
(local.get $1)
(i32.const 10)
)
+ (i32.const 48)
)
- (local.set $4
- (global.get $tempRet0)
+ )
+ (local.set $0
+ (call $___udivdi3
+ (local.get $0)
+ (local.get $1)
+ (i32.const 10)
)
- (if (result i32)
- (i32.or
- (i32.and
- (i32.eq
- (local.get $1)
- (i32.const 9)
- )
- (i32.gt_u
- (local.get $0)
- (i32.const -1)
- )
- )
- (i32.gt_u
- (local.get $1)
- (i32.const 9)
- )
- )
- (block
- (local.set $0
- (local.get $3)
- )
- (local.set $1
- (local.get $4)
- )
- (br $while-in)
+ )
+ (local.set $3
+ (global.get $tempRet0)
+ )
+ (if
+ (i32.gt_u
+ (local.get $1)
+ (i32.const 9)
+ )
+ (block
+ (local.set $1
+ (local.get $3)
)
- (local.get $3)
+ (br $while-in)
)
)
)