From 34034dd5db07f71b0854de0f2bbb18e39aa3db69 Mon Sep 17 00:00:00 2001 From: taitep Date: Fri, 26 Dec 2025 18:14:32 +0100 Subject: Make macros for R/I-type operations and use them to implement basically every single one i think --- src/decode.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/decode.rs') diff --git a/src/decode.rs b/src/decode.rs index 21a1e64..4258a6f 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -85,15 +85,10 @@ impl Instruction { imm_20 | imm_10_1 | imm_11 | imm_19_12 } - // The following are AFAIK only used for shift by immediate operations - + /// Technically part of immediate. Only used to determine shift type for immediate shifts afaik + /// 32bit ones use funct7 in this way #[inline] pub fn funct6(self) -> u8 { (self.0 >> 26 & 0x3f) as u8 } - - #[inline] - pub fn imm_shamt(self) -> usize { - (self.0 >> 20 & 0x3f) as usize - } } -- cgit v1.2.3