Enum o1vm::interpreters::riscv32im::interpreter::RInstruction
source · pub enum RInstruction {
Add,
Sub,
ShiftLeftLogical,
SetLessThan,
SetLessThanUnsigned,
Xor,
ShiftRightLogical,
ShiftRightArithmetic,
Or,
And,
Fence,
FenceI,
}
Variants§
Add
Format: add rd, rs1, rs2
Description: Adds the registers rs1 and rs2 and stores the result in rd. Arithmetic overflow is ignored and the result is simply the low 32 bits of the result.
Sub
Format: sub rd, rs1, rs2
Description: Subs the register rs2 from rs1 and stores the result in rd. Arithmetic overflow is ignored and the result is simply the low 32 bits of the result.
ShiftLeftLogical
Format: sll rd, rs1, rs2
Description: Performs logical left shift on the value in register rs1 by the shift amount held in the lower 5 bits of register rs2.
SetLessThan
Format: slt rd, rs1, rs2
Description: Place the value 1 in register rd if register rs1 is less than register rs2 when both are treated as signed numbers, else 0 is written to rd.
SetLessThanUnsigned
Format: sltu rd, rs1, rs2
Description: Place the value 1 in register rd if register rs1 is less than register rs2 when both are treated as unsigned numbers, else 0 is written to rd.
Xor
Format: xor rd, rs1, rs2
Description: Performs bitwise XOR on registers rs1 and rs2 and place the result in rd
ShiftRightLogical
Format: srl rd, rs1, rs2
Description: Logical right shift on the value in register rs1 by the shift amount held in the lower 5 bits of register rs2
ShiftRightArithmetic
Format: sra rd, rs1, rs2
Description: Performs arithmetic right shift on the value in register rs1 by the shift amount held in the lower 5 bits of register rs2
Or
Format: or rd, rs1, rs2
Description: Performs bitwise OR on registers rs1 and rs2 and place the result in rd
And
Format: and rd, rs1, rs2
Description: Performs bitwise AND on registers rs1 and rs2 and place the result in rd
Fence
Format: fence
Description: Used to order device I/O and memory accesses as viewed by other RISC-V harts and external devices or coprocessors. Any combination of device input (I), device output (O), memory reads (R), and memory writes (W) may be ordered with respect to any combination of the same. Informally, no other RISC-V hart or external device can observe any operation in the successor set following a FENCE before any operation in the predecessor set preceding the FENCE.
FenceI
Format: fence.i
Description: Provides explicit synchronization between writes to instruction memory and instruction fetches on the same hart.
Trait Implementations§
source§impl Clone for RInstruction
impl Clone for RInstruction
source§fn clone(&self) -> RInstruction
fn clone(&self) -> RInstruction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RInstruction
impl Debug for RInstruction
source§impl Default for RInstruction
impl Default for RInstruction
source§fn default() -> RInstruction
fn default() -> RInstruction
source§impl Display for RInstruction
impl Display for RInstruction
source§impl Hash for RInstruction
impl Hash for RInstruction
source§impl IntoEnumIterator for RInstruction
impl IntoEnumIterator for RInstruction
type Iterator = RInstructionIter
fn iter() -> RInstructionIter ⓘ
source§impl Ord for RInstruction
impl Ord for RInstruction
source§fn cmp(&self, other: &RInstruction) -> Ordering
fn cmp(&self, other: &RInstruction) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<RInstruction> for RInstruction
impl PartialEq<RInstruction> for RInstruction
source§fn eq(&self, other: &RInstruction) -> bool
fn eq(&self, other: &RInstruction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<RInstruction> for RInstruction
impl PartialOrd<RInstruction> for RInstruction
source§fn partial_cmp(&self, other: &RInstruction) -> Option<Ordering>
fn partial_cmp(&self, other: &RInstruction) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more