From caa652ae2b3da86de945fa8d5ece55ddbbb2cf31 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 30 Jul 2025 16:34:48 -0400 Subject: 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 --- usr.bin/oasm/include/oasm/emit.h | 2 ++ usr.bin/oasm/include/oasm/lex.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'usr.bin/oasm/include') 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' */ -- cgit v1.2.3