Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y perl minisat curl gnupg2 locales clang-11 wget
- name: Install wasmfx-tools
run: |
#cd third-party/wasmfx-tools
#cargo build --release
cd third-party/wasmfx-tools
cargo build --release
- name: Run tests
run: |
sbt 'test'
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third-party/wasmfx-tools"]
path = third-party/wasmfx-tools
url = https://github.com/wasmfx/wasmfx-tools.git
3 changes: 3 additions & 0 deletions benchmarks/wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.wasm
!2o1u.wat
!2o1u-no-label.wat
16 changes: 16 additions & 0 deletions benchmarks/wasm/ack.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#[no_mangle]
#[inline(never)]
fn ack(m: i32, n: i32) -> i32 {
if m == 0 {
n + 1
} else if n == 0 {
ack(m - 1, 1)
} else {
ack(m - 1, ack(m, n - 1))
}
}

#[no_mangle]
fn real_main() -> i32 {
ack(2, 2)
}
57 changes: 57 additions & 0 deletions benchmarks/wasm/ack.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
(module $ack.wat.temp
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (result i32)))
(func $ack (type 0) (param i32 i32) (result i32)
local.get 0
local.set 0
local.get 1
local.set 1
block ;; label = @1
loop ;; label = @2
local.get 1
local.set 1
local.get 0
local.tee 0
i32.eqz
br_if 1 (;@1;)
block ;; label = @3
block ;; label = @4
local.get 1
br_if 0 (;@4;)
i32.const 1
local.set 1
br 1 (;@3;)
end
local.get 0
local.get 1
i32.const -1
i32.add
call $ack
local.set 1
end
local.get 0
i32.const -1
i32.add
local.set 0
local.get 1
local.set 1
br 0 (;@2;)
end
end
local.get 1
i32.const 1
i32.add)
(func $real_main (type 1) (result i32)
i32.const 2
i32.const 2
call $ack)
(table (;0;) 1 1 funcref)
(memory (;0;) 16)
(global $__stack_pointer (mut i32) (i32.const 1048576))
(global (;1;) i32 (i32.const 1048576))
(global (;2;) i32 (i32.const 1048576))
(export "memory" (memory 0))
(export "ack" (func 0))
(export "real_main" (func 1))
(export "__data_end" (global 1))
(export "__heap_base" (global 2)))
70 changes: 70 additions & 0 deletions benchmarks/wasm/block.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
(module
(func $test_block (param i32 i32 i32) (result i32)
local.get 0
local.get 1
local.get 2
block (param i32 i32 i32) (result i32 i32)
i32.add
end
i32.add
)
(func $real_main (result i32)
i32.const 1
i32.const 3
i32.const 5
call $test_block
)
;; Sum from [0, 10]
(func $test_loop_input (result i32)
(local i32)
i32.const 10
local.set 0
i32.const 0
loop (param i32) (result i32)
local.get 0
i32.add
local.get 0
i32.const 1
i32.sub
local.set 0
i32.const 0
local.get 0
i32.ne
br_if 0
end
)
(func $test_if_input (result i32)
i32.const 10
i32.const 5
i32.const 1
if (param i32 i32) (result i32 i32)
i32.const 10
i32.add
else
end
i32.add
)
(func $test_poly_br (result i32)
i32.const -30
i32.const 0 ;; unused
i32.const 0 ;; unused
i32.const 0 ;; unused
block (param i32 i32 i32) (result i32 i32)
i32.const 0 ;; truncated
i32.const 10000 ;; truncated
i32.const 10
i32.const 20
br 0
i32.add
end
i32.add
i32.add ;; add value -30 and 30
;; i32.add
;; We can't use i32.add instruction here, because the overflowed value has been truncted
;; when block exited.
)
(export "real_main" (func 1))
(export "test_loop_input" (func 2))
(export "test_if_input" (func 3))
(export "test_poly_br" (func 4))
)
Empty file added benchmarks/wasm/bst.c
Empty file.
Loading