Skip to main content

ZcmpUrlist

Struct ZcmpUrlist 

Source
pub struct ZcmpUrlist<Reg> { /* private fields */ }
Expand description

Zcmp register list selector.

Only valid values (4..=15, further restricted to 4..=6 for RVE) are representable; construct via ZcmpUrlist::try_from_raw.

Implementations§

Source§

impl<Reg> ZcmpUrlist<Reg>
where Reg: ZcmpRegister,

Source

pub const fn try_from_raw(raw: u8) -> Option<Self>
where Reg: ZcmpRegister,

Create a validated ZcmpUrlist from a raw u8 value.

Returns None if raw is reserved (0..=3), out of range (>15), or names a register list inaccessible under the current ISA variant (e.g., urlist > 6 under RVE, where only ra, s0, s1 exist).

Source

pub const fn as_u8(self) -> u8

Convert to the raw u8 discriminant (4..=15).

Source

pub fn reg_list(self) -> impl Iterator<Item = Reg>

Iterator over the absolute register numbers in this list.

Order matches the spec push/pop order: ra first, then s0 ascending. ra=x1, s0=x8, s1=x9, s2=x18..s9=x25, s10=x26, s11=x27.

Note: urlist=15 is {ra, s0-s11} (13 registers, including s10); {ra, s0-s10} has no encoding.

Source

pub const fn stack_adj_base(self) -> u32

Stack adjustment base in bytes.

The minimum stack frame size for this register list, rounded up to a 16-byte alignment. The full stack adjustment is: stack_adj_base + spimm * 16.

Values sourced from the Zcmp spec Table 3.

Trait Implementations§

Source§

impl<Reg: Clone> Clone for ZcmpUrlist<Reg>

Source§

fn clone(&self) -> ZcmpUrlist<Reg>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Reg: Debug> Debug for ZcmpUrlist<Reg>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Reg> Display for ZcmpUrlist<Reg>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Reg: PartialEq> PartialEq for ZcmpUrlist<Reg>

Source§

fn eq(&self, other: &ZcmpUrlist<Reg>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Reg: Copy> Copy for ZcmpUrlist<Reg>

Source§

impl<Reg: Eq> Eq for ZcmpUrlist<Reg>

Source§

impl<Reg> StructuralPartialEq for ZcmpUrlist<Reg>

Auto Trait Implementations§

§

impl<Reg> Freeze for ZcmpUrlist<Reg>

§

impl<Reg> RefUnwindSafe for ZcmpUrlist<Reg>
where Reg: RefUnwindSafe,

§

impl<Reg> Send for ZcmpUrlist<Reg>
where Reg: Send,

§

impl<Reg> Sync for ZcmpUrlist<Reg>
where Reg: Sync,

§

impl<Reg> Unpin for ZcmpUrlist<Reg>
where Reg: Unpin,

§

impl<Reg> UnsafeUnpin for ZcmpUrlist<Reg>

§

impl<Reg> UnwindSafe for ZcmpUrlist<Reg>
where Reg: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.