pub enum Opcode {
Show 24 variants
Add(Type),
Sub(Type),
Opaque(Type),
Ret,
Trap,
Icmp(CmpTy, Type),
Jump,
Jumpif,
ReadReg(Type),
WriteReg(Type),
Load(Type),
Store(Type),
ZextI32(Type),
SextI32(Type),
ZextI16(Type),
SextI16(Type),
ZextI8(Type),
SextI8(Type),
TruncI64(Type),
TruncI32(Type),
TruncI16(Type),
Lshl(Type),
Lshr(Type),
Custom(u16),
}Expand description
Defines the opcodes for instructions
Variants§
Add(Type)
Add two i64 integers, wrapping around on overflow.
Sub(Type)
Subtract two i64 integers, wrapping around on overflow.
Opaque(Type)
Create an opaque value
Ret
Return from a function.
Trap
Unconditionally trap.
Icmp(CmpTy, Type)
Compare two integers.
Jump
Unconditional jump.
Jumpif
Conditional jump.
ReadReg(Type)
Read from a register.
WriteReg(Type)
Write to a register.
Load(Type)
Load from memory
Store(Type)
Store to memory
ZextI32(Type)
SextI32(Type)
ZextI16(Type)
SextI16(Type)
ZextI8(Type)
SextI8(Type)
TruncI64(Type)
TruncI32(Type)
TruncI16(Type)
Lshl(Type)
Lshr(Type)
Custom(u16)
Any custom operation that is architecture-specific and defined by the user.
Trait Implementations§
impl Copy for Opcode
impl Eq for Opcode
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more