Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,3 @@ the following terms:

Copyright (c) the V8 project authors
The 3-Clause BSD License (https://opensource.org/licenses/BSD-3-Clause)

* Arm Optimized Routines: https://github.com/ARM-software/optimized-routines

Copyright (c) Arm Limited
The MIT License (https://opensource.org/licenses/MIT)
Binary file modified examples/mandelbrot/build/optimized.wasm
Binary file not shown.
200 changes: 99 additions & 101 deletions examples/mandelbrot/build/optimized.wat
Original file line number Diff line number Diff line change
@@ -1,133 +1,136 @@
(module
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$dd (func (param f64) (result f64)))
(type $FUNCSIG$v (func))
(type $f64_=>_f64 (func (param f64) (result f64)))
(type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32)))
(import "env" "memory" (memory $0 0))
(import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64)))
(import "Math" "log2" (func $~lib/bindings/Math/log2 (param f64) (result f64)))
(export "memory" (memory $0))
(export "computeLine" (func $assembly/index/computeLine))
(func $assembly/index/computeLine (; 2 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(func $assembly/index/computeLine (; 2 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(local $4 f64)
(local $5 f64)
(local $6 f64)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $8 f64)
(local $9 f64)
(local $10 f64)
(local $11 f64)
(local $12 f64)
(local $13 f64)
(local $14 f64)
(local $15 f64)
local.get $1
f64.convert_i32_u
local.tee $9
f64.const 0.625
f64.mul
local.get $0
f64.convert_i32_u
local.get $2
f64.convert_i32_u
local.tee $6
f64.const 0.5
f64.mul
f64.sub
f64.const 10
f64.const 3
local.get $9
f64.mul
f64.const 4
local.get $1
i32.const 3
i32.mul
local.tee $6
local.get $2
i32.const 2
i32.shl
local.tee $2
local.get $6
f64.mul
f64.min
local.get $2
i32.lt_s
select
f64.convert_i32_s
f64.div
local.tee $10
local.tee $9
f64.mul
local.set $10
local.get $1
f64.convert_i32_u
f64.const 0.625
f64.mul
local.set $11
local.get $10
local.get $9
f64.mul
local.set $13
local.set $12
local.get $0
local.get $1
i32.mul
i32.const 1
i32.shl
local.set $0
local.set $2
f64.const 1
local.get $3
f64.convert_i32_u
local.tee $6
f64.div
local.set $14
f64.const 8
local.get $6
f64.min
local.set $15
loop $loop|0
block $break|0
local.get $8
local.get $1
i32.ge_u
br_if $break|0
local.get $8
local.set $13
i32.const 8
local.get $3
i32.const 8
local.get $3
i32.lt_u
select
local.set $0
i32.const 0
local.set $6
loop $for-loop|0
local.get $6
local.get $1
i32.lt_u
if
local.get $6
f64.convert_i32_u
local.get $10
local.get $9
f64.mul
local.get $13
local.get $12
f64.sub
local.set $12
f64.const 0
local.set $4
local.set $11
f64.const 0
local.tee $4
local.set $5
i32.const 0
local.set $7
loop $continue|1
block $break|1
local.get $4
local.get $4
f64.mul
local.tee $9
local.get $5
local.get $5
f64.mul
local.tee $6
f64.add
f64.const 4
f64.le
i32.eqz
br_if $break|1
f64.const 2
local.get $4
f64.mul
local.get $5
f64.mul
local.get $11
f64.add
local.set $5
local.get $9
local.get $6
f64.sub
local.get $12
f64.add
local.set $4
local.get $7
local.get $3
i32.ge_u
br_if $break|1
local.get $7
i32.const 1
i32.add
local.set $7
br $continue|1
loop $while-continue|1
local.get $4
local.get $4
f64.mul
local.tee $14
local.get $5
local.get $5
f64.mul
local.tee $8
f64.add
f64.const 4
f64.le
if
block $while-break|1
f64.const 2
local.get $4
f64.mul
local.get $5
f64.mul
local.get $10
f64.add
local.set $5
local.get $14
local.get $8
f64.sub
local.get $11
f64.add
local.set $4
local.get $7
local.get $3
i32.ge_u
br_if $while-break|1
local.get $7
i32.const 1
i32.add
local.set $7
br $while-continue|1
end
end
end
loop $continue|2
loop $while-continue|2
local.get $7
f64.convert_i32_u
local.get $15
f64.lt
local.get $0
i32.lt_u
if
local.get $4
local.get $4
Expand All @@ -136,30 +139,28 @@
local.get $5
f64.mul
f64.sub
local.get $12
local.get $11
f64.add
f64.const 2
local.get $4
f64.mul
local.get $5
f64.mul
local.get $11
local.get $10
f64.add
local.set $5
local.set $4
local.get $7
i32.const 1
i32.add
local.set $7
br $continue|2
br $while-continue|2
end
end
i32.const 2047
local.set $2
local.get $8
local.get $6
i32.const 1
i32.shl
local.get $0
local.get $2
i32.add
local.get $4
local.get $4
Expand All @@ -168,7 +169,7 @@
local.get $5
f64.mul
f64.add
local.tee $6
local.tee $8
f64.const 1
f64.gt
if (result i32)
Expand All @@ -178,32 +179,29 @@
i32.add
f64.convert_i32_u
f64.const 0.5
local.get $6
local.get $8
call $~lib/bindings/Math/log
f64.mul
call $~lib/bindings/Math/log2
f64.sub
local.get $14
local.get $13
f64.mul
f64.const 0
f64.max
f64.const 1
f64.min
f64.mul
i32.trunc_f64_u
else
else
i32.const 2047
end
i32.store16
local.get $8
local.get $6
i32.const 1
i32.add
local.set $8
br $loop|0
local.set $6
br $for-loop|0
end
end
)
(func $null (; 3 ;) (type $FUNCSIG$v)
nop
)
)
Loading