pub struct Imm(/* private fields */);Expand description
An immediate in an instruction.
This represents the real value that will be put in the register,
so sign extension has been performed if necessary, and for instructions
like lui the value will have been shifted.
This type is XLEN-agnostic, use the XLEN-specific accessors to get the correct value.
Implementations§
Source§impl Imm
impl Imm
Sourcepub const ZERO: Self
pub const ZERO: Self
The immediate 0.
Useful as a shortcut for Imm::new_u32(0) and for patterns.
Sourcepub const fn new_i32(value: i32) -> Self
pub const fn new_i32(value: i32) -> Self
Create a new immediate from the (if necessary) sign-extended value.
Trait Implementations§
impl Copy for Imm
impl Eq for Imm
impl StructuralPartialEq for Imm
Auto Trait Implementations§
impl Freeze for Imm
impl RefUnwindSafe for Imm
impl Send for Imm
impl Sync for Imm
impl Unpin for Imm
impl UnsafeUnpin for Imm
impl UnwindSafe for Imm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more