Also link to the source from the demos

This commit is contained in:
dcodeIO
2018-04-19 18:53:01 +02:00
parent 7d3fb86691
commit 18ef7c1932
12 changed files with 499 additions and 501 deletions

View File

@ -1,20 +1,21 @@
(module
(type $iiiv (func (param i32 i32 i32)))
(memory $0 1)
(export "update" (func $../../examples/mandelbrot/assembly/index/update))
(export "compute" (func $../../examples/mandelbrot/assembly/index/compute))
(export "memory" (memory $0))
(func $../../examples/mandelbrot/assembly/index/update (; 0 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 f64)
(local $4 f64)
(func $../../examples/mandelbrot/assembly/index/compute (; 0 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $6 f64)
(local $7 f64)
(local $8 f64)
(local $9 f64)
(local $10 f64)
(local $11 f64)
(local $12 f64)
(local $13 f64)
(local $14 f64)
(set_local $9
(f64.div
(f64.convert_u/i32
@ -42,7 +43,7 @@
(loop $continue|0
(if
(i32.lt_u
(get_local $5)
(get_local $3)
(get_local $1)
)
(block
@ -50,20 +51,20 @@
(f64.mul
(f64.sub
(f64.convert_u/i32
(get_local $5)
(get_local $3)
)
(get_local $10)
)
(get_local $8)
)
)
(set_local $6
(set_local $4
(i32.const 0)
)
(loop $continue|1
(if
(i32.lt_u
(get_local $6)
(get_local $4)
(get_local $0)
)
(block
@ -71,83 +72,78 @@
(f64.mul
(f64.sub
(f64.convert_u/i32
(get_local $6)
(get_local $4)
)
(get_local $9)
)
(get_local $8)
)
)
(set_local $7
(set_local $5
(i32.const 0)
)
(block $break|2
(set_local $3
(set_local $6
(f64.const 0)
)
(set_local $4
(set_local $7
(f64.const 0)
)
(loop $continue|2
(if
(f64.le
(f64.add
(f64.mul
(get_local $3)
(get_local $3)
(tee_local $13
(f64.mul
(get_local $6)
(get_local $6)
)
)
(f64.mul
(get_local $4)
(get_local $4)
(tee_local $14
(f64.mul
(get_local $7)
(get_local $7)
)
)
)
(f64.const 4)
)
(block
(set_local $13
(f64.add
(f64.sub
(f64.mul
(get_local $3)
(get_local $3)
)
(f64.mul
(get_local $4)
(get_local $4)
)
)
(get_local $12)
)
)
(set_local $4
(set_local $7
(f64.add
(f64.mul
(f64.mul
(f64.const 2)
(get_local $3)
(get_local $6)
)
(get_local $4)
(get_local $7)
)
(get_local $11)
)
)
(set_local $3
(get_local $13)
(set_local $6
(f64.add
(f64.sub
(get_local $13)
(get_local $14)
)
(get_local $12)
)
)
(br_if $break|2
(i32.ge_u
(tee_local $7
(tee_local $5
(i32.add
(get_local $7)
(get_local $5)
(i32.const 1)
)
)
(get_local $2)
)
)
(set_local $7
(set_local $5
(i32.add
(get_local $7)
(get_local $5)
(i32.const 1)
)
)
@ -159,22 +155,22 @@
(i32.store8
(i32.add
(i32.mul
(get_local $5)
(get_local $3)
(get_local $0)
)
(get_local $6)
(get_local $4)
)
(i32.div_u
(i32.mul
(get_local $7)
(get_local $5)
(i32.const 255)
)
(get_local $2)
)
)
(set_local $6
(set_local $4
(i32.add
(get_local $6)
(get_local $4)
(i32.const 1)
)
)
@ -182,9 +178,9 @@
)
)
)
(set_local $5
(set_local $3
(i32.add
(get_local $5)
(get_local $3)
(i32.const 1)
)
)

View File

@ -1 +1 @@
export { update } from "../../examples/mandelbrot/assembly/index";
export { compute } from "../../examples/mandelbrot/assembly/index";

View File

@ -2,9 +2,9 @@
(type $iiiv (func (param i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "update" (func $../../examples/mandelbrot/assembly/index/update))
(export "compute" (func $../../examples/mandelbrot/assembly/index/compute))
(export "memory" (memory $0))
(func $../../examples/mandelbrot/assembly/index/update (; 0 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $../../examples/mandelbrot/assembly/index/compute (; 0 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 f64)
(local $4 f64)
(local $5 f64)
@ -16,6 +16,8 @@
(local $11 f64)
(local $12 f64)
(local $13 f64)
(local $14 f64)
(local $15 f64)
(set_local $3
(f64.div
(f64.convert_u/i32
@ -89,12 +91,13 @@
(set_local $10
(i32.const 0)
)
(nop)
(block $break|2
(block
(set_local $11
(set_local $13
(f64.const 0)
)
(set_local $12
(set_local $14
(f64.const 0)
)
)
@ -102,48 +105,46 @@
(if
(f64.le
(f64.add
(f64.mul
(get_local $11)
(get_local $11)
(tee_local $11
(f64.mul
(get_local $13)
(get_local $13)
)
)
(f64.mul
(get_local $12)
(get_local $12)
(tee_local $12
(f64.mul
(get_local $14)
(get_local $14)
)
)
)
(f64.const 4)
)
(block
(block
(set_local $13
(set_local $15
(f64.add
(f64.sub
(f64.mul
(get_local $11)
(get_local $11)
)
(f64.mul
(get_local $12)
(get_local $12)
)
(get_local $11)
(get_local $12)
)
(get_local $9)
)
)
(set_local $12
(set_local $14
(f64.add
(f64.mul
(f64.mul
(f64.const 2)
(get_local $11)
(get_local $13)
)
(get_local $12)
(get_local $14)
)
(get_local $7)
)
)
(set_local $11
(get_local $13)
(set_local $13
(get_local $15)
)
(if
(i32.ge_u