From d3e8af85a601cc5b831f02beff4ac415c21f1e8d Mon Sep 17 00:00:00 2001 From: taitep Date: Mon, 12 Jan 2026 17:25:02 +0100 Subject: Add the files and decode logic for RVA --- src/decode.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/decode.rs') diff --git a/src/decode.rs b/src/decode.rs index 7f58516..480fdff 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -51,7 +51,12 @@ impl Instruction { #[inline] pub fn funct7(self) -> u8 { - (self.0 >> 25 & 0x7f) as u8 + (self.0 >> 25) as u8 + } + + #[inline] + pub fn funct5(self) -> u8 { + (self.0 >> 27) as u8 } #[inline] @@ -95,7 +100,7 @@ impl Instruction { /// 32bit ones use funct7 in this way #[inline] pub fn funct6(self) -> u8 { - (self.0 >> 26 & 0x3f) as u8 + (self.0 >> 26) as u8 } /// Mostly/only used for the SYSTEM opcode -- cgit v1.2.3