Skip to main content

RegType

Trait RegType 

Source
pub trait RegType
where Self: Default + Destruct + From<bool> + From<u8> + From<u16> + From<u32> + Eq + Ord + Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign + BitAnd<Output = Self> + BitAndAssign + BitOr<Output = Self> + BitOrAssign + BitXor<Output = Self> + BitXorAssign + Not<Output = Self> + Shl<u8, Output = Self> + Shl<u16, Output = Self> + Shl<u32, Output = Self> + Shl<i32, Output = Self> + Shr<u8, Output = Self> + Shr<u16, Output = Self> + Shr<u32, Output = Self> + Shr<i32, Output = Self> + Display + LowerHex + UpperHex + Debug + Copy + Send + Sync + Sized + 'static,
{ const BITS: u8; // Required methods fn as_u64(&self) -> u64; fn truncate_from_u64(value: u64) -> Self; fn as_i64(&self) -> i64; fn wrapping_add_signed(&self, offset: i32) -> Self; }
Expand description

Register type.

u32 for RV32 and u64 for RV64.

Required Associated Constants§

Source

const BITS: u8

The size of this type in bits

Required Methods§

Source

fn as_u64(&self) -> u64

Convert to u64

Source

fn truncate_from_u64(value: u64) -> Self

Convert from u64, truncating to this type’s width

Source

fn as_i64(&self) -> i64

Convert to i64 (sign-extended)

Source

fn wrapping_add_signed(&self, offset: i32) -> Self

Wrapping addition of a signed byte offset, as used for PC-relative control flow

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl RegType for u32

Source§

const BITS: u8

Source§

fn as_u64(&self) -> u64

Source§

fn truncate_from_u64(value: u64) -> Self

Source§

fn as_i64(&self) -> i64

Source§

fn wrapping_add_signed(&self, offset: i32) -> Self

Source§

impl RegType for u64

Source§

const BITS: u8

Source§

fn as_u64(&self) -> u64

Source§

fn truncate_from_u64(value: u64) -> Self

Source§

fn as_i64(&self) -> i64

Source§

fn wrapping_add_signed(&self, offset: i32) -> Self

Implementors§