diff options
| author | taitep <taitep@taitep.se> | 2025-12-26 18:14:32 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-26 18:14:32 +0100 |
| commit | 34034dd5db07f71b0854de0f2bbb18e39aa3db69 (patch) | |
| tree | ea588631e7d88874e784c5d144505d1ba987e2cf /src/decode.rs | |
| parent | 75e843f5f9220e1de4dde34d70e5077e092b5016 (diff) | |
Make macros for R/I-type operations and use them to implement basically every single one i think
Diffstat (limited to 'src/decode.rs')
| -rw-r--r-- | src/decode.rs | 9 |
1 files changed, 2 insertions, 7 deletions
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 - } } |
