diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-30 16:34:48 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-30 16:34:48 -0400 |
commit | caa652ae2b3da86de945fa8d5ece55ddbbb2cf31 (patch) | |
tree | d0154134b1130f7d43037b319b107cf76e6b2bc3 /usr.bin/oasm/include | |
parent | 2d1097e8a1ecffd09cd6810978b876f8c8cdb16f (diff) |
oasm: Introduce logical shift operations
This commit introduces LSR/LSL which are used as bitwise shift
operations.
--
lsr x1, #1 !! x1 >>= 1
lsl x1, #1 !! x1 <<= 1
--
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oasm/include')
-rw-r--r-- | usr.bin/oasm/include/oasm/emit.h | 2 | ||||
-rw-r--r-- | usr.bin/oasm/include/oasm/lex.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/oasm/include/oasm/emit.h b/usr.bin/oasm/include/oasm/emit.h index 3fc2674..57683a8 100644 --- a/usr.bin/oasm/include/oasm/emit.h +++ b/usr.bin/oasm/include/oasm/emit.h @@ -66,6 +66,8 @@ #define OSMX64_MROW 0x11 /* Mask register over word */ #define OSMX64_MROD 0x12 /* Mask register over dword */ #define OSMX64_MROQ 0x13 /* Mask register over qword */ +#define OSMX64_LSR 0x14 /* Logical shift right */ +#define OSMX64_LSL 0x15 /* Logical shift left */ /* * OSMX64 register definitions diff --git a/usr.bin/oasm/include/oasm/lex.h b/usr.bin/oasm/include/oasm/lex.h index 4c81bc4..93422a6 100644 --- a/usr.bin/oasm/include/oasm/lex.h +++ b/usr.bin/oasm/include/oasm/lex.h @@ -106,6 +106,8 @@ typedef enum { TT_AND, /* 'and' */ TT_OR, /* 'or' */ TT_XOR, /* 'xor' */ + TT_LSR, /* 'lsr' */ + TT_LSL, /* 'lsl' */ /* Register ops */ TT_MOV, /* 'mov' */ |