aboutsummaryrefslogtreecommitdiff
path: root/tools/stack_machine_instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/stack_machine_instruction.h')
-rw-r--r--tools/stack_machine_instruction.h48
1 files changed, 9 insertions, 39 deletions
diff --git a/tools/stack_machine_instruction.h b/tools/stack_machine_instruction.h
index 003fa19..1f47c40 100644
--- a/tools/stack_machine_instruction.h
+++ b/tools/stack_machine_instruction.h
@@ -2,45 +2,6 @@
#include "wasm_compile.h"
-/*
- * TODO: this enum is to be removed; it it only still here as a cheat sheet
- * for use when defining missing inline functions for those instructions
- */
-enum instruction_code {
- STORE,
- STORE_P,
- STOREB,
- STOREB_P,
- STOREW,
- STOREW_P,
- LOAD,
- LOAD_P,
- LOADBZX,
- LOADBZX_P,
- LOADBSX,
- LOADBSX_P,
- LOADWZX,
- LOADWZX_P,
- LOADWSX,
- LOADWSX_P,
- HALT,
- NOP,
- SWAP,
- SET_SP,
- JUMP,
- TEE,
- GET_FRAME,
- CONST,
- CALL,
- ADD,
- SUB,
- DIV,
- MUL,
- DROP,
- RET,
- COND_JUMP
-};
-
#define DATA_NONE 0
#define DATA_KNOWN 1
#define DATA_KNOWN_21_BITS 2
@@ -156,6 +117,15 @@ Y(sub, 0x3001) /* 0011_0000_0000_0001 */
Y(div, 0x3002) /* 0011_0000_0000_0010 */
Y(mul, 0x3003) /* 0011_0000_0000_0011 */
Y(drop, 0x3004) /* 0011_0000_0000_0100 */
+Y(eq, 0x3007) /* 0011_0000_0000_0111 */
+Y(lt, 0x3008) /* 0011_0000_0000_1000 */
+Y(ult, 0x3009) /* 0011_0000_0000_1001 */
+Y(le, 0x300A) /* 0011_0000_0000_1010 */
+Y(ule, 0x300B) /* 0011_0000_0000_1011 */
+Y(gt, 0x300C) /* 0011_0000_0000_1100 */
+Y(ugt, 0x300D) /* 0011_0000_0000_1101 */
+Y(ge, 0x300E) /* 0011_0000_0000_1110 */
+Y(uge, 0x300F) /* 0011_0000_0000_1111 */
Y(ret, 0x3080) /* 0011_0000_1000_0000 */
X(cond_jump, 0x7080) /* 0111_0000_1xxx_xxxx */
X(cond_jump_n, 0x7100) /* 0111_0001_0xxx_xxxx */