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
LocalSet
LocalTee
Drop
I32Const
I64Const
F32Const
F64Const
Unary
Binary
Copy
Copy a register — used to deliver branch-carried values into the registers a continuation block expects (phi lowering via copies in predecessor blocks).
Call
Direct call (call): invoke func with args, writing each result
register.
Select
Conditional selection (select): dst = cond != 0 ? v1 : v2.
Load
Linear-memory load: dst = mem[effective(addr)..+width] per op.
V128Const
v128 constant.
V128Splat
Broadcast a scalar into every lane.
V128ExtractLane
Extract one lane as a scalar.
V128ReplaceLane
Replace one lane of a vector with a scalar.
V128Binary
Lane-wise binary operation (add/sub/mul/div and bitwise and/or/xor).
V128Not
Bitwise not over all 128 bits.
Store
Linear-memory store: mem[effective(addr)..+width] = value per op.
GlobalGet
Read a global.
GlobalSet
Write a global.
MemorySize
Current memory size in pages (memory.size).
MemoryGrow
Grow memory by delta pages (memory.grow): dst = previous size,
or -1 on failure.
MemoryInit
memory.init: mem[dst..] = data_segment[src..] over count bytes.
DataDrop
data.drop: drop the data segment’s runtime storage.
MemoryCopy
memory.copy: dst_mem[dst..] = src_mem[src..] over count bytes.
MemoryFill
memory.fill: mem[dst..dst+count] = value (low byte).
CallIndirect
Indirect call through a table (call_indirect).
CallRef
Direct call through a function reference (call_ref).
TableGet
table.get: dst = table[index].
TableSet
table.set: table[index] = value.
TableSize
table.size.
TableGrow
table.grow: grow by delta, filling with value; dst = previous
size or -1 on failure.
TableFill
table.fill: table[dst..dst+count] = value.
TableCopy
table.copy: dst_table[dst..] = src_table[src..] over count.
TableInit
table.init: table[dst..] = elem[src..] over count.
ElemDrop
elem.drop: drop the element segment’s runtime storage.
RefNull
ref.null: produce a null reference of the given reference type.
RefFunc
ref.func: produce a function reference.
RefIsNull
ref.is_null: dst = 1 when the reference is null, else 0.
RefAsNonNull
ref.as_non_null: trap on null, otherwise copy the reference.