Skip to main content

Rv32Instruction

Enum Rv32Instruction 

Source
pub enum Rv32Instruction<Hart>
where Hart: HartConfig,
{
Show 42 variants Add { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Sub { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Sll { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Slt { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Sltu { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Xor { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Srl { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Sra { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Or { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, And { rs1: Hart::Reg, rs2: Hart::Reg, rd: Hart::Reg, }, Addi { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Slti { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Sltiu { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Xori { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Ori { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Andi { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Slli { rs1: Hart::Reg, rd: Hart::Reg, shamt: Shamt<u32>, /* private fields */ }, Srli { rs1: Hart::Reg, rd: Hart::Reg, shamt: Shamt<u32>, /* private fields */ }, Srai { rs1: Hart::Reg, rd: Hart::Reg, shamt: Shamt<u32>, /* private fields */ }, Lb { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Lh { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Lw { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Lbu { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Lhu { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Jalr { rs1: Hart::Reg, rd: Hart::Reg, imm: i16, /* private fields */ }, Sb { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Sh { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Sw { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Beq { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Bne { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Blt { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Bge { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Bltu { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Bgeu { rs1: Hart::Reg, rs2: Hart::Reg, imm: i16, }, Lui { rd: Hart::Reg, imm: I24WithZeroedBits</* LITERAL */>, /* private fields */ }, Auipc { rd: Hart::Reg, imm: I24WithZeroedBits</* LITERAL */>, /* private fields */ }, Jal { rd: Hart::Reg, imm: I24, /* private fields */ }, Fence { pred: u8, succ: u8, /* private fields */ }, FenceTso { /* private fields */ }, Ecall { /* private fields */ }, Ebreak { /* private fields */ }, Unimp { /* private fields */ },
}
Expand description

RISC-V RV32 instruction

Variants§

§

Add

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Sub

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Sll

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Slt

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Sltu

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Xor

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Srl

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Sra

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Or

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

And

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§rd: Hart::Reg
§

Addi

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Slti

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Sltiu

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Xori

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Ori

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Andi

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Slli

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§shamt: Shamt<u32>
§

Srli

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§shamt: Shamt<u32>
§

Srai

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§shamt: Shamt<u32>
§

Lb

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Lh

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Lw

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Lbu

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Lhu

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Jalr

Fields

§rs1: Hart::Reg
§rd: Hart::Reg
§imm: i16
§

Sb

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Sh

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Sw

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Beq

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Bne

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Blt

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Bge

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Bltu

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Bgeu

Fields

§rs1: Hart::Reg
§rs2: Hart::Reg
§imm: i16
§

Lui

Fields

§rd: Hart::Reg
§imm: I24WithZeroedBits</* LITERAL */>
§

Auipc

Fields

§rd: Hart::Reg
§imm: I24WithZeroedBits</* LITERAL */>
§

Jal

Fields

§rd: Hart::Reg
§imm: I24
§

Fence

Fields

§pred: u8
§succ: u8
§

FenceTso

§

Ecall

§

Ebreak

§

Unimp

Trait Implementations§

Source§

impl<Hart> Clone for Rv32Instruction<Hart>
where Hart: HartConfig + Clone, Hart::Reg: Clone,

Source§

fn clone(&self) -> Rv32Instruction<Hart>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Hart> Copy for Rv32Instruction<Hart>
where Hart: HartConfig + Copy, Hart::Reg: Copy,

Source§

impl<Hart> Debug for Rv32Instruction<Hart>
where Hart: HartConfig + Debug, Hart::Reg: Debug,

Source§

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

Formats the value using the given formatter. Read more
§

impl<Reg, Hart> Display for Rv32Instruction<Hart>
where Reg: Display, Hart: HartConfig<Reg = Reg>,

§

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

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

impl<Hart> Eq for Rv32Instruction<Hart>
where Hart: HartConfig + Eq, Hart::Reg: Eq,

§

impl<Reg, Hart> Instruction for Rv32Instruction<Hart>
where Reg: Register<Type = u32>, Hart: HartConfig<Reg = Reg>,

§

const IMPLEMENTED_EXTENSIONS: &'static [ImplementedExtension]

All implemented extensions, including this instruction itself, with their ISA extensions. Read more
§

const OWN_ISA_EXTENSIONS: &'static [IsaExtension]

ISA extensions defined by this instruction enum itself, without inherited ones. Read more
§

const ALIGNMENT: u8

Instruction alignment in bytes, also known as IALIGN
§

type Hart = Hart

Hart configuration of the implementation
§

fn try_decode(instruction: u32) -> Option<Self>

Try to decode a single valid instruction
§

fn size(&self) -> u8

Instruction size in bytes
Source§

const ISA_STRING: &'static str = _

ISA string as used in the Tag_RISCV_arch attribute of ELF files, for example, rv64i2p1_m2p0_zmmul1p0. Read more
Source§

fn implements_extension<E>() -> bool
where E: Instruction<Hart = Self::Hart>,

Checks whether this instruction implements the given extension, see Self::IMPLEMENTED_EXTENSIONS for details
Source§

impl<Hart> PartialEq for Rv32Instruction<Hart>
where Hart: HartConfig + PartialEq, Hart::Reg: PartialEq,

Source§

fn eq(&self, other: &Rv32Instruction<Hart>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<Hart> StructuralPartialEq for Rv32Instruction<Hart>
where Hart: HartConfig + PartialEq, Hart::Reg: PartialEq,

Auto Trait Implementations§

§

impl<Hart> Freeze for Rv32Instruction<Hart>
where <Hart as HartConfig>::Reg: Freeze,

§

impl<Hart> RefUnwindSafe for Rv32Instruction<Hart>
where <Hart as HartConfig>::Reg: RefUnwindSafe,

§

impl<Hart> Send for Rv32Instruction<Hart>
where <Hart as HartConfig>::Reg: Send,

§

impl<Hart> Sync for Rv32Instruction<Hart>
where <Hart as HartConfig>::Reg: Sync,

§

impl<Hart> Unpin for Rv32Instruction<Hart>
where <Hart as HartConfig>::Reg: Unpin,

§

impl<Hart> UnsafeUnpin for Rv32Instruction<Hart>
where <Hart as HartConfig>::Reg: UnsafeUnpin,

§

impl<Hart> UnwindSafe for Rv32Instruction<Hart>
where <Hart as HartConfig>::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 = !

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.