Make macros for R/I-type operations and use them to implement basically every single one i think
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user