Enum o1vm::interpreters::riscv32im::interpreter::MInstruction
source · pub enum MInstruction {
Mul,
Mulh,
Mulhsu,
Mulhu,
Div,
Divu,
Rem,
Remu,
}
Expand description
M extension instructions Following https://msyksphinz-self.github.io/riscv-isadoc/html/rvm.html
Variants§
Mul
Format: mul rd, rs1, rs2
Description: performs an 32-bit 32-bit multiplication of signed rs1
by signed rs2 and places the lower 32 bits in the destination register.
Implementation: x[rd] = x[rs1] * x[rs2]
Mulh
Format: mulh rd, rs1, rs2
Description: performs an 32-bit 32-bit multiplication of signed rs1 by
signed rs2 and places the upper 32 bits in the destination register.
Implementation: x[rd] = (x[rs1] * x[rs2]) >> 32
Mulhsu
Format: mulhsu rd, rs1, rs2
Description: performs an 32-bit 32-bit multiplication of signed rs1 by
unsigned rs2 and places the upper 32 bits in the destination register.
Implementation: x[rd] = (x[rs1] * x[rs2]) >> 32
Mulhu
Format: mulhu rd, rs1, rs2
Description: performs an 32-bit 32-bit multiplication of unsigned rs1 by
unsigned rs2 and places the upper 32 bits in the destination register.
Implementation: x[rd] = (x[rs1] * x[rs2]) >> 32
Div
Format: div rd, rs1, rs2
Description: perform an 32 bits by 32 bits signed integer division of
rs1 by rs2, rounding towards zero
Implementation: x[rd] = x[rs1] /s x[rs2]
Divu
Format: divu rd, rs1, rs2
Description: performs an 32 bits by 32 bits unsigned integer division of
rs1 by rs2, rounding towards zero.
Implementation: x[rd] = x[rs1] /u x[rs2]
Rem
Format: rem rd, rs1, rs2
Description: performs an 32 bits by 32 bits signed integer reminder of
rs1 by rs2.
Implementation: x[rd] = x[rs1] %s x[rs2]
Remu
Format: remu rd, rs1, rs2
Description: performs an 32 bits by 32 bits unsigned integer reminder of
rs1 by rs2.
Implementation: x[rd] = x[rs1] %u x[rs2]
Trait Implementations§
source§impl Clone for MInstruction
impl Clone for MInstruction
source§fn clone(&self) -> MInstruction
fn clone(&self) -> MInstruction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MInstruction
impl Debug for MInstruction
source§impl Default for MInstruction
impl Default for MInstruction
source§fn default() -> MInstruction
fn default() -> MInstruction
source§impl Display for MInstruction
impl Display for MInstruction
source§impl Hash for MInstruction
impl Hash for MInstruction
source§impl IntoEnumIterator for MInstruction
impl IntoEnumIterator for MInstruction
type Iterator = MInstructionIter
fn iter() -> MInstructionIter ⓘ
source§impl Ord for MInstruction
impl Ord for MInstruction
source§fn cmp(&self, other: &MInstruction) -> Ordering
fn cmp(&self, other: &MInstruction) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<MInstruction> for MInstruction
impl PartialEq<MInstruction> for MInstruction
source§fn eq(&self, other: &MInstruction) -> bool
fn eq(&self, other: &MInstruction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<MInstruction> for MInstruction
impl PartialOrd<MInstruction> for MInstruction
source§fn partial_cmp(&self, other: &MInstruction) -> Option<Ordering>
fn partial_cmp(&self, other: &MInstruction) -> 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