diff options
Diffstat (limited to 'usr.bin/oasm/include')
-rw-r--r-- | usr.bin/oasm/include/oasm/emit.h | 4 | ||||
-rw-r--r-- | usr.bin/oasm/include/oasm/lex.h | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/usr.bin/oasm/include/oasm/emit.h b/usr.bin/oasm/include/oasm/emit.h index dab63d0..0236967 100644 --- a/usr.bin/oasm/include/oasm/emit.h +++ b/usr.bin/oasm/include/oasm/emit.h @@ -62,6 +62,10 @@ #define OSMX64_MOV_IMM 0x13 /* Data move operation from IMM */ #define OSMX64_HLT 0x14 /* Halt the processor */ #define OSMX64_BR 0x15 /* Branch */ +#define OSMX64_MROB 0x16 /* Mask register over byte */ +#define OSMX64_MROW 0x17 /* Mask register over word */ +#define OSMX64_MROD 0x18 /* Mask register over dword */ +#define OSMX64_MROQ 0x19 /* Mask register over qword */ /* * OSMX64 register definitions diff --git a/usr.bin/oasm/include/oasm/lex.h b/usr.bin/oasm/include/oasm/lex.h index 69e50a1..fa82398 100644 --- a/usr.bin/oasm/include/oasm/lex.h +++ b/usr.bin/oasm/include/oasm/lex.h @@ -97,6 +97,10 @@ typedef enum { TT_DIV, /* 'div' */ TT_HLT, /* 'hlt' */ TT_BR, /* 'br' */ + TT_MROB, /* 'mrob' */ + TT_MROW, /* 'mrow' */ + TT_MROD, /* 'mrod' */ + TT_MROQ, /* 'mroq' */ /* Register ops */ TT_MOV, /* 'mov' */ @@ -156,4 +160,22 @@ tok_is_xreg(tt_t tok) return false; } +/* + * Check if a token is of an MRO type + * instruction. Returns true on match. + */ +__always_inline static inline bool +lex_is_mro(tt_t tok) +{ + switch (tok) { + case TT_MROB: + case TT_MROW: + case TT_MROD: + case TT_MROQ: + return true; + } + + return false; +} + #endif /* !_OASM_LEX_H_ */ |