Reg

Enum Reg 

Source
pub enum Reg<Type> {
Show 32 variants Zero = 0, Ra = 1, Sp = 2, Gp = 3, Tp = 4, T0 = 5, T1 = 6, T2 = 7, S0 = 8, S1 = 9, A0 = 10, A1 = 11, A2 = 12, A3 = 13, A4 = 14, A5 = 15, A6 = 16, A7 = 17, S2 = 18, S3 = 19, S4 = 20, S5 = 21, S6 = 22, S7 = 23, S8 = 24, S9 = 25, S10 = 26, S11 = 27, T3 = 28, T4 = 29, T5 = 30, T6 = 31, // some variants omitted
}
Expand description

RISC-V register for RV32I/RV64I.

Use Type = u32 for RV32I and Type = u64 for RV64I.

Variants§

§

Zero = 0

Always zero: x0

§

Ra = 1

Return address: x1

§

Sp = 2

Stack pointer: x2

§

Gp = 3

Global pointer: x3

§

Tp = 4

Thread pointer: x4

§

T0 = 5

Temporary/alternate return address: x5

§

T1 = 6

Temporary: x6

§

T2 = 7

Temporary: x7

§

S0 = 8

Saved register/frame pointer: x8

§

S1 = 9

Saved register: x9

§

A0 = 10

Function argument/return value: x10

§

A1 = 11

Function argument/return value: x11

§

A2 = 12

Function argument: x12

§

A3 = 13

Function argument: x13

§

A4 = 14

Function argument: x14

§

A5 = 15

Function argument: x15

§

A6 = 16

Function argument: x16

§

A7 = 17

Function argument: x17

§

S2 = 18

Saved register: x18

§

S3 = 19

Saved register: x19

§

S4 = 20

Saved register: x20

§

S5 = 21

Saved register: x21

§

S6 = 22

Saved register: x22

§

S7 = 23

Saved register: x23

§

S8 = 24

Saved register: x24

§

S9 = 25

Saved register: x25

§

S10 = 26

Saved register: x26

§

S11 = 27

Saved register: x27

§

T3 = 28

Temporary: x28

§

T4 = 29

Temporary: x29

§

T5 = 30

Temporary: x30

§

T6 = 31

Temporary: x31

Trait Implementations§

Source§

impl<Type: Clone> Clone for Reg<Type>

Source§

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

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<Type> Debug for Reg<Type>

Source§

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

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

impl<Type> Display for Reg<Type>

Source§

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

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

impl<Type> From<EReg<u64>> for Reg<Type>

Source§

fn from(reg: EReg<u64>) -> Self

Converts to this type from the input type.
Source§

impl<Type> PartialEq for Reg<Type>

Source§

fn eq(&self, other: &Self) -> 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 Register for Reg<u32>

Source§

const N: usize = 32usize

The number of general purpose registers. Read more
Source§

type Type = u32

Register type. Read more
Source§

fn from_bits(bits: u8) -> Option<Self>

Create a register from its bit representation
Source§

impl Register for Reg<u64>

Source§

const N: usize = 32usize

The number of general purpose registers. Read more
Source§

type Type = u64

Register type. Read more
Source§

fn from_bits(bits: u8) -> Option<Self>

Create a register from its bit representation
Source§

impl<Type: Copy> Copy for Reg<Type>

Source§

impl<Type> Eq for Reg<Type>

Auto Trait Implementations§

§

impl<Type> Freeze for Reg<Type>

§

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

§

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

§

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

§

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

§

impl<Type> UnwindSafe for Reg<Type>
where Type: 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, 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.