Skip to main content

RegOp

Enum RegOp 

Source
pub enum RegOp {
Show 43 variants LocalGet { dst: Reg, local: LocalIdx, }, LocalSet { local: LocalIdx, value: Reg, }, LocalTee { local: LocalIdx, value: Reg, }, Drop { value: Reg, }, I32Const { dst: Reg, value: i32, }, I64Const { dst: Reg, value: i64, }, F32Const { dst: Reg, value: f32, }, F64Const { dst: Reg, value: f64, }, Unary { op: UnaryOp, dst: Reg, value: Reg, }, Binary { op: BinaryOp, dst: Reg, lhs: Reg, rhs: Reg, }, Copy { dst: Reg, src: Reg, }, Call { func: FuncIdx, args: Vec<Reg>, results: Vec<Reg>, }, Select { dst: Reg, v1: Reg, v2: Reg, cond: Reg, }, Load { op: LoadOp, dst: Reg, addr: Reg, memarg: MemArg, }, V128Const { dst: Reg, value: [u8; 16], }, V128Splat { dst: Reg, shape: LaneShape, src: Reg, }, V128ExtractLane { dst: Reg, shape: LaneShape, src: Reg, lane: u8, }, V128ReplaceLane { dst: Reg, shape: LaneShape, vec: Reg, scalar: Reg, lane: u8, }, V128Binary { shape: LaneShape, kind: V128BinaryKind, dst: Reg, lhs: Reg, rhs: Reg, }, V128Not { dst: Reg, src: Reg, }, Store { op: StoreOp, addr: Reg, value: Reg, memarg: MemArg, }, GlobalGet { dst: Reg, global: GlobalIdx, }, GlobalSet { global: GlobalIdx, value: Reg, }, MemorySize { dst: Reg, memory: MemIdx, }, MemoryGrow { dst: Reg, memory: MemIdx, delta: Reg, }, MemoryInit { memory: MemIdx, data: DataIdx, dst: Reg, src: Reg, count: Reg, }, DataDrop { data: DataIdx, }, MemoryCopy { dst_memory: MemIdx, src_memory: MemIdx, dst: Reg, src: Reg, count: Reg, }, MemoryFill { memory: MemIdx, dst: Reg, value: Reg, count: Reg, }, CallIndirect { type_idx: TypeIdx, table: TableIdx, index: Reg, args: Vec<Reg>, results: Vec<Reg>, }, CallRef { type_idx: TypeIdx, func: Reg, args: Vec<Reg>, results: Vec<Reg>, }, TableGet { dst: Reg, table: TableIdx, index: Reg, }, TableSet { table: TableIdx, index: Reg, value: Reg, }, TableSize { dst: Reg, table: TableIdx, }, TableGrow { dst: Reg, table: TableIdx, value: Reg, delta: Reg, }, TableFill { table: TableIdx, dst: Reg, value: Reg, count: Reg, }, TableCopy { dst_table: TableIdx, src_table: TableIdx, dst: Reg, src: Reg, count: Reg, }, TableInit { table: TableIdx, elem: ElemIdx, dst: Reg, src: Reg, count: Reg, }, ElemDrop { elem: ElemIdx, }, RefNull { dst: Reg, ref_type: RefType, }, RefFunc { dst: Reg, func: FuncIdx, }, RefIsNull { dst: Reg, value: Reg, }, RefAsNonNull { dst: Reg, value: Reg, },
}
Expand description

Register-oriented operations.

Variants§

§

LocalGet

Fields

§dst: Reg
§local: LocalIdx
§

LocalSet

Fields

§local: LocalIdx
§value: Reg
§

LocalTee

Fields

§local: LocalIdx
§value: Reg
§

Drop

Fields

§value: Reg
§

I32Const

Fields

§dst: Reg
§value: i32
§

I64Const

Fields

§dst: Reg
§value: i64
§

F32Const

Fields

§dst: Reg
§value: f32
§

F64Const

Fields

§dst: Reg
§value: f64
§

Unary

Fields

§dst: Reg
§value: Reg
§

Binary

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

Copy

Copy a register — used to deliver branch-carried values into the registers a continuation block expects (phi lowering via copies in predecessor blocks).

Fields

§dst: Reg
§src: Reg
§

Call

Direct call (call): invoke func with args, writing each result register.

Fields

§func: FuncIdx
§args: Vec<Reg>
§results: Vec<Reg>
§

Select

Conditional selection (select): dst = cond != 0 ? v1 : v2.

Fields

§dst: Reg
§v1: Reg
§v2: Reg
§cond: Reg
§

Load

Linear-memory load: dst = mem[effective(addr)..+width] per op.

Fields

§dst: Reg
§addr: Reg
§memarg: MemArg
§

