diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-09-19 21:22:41 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-09-19 21:22:41 +0200 |
commit | 605ac7f13be9f597d3cf7ab3786b71f5cda8c9fa (patch) | |
tree | b3c7a166f33d9d1ff35cbc1ede202dd89903e81e /tools/wasm.h | |
parent | 780f056e61323a41abcaf0dd53a44f99bcac197c (diff) | |
download | AGH-engineering-thesis-605ac7f13be9f597d3cf7ab3786b71f5cda8c9fa.tar.gz AGH-engineering-thesis-605ac7f13be9f597d3cf7ab3786b71f5cda8c9fa.zip |
initial work towards translating wasm to stack machine (with a provisional bench)
Diffstat (limited to 'tools/wasm.h')
-rw-r--r-- | tools/wasm.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/wasm.h b/tools/wasm.h new file mode 100644 index 0000000..fc6a910 --- /dev/null +++ b/tools/wasm.h @@ -0,0 +1,22 @@ +#define SECTION_CUSTOM 0 +#define SECTION_TYPE 1 +#define SECTION_IMPORT 2 +#define SECTION_FUNCTION 3 +#define SECTION_TABLE 4 +#define SECTION_MEMORY 5 +#define SECTION_GLOBAL 6 +#define SECTION_EXPORT 7 +#define SECTION_START 8 +#define SECTION_ELEMENT 9 +#define SECTION_CODE 10 +#define SECTION_DATA 11 + +#define VALTYPE_I32 0x7F +#define VALTYPE_I64 0x7E +#define VALTYPE_F32 0x7D +#define VALTYPE_F64 0x7C + +#define EXPORT_FUNCIDX 0x00 +#define EXPORT_TABLEIDX 0x01 +#define EXPORT_MEMIDX 0x02 +#define EXPORT_GLOBALIDX 0x03 |