diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-09-21 17:47:22 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-09-21 17:47:22 +0200 |
commit | 155e9b30b135a99b42e0f42e9062c266f527df4b (patch) | |
tree | 1189f07c4e7eef8e97dff1cd94e0dd46df5a70db /tools/wasm.h | |
parent | c75dcab5988f5c0b5e0629015f384e5aa1440690 (diff) | |
download | AGH-engineering-thesis-155e9b30b135a99b42e0f42e9062c266f527df4b.tar.gz AGH-engineering-thesis-155e9b30b135a99b42e0f42e9062c266f527df4b.zip |
use function pointer array in Wasm opcode translation
Diffstat (limited to 'tools/wasm.h')
-rw-r--r-- | tools/wasm.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/wasm.h b/tools/wasm.h index fc6a910..07252fc 100644 --- a/tools/wasm.h +++ b/tools/wasm.h @@ -20,3 +20,26 @@ #define EXPORT_TABLEIDX 0x01 #define EXPORT_MEMIDX 0x02 #define EXPORT_GLOBALIDX 0x03 + +/* WebAssembly opcodes */ +#define WASM_END 0x0B +#define WASM_CALL 0x10 + +#define WASM_LOCAL_GET 0x20 + +#define WASM_I32_LOAD 0x28 +#define WASM_I32_LOAD8_S 0x2C +#define WASM_I32_LOAD8_U 0x2D +#define WASM_I32_LOAD16_S 0x2E +#define WASM_I32_LOAD16_U 0x2F +#define WASM_I32_STORE 0x36 +#define WASM_I32_STORE8 0x3A +#define WASM_I32_STORE16 0x3B +#define WASM_I64_STORE32 0x3E + +#define WASM_I32_CONST 0x41 + +#define WASM_I32_ADD 0x6A +#define WASM_I32_SUB 0x6B +#define WASM_I32_MUL 0x6C +#define WASM_I32_DIV_U 0x6E |