V128Const

v128 constant.

Fields

§dst: Reg
§value: [u8; 16]
§

V128Splat

Broadcast a scalar into every lane.

Fields

§dst: Reg
§src: Reg
§

V128ExtractLane

Extract one lane as a scalar.

Fields

§dst: Reg
§src: Reg
§lane: u8
§

V128ReplaceLane

Replace one lane of a vector with a scalar.

Fields

§dst: Reg
§vec: Reg
§scalar: Reg
§lane: u8
§

V128Binary

Lane-wise binary operation (add/sub/mul/div and bitwise and/or/xor).

Fields

§dst: Reg
§lhs: Reg
§rhs: Reg
§

V128Not

Bitwise not over all 128 bits.

Fields

§dst: Reg
§src: Reg
§

Store

Linear-memory store: mem[effective(addr)..+width] = value per op.

Fields

§addr: Reg
§value: Reg
§memarg: MemArg
§

GlobalGet

Read a global.

Fields

§dst: Reg
§global: GlobalIdx
§

GlobalSet

Write a global.

Fields

§global: GlobalIdx
§value: Reg
§

MemorySize

Current memory size in pages (memory.size).

Fields

§dst: Reg
§memory: MemIdx
§

MemoryGrow

Grow memory by delta pages (memory.grow): dst = previous size, or -1 on failure.

Fields

§dst: Reg
§memory: MemIdx
§delta: Reg
§

MemoryInit

memory.init: mem[dst..] = data_segment[src..] over count bytes.

Fields

§memory: MemIdx
§data: DataIdx
§dst: Reg
§src: Reg
§count: Reg
§

DataDrop

data.drop: drop the data segment’s runtime storage.

Fields

§data: DataIdx
§

MemoryCopy

memory.copy: dst_mem[dst..] = src_mem[src..] over count bytes.

Fields

§dst_memory: MemIdx
§src_memory: MemIdx
§dst: Reg
§src: Reg
§count: Reg
§

MemoryFill

memory.fill: mem[dst..dst+count] = value (low byte).

Fields

§memory: MemIdx
§dst: Reg
§value: Reg
§count: Reg
§

CallIndirect

Indirect call through a table (call_indirect).

Fields

§type_idx: TypeIdx
§table: TableIdx
§index: Reg
§args: Vec<Reg>
§results: Vec<Reg>
§

CallRef

Direct call through a function reference (call_ref).

Fields

§type_idx: TypeIdx
§func: Reg
§args: Vec<Reg>
§results: Vec<Reg>
§

TableGet

table.get: dst = table[index].

Fields

§dst: Reg
§table: TableIdx
§index: Reg
§

TableSet

table.set: table[index] = value.

Fields

§table: TableIdx
§index: Reg
§value: Reg
§

TableSize

table.size.

Fields

§dst: Reg
§table: TableIdx
§

TableGrow

table.grow: grow by delta, filling with value; dst = previous size or -1 on failure.

Fields

§dst: Reg
§table: TableIdx
§value: Reg
§delta: Reg
§

TableFill

table.fill: table[dst..dst+count] = value.

Fields

§table: TableIdx
§dst: Reg
§value: Reg
§count: Reg
§

TableCopy

table.copy: dst_table[dst..] = src_table[src..] over count.

Fields

§dst_table: TableIdx
§src_table: TableIdx
§dst: Reg
§src: Reg
§count: Reg
§

TableInit

table.init: table[dst..] = elem[src..] over count.

Fields

§table: TableIdx
§elem: ElemIdx
§dst: Reg
§src: Reg
§count: Reg
§

ElemDrop

elem.drop: drop the element segment’s runtime storage.

Fields

§elem: ElemIdx
§

RefNull

ref.null: produce a null reference of the given reference type.

Fields

§dst: Reg
§ref_type: RefType
§

RefFunc

ref.func: produce a function reference.

Fields

§dst: Reg
§func: FuncIdx
§

RefIsNull

ref.is_null: dst = 1 when the reference is null, else 0.

Fields

§dst: Reg
§value: Reg
§

RefAsNonNull

ref.as_non_null: trap on null, otherwise copy the reference.

Fields

§dst: Reg
§value: Reg

Trait Implementations§

Source§

impl Clone for RegOp

Source§

fn clone(&self) -> RegOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RegOp

Source§

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

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

impl PartialEq for RegOp

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RegOp

Auto Trait Implementations§

§

impl Freeze for RegOp

§

impl RefUnwindSafe for RegOp

§

impl Send for RegOp

§

impl Sync for RegOp

§

impl Unpin for RegOp

§

impl UnsafeUnpin for RegOp

§

impl UnwindSafe for RegOp

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.