Struct Instruction

Source
pub struct Instruction { /* private fields */ }
Expand description

Instruction is 64 bit | 8bit | 8bit | 8bit | 8bit | 32bit | | Opcode | | | | immediate | or | 8bit | 8bit | 8bit | 8bit | 8bit | 24bit | | Opcode | | | | ext | immediate | or | 8bit | 8bit | 8bit | 8bit | 8bit | 24bit | | Opcode | | | ext | ext | immediate | or | package_key|

Implementations§

Source§

impl Instruction

Source

pub fn new( op: Opcode, type0: Option<ValueType>, type1: Option<ValueType>, type2: Option<ValueType>, imm: Option<OpIndex>, ) -> Instruction

Source

pub fn from_u64(v: u64) -> Instruction

Source

pub fn set_imm(&mut self, imm: OpIndex)

Source

pub fn set_imm824(&mut self, imm0: OpIndex, imm1: OpIndex)

set_imm824 sets an 8bit imm and a 24bit imm at the lower 4 bytes

Source

pub fn set_t2_with_index(&mut self, index: i8)

set_t2_with_index tries to set an OpIndex to the space of t2 returns error if it’s out of range used by STORE_INDEX_IMM, STORE_STRUCT_FIELD

Source

pub fn get_u64(&self) -> u64

Source

pub fn op(&self) -> Opcode

Source

pub fn t0(&self) -> ValueType

Source

pub fn t1(&self) -> ValueType

Source

pub fn t2(&self) -> ValueType

Source

pub fn t2_as_index(&self) -> OpIndex

Source

pub fn imm(&self) -> OpIndex

Source

pub fn imm824(&self) -> (OpIndex, OpIndex)

Source

pub fn code2index(op: Opcode) -> OpIndex

Source

pub fn index2code(i: OpIndex) -> Opcode

Source

pub fn in_8bit_range(i: OpIndex) -> bool

Source

pub fn in_24bit_range(i: OpIndex) -> bool

Trait Implementations§

Source§

impl Clone for Instruction

Source§

fn clone(&self) -> Instruction

Returns a duplicate 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 Copy 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: 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Slottable for T
where T: Copy,