PSON decoder example using namespaced imports

This commit is contained in:
dcodeIO
2017-12-30 05:11:58 +01:00
parent c67f87a988
commit 2888ba14ad
41 changed files with 1283 additions and 336 deletions

View File

@ -33,206 +33,204 @@
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(local $10 i32)
(nop)
(nop)
(block
(set_local $6
(set_local $0
(i32.sub
(get_global $../../examples/game-of-life/assembly/game-of-life/h)
(i32.const 1)
)
)
(set_local $7
(set_local $1
(i32.sub
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
(i32.const 1)
)
)
)
(block
(set_local $10
(i32.const 0)
)
)
(block $break|0
(set_local $0
(i32.const 0)
(block
(set_local $2
(i32.const 0)
)
)
(loop $continue|0
(if
(i32.lt_u
(get_local $0)
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/h)
)
(block
(block
(set_local $1
(select
(get_local $6)
(i32.sub
(block
(set_local $3
(select
(get_local $0)
(i32.const 1)
)
(i32.eq
(get_local $0)
(i32.const 0)
(i32.sub
(get_local $2)
(i32.const 1)
)
(i32.eq
(get_local $2)
(i32.const 0)
)
)
)
)
(set_local $2
(select
(i32.const 0)
(i32.add
(get_local $0)
(i32.const 1)
)
(i32.eq
(get_local $0)
(get_local $6)
(set_local $4
(select
(i32.const 0)
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.eq
(get_local $2)
(get_local $0)
)
)
)
)
(block $break|1
(set_local $3
(i32.const 0)
(block
(set_local $5
(i32.const 0)
)
)
(loop $continue|1
(if
(i32.lt_u
(get_local $3)
(get_local $5)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(block
(block
(set_local $4
(select
(get_local $7)
(i32.sub
(get_local $3)
(i32.const 1)
(block
(set_local $6
(select
(get_local $1)
(i32.sub
(get_local $5)
(i32.const 1)
)
(i32.eq
(get_local $5)
(i32.const 0)
)
)
(i32.eq
(get_local $3)
)
(set_local $7
(select
(i32.const 0)
(i32.add
(get_local $5)
(i32.const 1)
)
(i32.eq
(get_local $5)
(get_local $1)
)
)
)
)
(set_local $5
(select
(i32.const 0)
(i32.add
(get_local $3)
(i32.const 1)
)
(i32.eq
(get_local $3)
(get_local $7)
)
)
)
(set_local $8
(i32.add
(block
(set_local $8
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.load8_u
(i32.add
(i32.mul
(get_local $1)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
(i32.add
(i32.load8_u
(i32.add
(i32.mul
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $6)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $5)
)
(get_local $4)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $1)
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $3)
(get_local $7)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $1)
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $5)
(get_local $6)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $0)
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $4)
(get_local $7)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $0)
(get_local $4)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $5)
(get_local $6)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $2)
(get_local $4)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $4)
(get_local $5)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $2)
(get_local $4)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $3)
(get_local $7)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $5)
)
)
)
)
(set_local $9
(i32.load8_u
(i32.add
(i32.mul
(get_local $0)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $3)
)
)
)
(if
(get_local $9)
(i32.load8_u
(i32.add
(i32.mul
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $5)
)
)
(if
(if (result i32)
(i32.lt_u
@ -253,11 +251,11 @@
(i32.add
(get_global $../../examples/game-of-life/assembly/game-of-life/s)
(i32.mul
(get_local $0)
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
)
(get_local $3)
(get_local $5)
)
(i32.const 0)
)
@ -272,20 +270,20 @@
(i32.add
(get_global $../../examples/game-of-life/assembly/game-of-life/s)
(i32.mul
(get_local $0)
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
)
(get_local $3)
(get_local $5)
)
(i32.const 1)
)
)
)
)
(set_local $3
(set_local $5
(i32.add
(get_local $3)
(get_local $5)
(i32.const 1)
)
)
@ -295,9 +293,9 @@
)
)
)
(set_local $0
(set_local $2
(i32.add
(get_local $0)
(get_local $2)
(i32.const 1)
)
)