Skip to content

Commit b1ea60a

Browse files
authored
Move from GenSym (#1)
* add latest parser * evals * test; wasm-tools missing, some stack overflow * add wasmfx-tools * third party * remove try-catch tests for fx * should be all good now * try not blowing the stack
1 parent 335c4e3 commit b1ea60a

File tree

301 files changed

+16705
-3057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+16705
-3057
lines changed

.github/workflows/scala.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y perl minisat curl gnupg2 locales clang-11 wget
3232
- name: Install wasmfx-tools
3333
run: |
34-
#cd third-party/wasmfx-tools
35-
#cargo build --release
34+
cd third-party/wasmfx-tools
35+
cargo build --release
3636
- name: Run tests
3737
run: |
3838
sbt 'test'

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "third-party/wasmfx-tools"]
2+
path = third-party/wasmfx-tools
3+
url = https://github.com/wasmfx/wasmfx-tools.git

benchmarks/wasm/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.wasm
2+
!2o1u.wat
3+
!2o1u-no-label.wat

benchmarks/wasm/ack.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#[no_mangle]
2+
#[inline(never)]
3+
fn ack(m: i32, n: i32) -> i32 {
4+
if m == 0 {
5+
n + 1
6+
} else if n == 0 {
7+
ack(m - 1, 1)
8+
} else {
9+
ack(m - 1, ack(m, n - 1))
10+
}
11+
}
12+
13+
#[no_mangle]
14+
fn real_main() -> i32 {
15+
ack(2, 2)
16+
}

benchmarks/wasm/ack.wat

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
(module $ack.wat.temp
2+
(type (;0;) (func (param i32 i32) (result i32)))
3+
(type (;1;) (func (result i32)))
4+
(func $ack (type 0) (param i32 i32) (result i32)
5+
local.get 0
6+
local.set 0
7+
local.get 1
8+
local.set 1
9+
block ;; label = @1
10+
loop ;; label = @2
11+
local.get 1
12+
local.set 1
13+
local.get 0
14+
local.tee 0
15+
i32.eqz
16+
br_if 1 (;@1;)
17+
block ;; label = @3
18+
block ;; label = @4
19+
local.get 1
20+
br_if 0 (;@4;)
21+
i32.const 1
22+
local.set 1
23+
br 1 (;@3;)
24+
end
25+
local.get 0
26+
local.get 1
27+
i32.const -1
28+
i32.add
29+
call $ack
30+
local.set 1
31+
end
32+
local.get 0
33+
i32.const -1
34+
i32.add
35+
local.set 0
36+
local.get 1
37+
local.set 1
38+
br 0 (;@2;)
39+
end
40+
end
41+
local.get 1
42+
i32.const 1
43+
i32.add)
44+
(func $real_main (type 1) (result i32)
45+
i32.const 2
46+
i32.const 2
47+
call $ack)
48+
(table (;0;) 1 1 funcref)
49+
(memory (;0;) 16)
50+
(global $__stack_pointer (mut i32) (i32.const 1048576))
51+
(global (;1;) i32 (i32.const 1048576))
52+
(global (;2;) i32 (i32.const 1048576))
53+
(export "memory" (memory 0))
54+
(export "ack" (func 0))
55+
(export "real_main" (func 1))
56+
(export "__data_end" (global 1))
57+
(export "__heap_base" (global 2)))

benchmarks/wasm/block.wat

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
(module
2+
(func $test_block (param i32 i32 i32) (result i32)
3+
local.get 0
4+
local.get 1
5+
local.get 2
6+
block (param i32 i32 i32) (result i32 i32)
7+
i32.add
8+
end
9+
i32.add
10+
)
11+
(func $real_main (result i32)
12+
i32.const 1
13+
i32.const 3
14+
i32.const 5
15+
call $test_block
16+
)
17+
;; Sum from [0, 10]
18+
(func $test_loop_input (result i32)
19+
(local i32)
20+
i32.const 10
21+
local.set 0
22+
i32.const 0
23+
loop (param i32) (result i32)
24+
local.get 0
25+
i32.add
26+
local.get 0
27+
i32.const 1
28+
i32.sub
29+
local.set 0
30+
i32.const 0
31+
local.get 0
32+
i32.ne
33+
br_if 0
34+
end
35+
)
36+
(func $test_if_input (result i32)
37+
i32.const 10
38+
i32.const 5
39+
i32.const 1
40+
if (param i32 i32) (result i32 i32)
41+
i32.const 10
42+
i32.add
43+
else
44+
end
45+
i32.add
46+
)
47+
(func $test_poly_br (result i32)
48+
i32.const -30
49+
i32.const 0 ;; unused
50+
i32.const 0 ;; unused
51+
i32.const 0 ;; unused
52+
block (param i32 i32 i32) (result i32 i32)
53+
i32.const 0 ;; truncated
54+
i32.const 10000 ;; truncated
55+
i32.const 10
56+
i32.const 20
57+
br 0
58+
i32.add
59+
end
60+
i32.add
61+
i32.add ;; add value -30 and 30
62+
;; i32.add
63+
;; We can't use i32.add instruction here, because the overflowed value has been truncted
64+
;; when block exited.
65+
)
66+
(export "real_main" (func 1))
67+
(export "test_loop_input" (func 2))
68+
(export "test_if_input" (func 3))
69+
(export "test_poly_br" (func 4))
70+
)

benchmarks/wasm/bst.c

Whitespace-only changes.

0 commit comments

Comments
 (0)