Enum polkavm_common::program::Instruction

source ·
pub enum Instruction {
Show 88 variants trap, fallthrough, call(Reg, u32), jump_indirect(Reg, u32), load_imm(Reg, u32), load_u8(Reg, u32), load_i8(Reg, u32), load_u16(Reg, u32), load_i16(Reg, u32), load_u32(Reg, u32), store_u8(Reg, u32), store_u16(Reg, u32), store_u32(Reg, u32), branch_eq_imm(Reg, u32, u32), branch_not_eq_imm(Reg, u32, u32), branch_less_unsigned_imm(Reg, u32, u32), branch_less_signed_imm(Reg, u32, u32), branch_greater_or_equal_unsigned_imm(Reg, u32, u32), branch_greater_or_equal_signed_imm(Reg, u32, u32), branch_less_or_equal_signed_imm(Reg, u32, u32), branch_less_or_equal_unsigned_imm(Reg, u32, u32), branch_greater_signed_imm(Reg, u32, u32), branch_greater_unsigned_imm(Reg, u32, u32), store_imm_indirect_u8(Reg, u32, u32), store_imm_indirect_u16(Reg, u32, u32), store_imm_indirect_u32(Reg, u32, u32), store_indirect_u8(Reg, Reg, u32), store_indirect_u16(Reg, Reg, u32), store_indirect_u32(Reg, Reg, u32), load_indirect_u8(Reg, Reg, u32), load_indirect_i8(Reg, Reg, u32), load_indirect_u16(Reg, Reg, u32), load_indirect_i16(Reg, Reg, u32), load_indirect_u32(Reg, Reg, u32), call_indirect(Reg, Reg, u32), add_imm(Reg, Reg, u32), and_imm(Reg, Reg, u32), xor_imm(Reg, Reg, u32), or_imm(Reg, Reg, u32), mul_imm(Reg, Reg, u32), mul_upper_signed_signed_imm(Reg, Reg, u32), mul_upper_unsigned_unsigned_imm(Reg, Reg, u32), set_less_than_unsigned_imm(Reg, Reg, u32), set_less_than_signed_imm(Reg, Reg, u32), shift_logical_left_imm(Reg, Reg, u32), shift_logical_right_imm(Reg, Reg, u32), shift_arithmetic_right_imm(Reg, Reg, u32), negate_and_add_imm(Reg, Reg, u32), set_greater_than_unsigned_imm(Reg, Reg, u32), set_greater_than_signed_imm(Reg, Reg, u32), shift_logical_right_imm_alt(Reg, Reg, u32), shift_arithmetic_right_imm_alt(Reg, Reg, u32), shift_logical_left_imm_alt(Reg, Reg, u32), branch_eq(Reg, Reg, u32), branch_not_eq(Reg, Reg, u32), branch_less_unsigned(Reg, Reg, u32), branch_less_signed(Reg, Reg, u32), branch_greater_or_equal_unsigned(Reg, Reg, u32), branch_greater_or_equal_signed(Reg, Reg, u32), cmov_if_zero_imm(Reg, Reg, u32), cmov_if_not_zero_imm(Reg, Reg, u32), add(Reg, Reg, Reg), sub(Reg, Reg, Reg), and(Reg, Reg, Reg), xor(Reg, Reg, Reg), or(Reg, Reg, Reg), mul(Reg, Reg, Reg), mul_upper_signed_signed(Reg, Reg, Reg), mul_upper_unsigned_unsigned(Reg, Reg, Reg), mul_upper_signed_unsigned(Reg, Reg, Reg), set_less_than_unsigned(Reg, Reg, Reg), set_less_than_signed(Reg, Reg, Reg), shift_logical_left(Reg, Reg, Reg), shift_logical_right(Reg, Reg, Reg), shift_arithmetic_right(Reg, Reg, Reg), div_unsigned(Reg, Reg, Reg), div_signed(Reg, Reg, Reg), rem_unsigned(Reg, Reg, Reg), rem_signed(Reg, Reg, Reg), cmov_if_zero(Reg, Reg, Reg), cmov_if_not_zero(Reg, Reg, Reg), jump(u32), ecalli(u32), store_imm_u8(u32, u32), store_imm_u16(u32, u32), store_imm_u32(u32, u32), move_reg(Reg, Reg), sbrk(Reg, Reg),
}

Variants§

§

trap

§

fallthrough

§

call(Reg, u32)

§

jump_indirect(Reg, u32)

§

load_imm(Reg, u32)

§

load_u8(Reg, u32)

§

load_i8(Reg, u32)

§

load_u16(Reg, u32)

§

load_i16(Reg, u32)

§

load_u32(Reg, u32)

§

store_u8(Reg, u32)

§

store_u16(Reg, u32)

§

store_u32(Reg, u32)

§

branch_eq_imm(Reg, u32, u32)

§

branch_not_eq_imm(Reg, u32, u32)

§

branch_less_unsigned_imm(Reg, u32, u32)

§

branch_less_signed_imm(Reg, u32, u32)

§

