From 605ac7f13be9f597d3cf7ab3786b71f5cda8c9fa Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Sat, 19 Sep 2020 21:22:41 +0200 Subject: initial work towards translating wasm to stack machine (with a provisional bench) --- tests/stack_machine_wasm_sub/Makefile | 1 + tests/stack_machine_wasm_sub/instructions.wat | 9 +++++++++ tests/stack_machine_wasm_sub/test.v | 1 + tests/stack_machine_wasm_sub/words_to_verify.mem | 3 +++ 4 files changed, 14 insertions(+) create mode 120000 tests/stack_machine_wasm_sub/Makefile create mode 100644 tests/stack_machine_wasm_sub/instructions.wat create mode 120000 tests/stack_machine_wasm_sub/test.v create mode 100644 tests/stack_machine_wasm_sub/words_to_verify.mem (limited to 'tests') diff --git a/tests/stack_machine_wasm_sub/Makefile b/tests/stack_machine_wasm_sub/Makefile new file mode 120000 index 0000000..4673ba3 --- /dev/null +++ b/tests/stack_machine_wasm_sub/Makefile @@ -0,0 +1 @@ +../stack_machine_function_call/Makefile \ No newline at end of file diff --git a/tests/stack_machine_wasm_sub/instructions.wat b/tests/stack_machine_wasm_sub/instructions.wat new file mode 100644 index 0000000..7579a46 --- /dev/null +++ b/tests/stack_machine_wasm_sub/instructions.wat @@ -0,0 +1,9 @@ +(module + (memory 0 2) + (func $sub (param $lhs i32) (param $rhs i32);; (result i32) + i32.const 0x17 + local.get $lhs + local.get $rhs + i32.sub + i32.store offset=0x25 align=2) + (export "main" (func $sub))) diff --git a/tests/stack_machine_wasm_sub/test.v b/tests/stack_machine_wasm_sub/test.v new file mode 120000 index 0000000..f5b6a59 --- /dev/null +++ b/tests/stack_machine_wasm_sub/test.v @@ -0,0 +1 @@ +../stack_machine_store/test.v \ No newline at end of file diff --git a/tests/stack_machine_wasm_sub/words_to_verify.mem b/tests/stack_machine_wasm_sub/words_to_verify.mem new file mode 100644 index 0000000..bd24e95 --- /dev/null +++ b/tests/stack_machine_wasm_sub/words_to_verify.mem @@ -0,0 +1,3 @@ +// address value + 0FFFFC 23 + 23C 1E // Address is 0x200 + 0x25 + 0x17 -- cgit v1.2.3