Extract portable AS to its own definition and polyfill; Try running flatten/ssa before default optimizations, see WebAssembly/binaryen#1331

This commit is contained in:
dcodeIO
2017-12-08 19:08:03 +01:00
parent d6b94d4c33
commit 0ebb99a33c
23 changed files with 1515 additions and 1231 deletions

View File

@ -100,7 +100,7 @@
(get_local $4)
(get_global $game-of-life/w)
)
(tee_local $2
(tee_local $3
(select
(i32.sub
(get_local $1)
@ -128,7 +128,7 @@
(get_local $4)
(get_global $game-of-life/w)
)
(tee_local $3
(tee_local $2
(select
(i32.const 0)
(i32.add
@ -150,7 +150,7 @@
(get_local $0)
(get_global $game-of-life/w)
)
(get_local $2)
(get_local $3)
)
)
)
@ -160,7 +160,7 @@
(get_local $0)
(get_global $game-of-life/w)
)
(get_local $3)
(get_local $2)
)
)
)
@ -170,7 +170,7 @@
(get_local $5)
(get_global $game-of-life/w)
)
(get_local $2)
(get_local $3)
)
)
)
@ -190,7 +190,7 @@
(get_local $5)
(get_global $game-of-life/w)
)
(get_local $3)
(get_local $2)
)
)
)
@ -205,32 +205,38 @@
(get_local $1)
)
)
(if
(if (result i32)
(tee_local $3
(i32.lt_s
(get_local $2)
(i32.const 2)
)
)
(get_local $3)
(i32.gt_s
(get_local $2)
(i32.const 3)
)
)
(i32.store8
(i32.add
(i32.add
(get_global $game-of-life/s)
(i32.mul
(get_local $0)
(get_global $game-of-life/w)
(block
(if
(i32.eqz
(tee_local $3
(i32.lt_s
(get_local $2)
(i32.const 2)
)
)
(get_local $1)
)
(i32.const 0)
(set_local $3
(i32.gt_s
(get_local $2)
(i32.const 3)
)
)
)
(if
(get_local $3)
(i32.store8
(i32.add
(i32.add
(get_global $game-of-life/s)
(i32.mul
(get_local $0)
(get_global $game-of-life/w)
)
)
(get_local $1)
)
(i32.const 0)
)
)
)
(if