branch_greater_or_equal_unsigned_imm(Reg, u32, u32)

§

branch_greater_or_equal_signed_imm(Reg, u32, u32)

§

branch_less_or_equal_signed_imm(Reg, u32, u32)

§

branch_less_or_equal_unsigned_imm(Reg, u32, u32)

§

branch_greater_signed_imm(Reg, u32, u32)

§

branch_greater_unsigned_imm(Reg, u32, u32)

§

store_imm_indirect_u8(Reg, u32, u32)

§

store_imm_indirect_u16(Reg, u32, u32)

§

store_imm_indirect_u32(Reg, u32, u32)

§

store_indirect_u8(Reg, Reg, u32)

§

store_indirect_u16(Reg, Reg, u32)

§

store_indirect_u32(Reg, Reg, u32)

§

load_indirect_u8(Reg, Reg, u32)

§

load_indirect_i8(Reg, Reg, u32)

§

load_indirect_u16(Reg, Reg, u32)

§

load_indirect_i16(Reg, Reg, u32)

§

load_indirect_u32(Reg, Reg, u32)

§

call_indirect(Reg, Reg, u32)

§

add_imm(Reg, Reg, u32)

§

and_imm(Reg, Reg, u32)

§

xor_imm(Reg, Reg, u32)

§

or_imm(Reg, Reg, u32)

§

mul_imm(Reg, Reg, u32)

§

mul_upper_signed_signed_imm(Reg, Reg, u32)

§

mul_upper_unsigned_unsigned_imm(Reg, Reg, u32)

§

set_less_than_unsigned_imm(Reg, Reg, u32)

§

set_less_than_signed_imm(Reg, Reg, u32)

§

shift_logical_left_imm(Reg, Reg, u32)

§

shift_logical_right_imm(Reg, Reg, u32)

§

shift_arithmetic_right_imm(Reg, Reg, u32)

§

negate_and_add_imm(Reg, Reg, u32)

§

set_greater_than_unsigned_imm(Reg, Reg, u32)

§

set_greater_than_signed_imm(Reg, Reg, u32)

§

shift_logical_right_imm_alt(Reg, Reg, u32)

§

shift_arithmetic_right_imm_alt(Reg, Reg, u32)

§

shift_logical_left_imm_alt(Reg, Reg, u32)

§

branch_eq(Reg, Reg, u32)

§

branch_not_eq(Reg, Reg, u32)

§

branch_less_unsigned(Reg, Reg, u32)

§

branch_less_signed(Reg, Reg, u32)

§

branch_greater_or_equal_unsigned(Reg, Reg, u32)

§

branch_greater_or_equal_signed(Reg, Reg, u32)

§

cmov_if_zero_imm(Reg, Reg, u32)

§

cmov_if_not_zero_imm(Reg, Reg, u32)

§

add(Reg, Reg, Reg)

§

sub(Reg, Reg, Reg)

§

and(Reg, Reg, Reg)

§

xor(Reg, Reg, Reg)

§

or(Reg, Reg, Reg)

§

mul(Reg, Reg, Reg)

§

mul_upper_signed_signed(Reg, Reg, Reg)

§

mul_upper_unsigned_unsigned(Reg, Reg, Reg)

§

mul_upper_signed_unsigned(Reg, Reg, Reg)

§

set_less_than_unsigned(Reg, Reg, Reg)

§

set_less_than_signed(Reg, Reg, Reg)

§

shift_logical_left(Reg, Reg, Reg)

§

shift_logical_right(Reg, Reg, Reg)

§

shift_arithmetic_right(Reg, Reg, Reg)

§

div_unsigned(Reg, Reg, Reg)

§

div_signed(Reg, Reg, Reg)

§

rem_unsigned(Reg, Reg, Reg)

§

rem_signed(Reg, Reg, Reg)

§

cmov_if_zero(Reg, Reg, Reg)

§

cmov_if_not_zero(Reg, Reg, Reg)

§

jump(u32)

§

ecalli(u32)

§

store_imm_u8(u32, u32)

§

store_imm_u16(u32, u32)

§

store_imm_u32(u32, u32)

§

move_reg(Reg, Reg)

§

sbrk(Reg, Reg)

Implementations§

source§

impl Instruction

source

pub fn visit<T>(self, visitor: &mut T) -> T::ReturnTy

source

pub fn serialize_into(self, buffer: &mut [u8]) -> usize

source

pub fn opcode(self) -> Opcode

source§

impl Instruction

source

pub fn deserialize(input: &[u8]) -> Option<(usize, Self)>

Trait Implementations§

source§

impl Clone for Instruction

source§

fn clone(&self) -> Instruction

Returns a copy 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 Debug for Instruction

source§

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

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

impl Display for Instruction

source§

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

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

impl PartialEq for Instruction

source§

fn eq(&self, other: &Instruction) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Instruction

source§

impl Eq for Instruction

source§

impl StructuralPartialEq for Instruction

Auto Trait Implementations§

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: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

§

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§

default 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>,

§

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>,

§

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.