summaryrefslogtreecommitdiff
path: root/src/decode.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2026-01-12 17:25:02 +0100
committertaitep <taitep@taitep.se>2026-01-12 17:25:02 +0100
commitd3e8af85a601cc5b831f02beff4ac415c21f1e8d (patch)
treeb1752f6fb4cf1817e7d045535482c51c53cf4dc7 /src/decode.rs
parent3451a8227cee4a087f3836f63bd95650e3571ce9 (diff)
Add the files and decode logic for RVA
Diffstat (limited to 'src/decode.rs')
-rw-r--r--src/decode.rs9
1 files changed, 7 insertions, 2 deletions
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