From af7a0cf9b65d6fee20029fe67c95c494f4b402a7 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 24 Jul 2025 03:41:39 -0400 Subject: oasm: Add encoding for MRO type instructions This commit introduces encoding logic for 4 additional instructions: - MROB (Mask Register Over [byte]) - MROW (Mask Register Over [word]) - MROD (Mask Register Over [dword]) - MROQ (Mask Register Over [qword]) This instruction is used to fill a register with a specific length of zeros or ones. For example, to fill a register (e.g., x2) with 16-bits of 1s: -- !! !! Clear bits x2[7:0]... Mrrp,, !! mrow!! !! mrow x2, #1 -- Similarly, an operand of zero sets it to zero. For example, to clear an entire 64-bit register with zeros. Something like this can be done: -- mroq x1, #0 -- Signed-off-by: Ian Moffett --- usr.bin/oasm/parse.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'usr.bin/oasm/parse.c') diff --git a/usr.bin/oasm/parse.c b/usr.bin/oasm/parse.c index 4651b55..ff3c9d2 100644 --- a/usr.bin/oasm/parse.c +++ b/usr.bin/oasm/parse.c @@ -51,6 +51,12 @@ static const char *tokstr[] = { [ TT_IMM ] = "", [ TT_LABEL] = "