[−][src]Trait cranelift_codegen::ir::InstBuilder
Convenience methods for building instructions.
The InstBuilder
trait has one method per instruction opcode for
conveniently constructing the instruction with minimum arguments.
Polymorphic instructions infer their result types from the input
arguments when possible. In some cases, an explicit ctrl_typevar
argument is required.
The opcode methods return the new instruction's result values, or
the Inst
itself for instructions that don't have any results.
There is also a method per instruction format. These methods all
return an Inst
.
Provided methods
fn jump(self, EBB: Ebb, args: &[Value]) -> Inst
Jump.
Unconditionally jump to an extended basic block, passing the specified EBB arguments. The number and types of arguments must match the destination EBB.
fn fallthrough(self, EBB: Ebb, args: &[Value]) -> Inst
Fall through to the next EBB.
This is the same as jump
, except the destination EBB must be
the next one in the layout.
Jumps are turned into fall-through instructions by the branch relaxation pass. There is no reason to use this instruction outside that pass.
fn brz(self, c: Value, EBB: Ebb, args: &[Value]) -> Inst
Branch when zero.
If c
is a b1
value, take the branch when c
is false. If
c
is an integer value, take the branch when c = 0
.
fn brnz(self, c: Value, EBB: Ebb, args: &[Value]) -> Inst
Branch when non-zero.
If c
is a b1
value, take the branch when c
is true. If
c
is an integer value, take the branch when c != 0
.
fn br_icmp<T1intcc: Into<IntCC>>(
self,
Cond: T1intcc,
x: Value,
y: Value,
EBB: Ebb,
args: &[Value]
) -> Inst
self,
Cond: T1intcc,
x: Value,
y: Value,
EBB: Ebb,
args: &[Value]
) -> Inst
Compare scalar integers and branch.
Compare x
and y
in the same way as the icmp
instruction
and take the branch if the condition is true:
br_icmp ugt v1, v2, ebb4(v5, v6)
is semantically equivalent to:
v10 = icmp ugt, v1, v2
brnz v10, ebb4(v5, v6)
Some RISC architectures like MIPS and RISC-V provide instructions that implement all or some of the condition codes. The instruction can also be used to represent macro-op fusion on architectures like Intel's.
fn brif<T1intcc: Into<IntCC>>(
self,
Cond: T1intcc,
f: Value,
EBB: Ebb,
args: &[Value]
) -> Inst
self,
Cond: T1intcc,
f: Value,
EBB: Ebb,
args: &[Value]
) -> Inst
Branch when condition is true in integer CPU flags.
fn brff<T1floatcc: Into<FloatCC>>(
self,
Cond: T1floatcc,
f: Value,
EBB: Ebb,
args: &[Value]
) -> Inst
self,
Cond: T1floatcc,
f: Value,
EBB: Ebb,
args: &[Value]
) -> Inst
Branch when condition is true in floating point CPU flags.
fn br_table(self, x: Value, EBB: Ebb, JT: JumpTable) -> Inst
Indirect branch via jump table.
Use x
as an unsigned index into the jump table JT
. If a jump
table entry is found, branch to the corresponding EBB. If no entry was
found or the index is out-of-bounds, branch to the given default EBB.
Note that this branch instruction can't pass arguments to the targeted blocks. Split critical edges as needed to work around this.
Do not confuse this with "tables" in WebAssembly. br_table
is for
jump tables with destinations within the current function only -- think
of a match
in Rust or a switch
in C. If you want to call a
function in a dynamic library, that will typically use
call_indirect
.
fn jump_table_entry<T1uimm8: Into<Uimm8>>(
self,
x: Value,
addr: Value,
Size: T1uimm8,
JT: JumpTable
) -> Value
self,
x: Value,
addr: Value,
Size: T1uimm8,
JT: JumpTable
) -> Value
Get an entry from a jump table.
Load a serialized entry
from a jump table JT
at a given index
addr
with a specific Size
. The retrieved entry may need to be
decoded after loading, depending upon the jump table type used.
Currently, the only type supported is entries which are relative to the base of the jump table.
fn jump_table_base(self, iAddr: Type, JT: JumpTable) -> Value
Get the absolute base address of a jump table.
This is used for jump tables wherein the entries are stored relative to
the base of jump table. In order to use these, generated code should first
load an entry using jump_table_entry
, then use this instruction to add
the relative base back to it.
fn indirect_jump_table_br(self, addr: Value, JT: JumpTable) -> Inst
Branch indirectly via a jump table entry.
Unconditionally jump via a jump table entry that was previously loaded
with the jump_table_entry
instruction.
fn debugtrap(self) -> Inst
Encodes an assembly debug trap.
fn trap<T1trapcode: Into<TrapCode>>(self, code: T1trapcode) -> Inst
Terminate execution unconditionally.
fn trapz<T1trapcode: Into<TrapCode>>(self, c: Value, code: T1trapcode) -> Inst
Trap when zero.
if c
is non-zero, execution continues at the following instruction.
fn resumable_trap<T1trapcode: Into<TrapCode>>(self, code: T1trapcode) -> Inst
A resumable trap.
This instruction allows non-conditional traps to be used as non-terminal instructions.
fn trapnz<T1trapcode: Into<TrapCode>>(self, c: Value, code: T1trapcode) -> Inst
Trap when non-zero.
if c
is zero, execution continues at the following instruction.
fn trapif<T1intcc: Into<IntCC>, T2trapcode: Into<TrapCode>>(
self,
Cond: T1intcc,
f: Value,
code: T2trapcode
) -> Inst
self,
Cond: T1intcc,
f: Value,
code: T2trapcode
) -> Inst
Trap when condition is true in integer CPU flags.
fn trapff<T1floatcc: Into<FloatCC>, T2trapcode: Into<TrapCode>>(
self,
Cond: T1floatcc,
f: Value,
code: T2trapcode
) -> Inst
self,
Cond: T1floatcc,
f: Value,
code: T2trapcode
) -> Inst
Trap when condition is true in floating point CPU flags.
fn return_(self, rvals: &[Value]) -> Inst
Return from the function.
Unconditionally transfer control to the calling function, passing the provided return values. The list of return values must match the function signature's return types.
fn fallthrough_return(self, rvals: &[Value]) -> Inst
Return from the function by fallthrough.
This is a specialized instruction for use where one wants to append a custom epilogue, which will then perform the real return. This instruction has no encoding.
fn call(self, FN: FuncRef, args: &[Value]) -> Inst
Direct function call.
Call a function which has been declared in the preamble. The argument types must match the function's signature.
fn call_indirect(self, SIG: SigRef, callee: Value, args: &[Value]) -> Inst
Indirect function call.
Call the function pointed to by callee
with the given arguments. The
called function must match the specified signature.
Note that this is different from WebAssembly's call_indirect
; the
callee is a native address, rather than a table index. For WebAssembly,
table_addr
and load
are used to obtain a native address
from a table.
fn func_addr(self, iAddr: Type, FN: FuncRef) -> Value
Get the address of a function.
Compute the absolute address of a function declared in the preamble.
The returned address can be used as a callee
argument to
call_indirect
. This is also a method for calling functions that
are too far away to be addressable by a direct call
instruction.
fn load<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
Mem: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
self,
Mem: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
Load from memory at p + Offset
.
This is a polymorphic instruction that can load any value type which has a memory representation.
fn load_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
Mem: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
self,
Mem: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
Load from memory at sum(args) + Offset
.
This is a polymorphic instruction that can load any value type which has a memory representation.
fn store<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
Store x
to memory at p + Offset
.
This is a polymorphic instruction that can store any value type with a memory representation.
fn store_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
Store x
to memory at sum(args) + Offset
.
This is a polymorphic instruction that can store any value type with a memory representation.
fn uload8<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt8: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
self,
iExt8: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
Load 8 bits from memory at p + Offset
and zero-extend.
This is equivalent to load.i8
followed by uextend
.
fn uload8_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt8: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
self,
iExt8: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
Load 8 bits from memory at sum(args) + Offset
and zero-extend.
This is equivalent to load.i8
followed by uextend
.
fn sload8<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt8: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
self,
iExt8: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
Load 8 bits from memory at p + Offset
and sign-extend.
This is equivalent to load.i8
followed by sextend
.
fn sload8_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt8: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
self,
iExt8: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
Load 8 bits from memory at sum(args) + Offset
and sign-extend.
This is equivalent to load.i8
followed by sextend
.
fn istore8<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
Store the low 8 bits of x
to memory at p + Offset
.
This is equivalent to ireduce.i8
followed by store.i8
.
fn istore8_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
Store the low 8 bits of x
to memory at sum(args) + Offset
.
This is equivalent to ireduce.i8
followed by store.i8
.
fn uload16<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt16: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
self,
iExt16: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
Load 16 bits from memory at p + Offset
and zero-extend.
This is equivalent to load.i16
followed by uextend
.
fn uload16_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt16: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
self,
iExt16: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
Load 16 bits from memory at sum(args) + Offset
and zero-extend.
This is equivalent to load.i16
followed by uextend
.
fn sload16<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt16: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
self,
iExt16: Type,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
Load 16 bits from memory at p + Offset
and sign-extend.
This is equivalent to load.i16
followed by sextend
.
fn sload16_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
iExt16: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
self,
iExt16: Type,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
Load 16 bits from memory at sum(args) + Offset
and sign-extend.
This is equivalent to load.i16
followed by sextend
.
fn istore16<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
Store the low 16 bits of x
to memory at p + Offset
.
This is equivalent to ireduce.i16
followed by store.i16
.
fn istore16_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
Store the low 16 bits of x
to memory at sum(args) + Offset
.
This is equivalent to ireduce.i16
followed by store.i16
.
fn uload32<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
self,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
Load 32 bits from memory at p + Offset
and zero-extend.
This is equivalent to load.i32
followed by uextend
.
fn uload32_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
self,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
Load 32 bits from memory at sum(args) + Offset
and zero-extend.
This is equivalent to load.i32
followed by uextend
.
fn sload32<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
self,
MemFlags: T1memflags,
p: Value,
Offset: T2offset32
) -> Value
Load 32 bits from memory at p + Offset
and sign-extend.
This is equivalent to load.i32
followed by sextend
.
fn sload32_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
self,
MemFlags: T1memflags,
args: &[Value],
Offset: T2offset32
) -> Value
Load 32 bits from memory at sum(args) + Offset
and sign-extend.
This is equivalent to load.i32
followed by sextend
.
fn istore32<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
p: Value,
Offset: T2offset32
) -> Inst
Store the low 32 bits of x
to memory at p + Offset
.
This is equivalent to ireduce.i32
followed by store.i32
.
fn istore32_complex<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
self,
MemFlags: T1memflags,
x: Value,
args: &[Value],
Offset: T2offset32
) -> Inst
Store the low 32 bits of x
to memory at sum(args) + Offset
.
This is equivalent to ireduce.i32
followed by store.i32
.
fn stack_load<T1offset32: Into<Offset32>>(
self,
Mem: Type,
SS: StackSlot,
Offset: T1offset32
) -> Value
self,
Mem: Type,
SS: StackSlot,
Offset: T1offset32
) -> Value
Load a value from a stack slot at the constant offset.
This is a polymorphic instruction that can load any value type which has a memory representation.
The offset is an immediate constant, not an SSA value. The memory
access cannot go out of bounds, i.e.
sizeof(a) + Offset <= sizeof(SS)
.
fn stack_store<T1offset32: Into<Offset32>>(
self,
x: Value,
SS: StackSlot,
Offset: T1offset32
) -> Inst
self,
x: Value,
SS: StackSlot,
Offset: T1offset32
) -> Inst
Store a value to a stack slot at a constant offset.
This is a polymorphic instruction that can store any value type with a memory representation.
The offset is an immediate constant, not an SSA value. The memory
access cannot go out of bounds, i.e.
sizeof(a) + Offset <= sizeof(SS)
.
fn stack_addr<T1offset32: Into<Offset32>>(
self,
iAddr: Type,
SS: StackSlot,
Offset: T1offset32
) -> Value
self,
iAddr: Type,
SS: StackSlot,
Offset: T1offset32
) -> Value
Get the address of a stack slot.
Compute the absolute address of a byte in a stack slot. The offset must
refer to a byte inside the stack slot:
0 <= Offset < sizeof(SS)
.
fn global_value(self, Mem: Type, GV: GlobalValue) -> Value
Compute the value of global GV.
fn symbol_value(self, Mem: Type, GV: GlobalValue) -> Value
Compute the value of global GV, which is a symbolic value.
fn heap_addr<T1uimm32: Into<Uimm32>>(
self,
iAddr: Type,
H: Heap,
p: Value,
Size: T1uimm32
) -> Value
self,
iAddr: Type,
H: Heap,
p: Value,
Size: T1uimm32
) -> Value
Bounds check and compute absolute address of heap memory.
Verify that the offset range p .. p + Size - 1
is in bounds for the
heap H, and generate an absolute address that is safe to dereference.
- If
p + Size
is not greater than the heap bound, return an absolute address corresponding to a byte offset ofp
from the heap's base address. - If
p + Size
is greater than the heap bound, generate a trap.
fn get_pinned_reg(self, iAddr: Type) -> Value
Gets the content of the pinned register, when it's enabled.
fn set_pinned_reg(self, addr: Value) -> Inst
Sets the content of the pinned register, when it's enabled.
fn table_addr<T1offset32: Into<Offset32>>(
self,
iAddr: Type,
T: Table,
p: Value,
Offset: T1offset32
) -> Value
self,
iAddr: Type,
T: Table,
p: Value,
Offset: T1offset32
) -> Value
Bounds check and compute absolute address of a table entry.
Verify that the offset p
is in bounds for the table T, and generate
an absolute address that is safe to dereference.
Offset
must be less than the size of a table element.
- If
p
is not greater than the table bound, return an absolute address corresponding to a byte offset ofp
from the table's base address. - If
p
is greater than the table bound, generate a trap.
fn iconst<T1imm64: Into<Imm64>>(self, Int: Type, N: T1imm64) -> Value
Integer constant.
Create a scalar integer SSA value with an immediate constant value, or an integer vector where all the lanes have the same value.
fn f32const<T1ieee32: Into<Ieee32>>(self, N: T1ieee32) -> Value
Floating point constant.
Create a f32
SSA value with an immediate constant value.
fn f64const<T1ieee64: Into<Ieee64>>(self, N: T1ieee64) -> Value
Floating point constant.
Create a f64
SSA value with an immediate constant value.
fn bconst<T1boolean: Into<bool>>(self, Bool: Type, N: T1boolean) -> Value
Boolean constant.
Create a scalar boolean SSA value with an immediate constant value, or a boolean vector where all the lanes have the same value.
fn vconst<T1poolConstant: Into<Constant>>(
self,
TxN: Type,
N: T1poolConstant
) -> Value
self,
TxN: Type,
N: T1poolConstant
) -> Value
SIMD vector constant.
Construct a vector with the given immediate bytes.
fn shuffle<T1uimm128: Into<Immediate>>(
self,
a: Value,
b: Value,
mask: T1uimm128
) -> Value
self,
a: Value,
b: Value,
mask: T1uimm128
) -> Value
SIMD vector shuffle.
Shuffle two vectors using the given immediate bytes. For each of the 16 bytes of the immediate, a value i of 0-15 selects the i-th element of the first vector and a value i of 16-31 selects the (i-16)th element of the second vector. Immediate values outside of the 0-31 range place a 0 in the resulting vector lane.
fn null(self, Ref: Type) -> Value
Null constant value for reference types.
Create a scalar reference SSA value with a constant null value.
fn nop(self) -> Inst
Just a dummy instruction
Note: this doesn't compile to a machine code nop
fn select(self, c: Value, x: Value, y: Value) -> Value
Conditional select.
This instruction selects whole values. Use vselect
for
lane-wise selection.
fn selectif<T1intcc: Into<IntCC>>(
self,
Any: Type,
cc: T1intcc,
flags: Value,
x: Value,
y: Value
) -> Value
self,
Any: Type,
cc: T1intcc,
flags: Value,
x: Value,
y: Value
) -> Value
Conditional select, dependent on integer condition codes.
fn copy(self, x: Value) -> Value
Register-register copy.
This instruction copies its input, preserving the value type.
A pure SSA-form program does not need to copy values, but this instruction is useful for representing intermediate stages during instruction transformations, and the register allocator needs a way of representing register copies.
fn spill(self, x: Value) -> Value
Spill a register value to a stack slot.
This instruction behaves exactly like copy
, but the result
value is assigned to a spill slot.
fn fill(self, x: Value) -> Value
Load a register value from a stack slot.
This instruction behaves exactly like copy
, but creates a new
SSA value for the spilled input value.
fn fill_nop(self, x: Value) -> Value
This is identical to fill
, except it has no encoding, since it is a no-op.
This instruction is created only during late-stage redundant-reload removal, after all
registers and stack slots have been assigned. It is used to replace fill
s that have
been identified as redundant.
fn regmove<T1regunit: Into<RegUnit>, T2regunit: Into<RegUnit>>(
self,
x: Value,
src: T1regunit,
dst: T2regunit
) -> Inst
self,
x: Value,
src: T1regunit,
dst: T2regunit
) -> Inst
Temporarily divert x
from src
to dst
.
This instruction moves the location of a value from one register to another without creating a new SSA value. It is used by the register allocator to temporarily rearrange register assignments in order to satisfy instruction constraints.
The register diversions created by this instruction must be undone before the value leaves the EBB. At the entry to a new EBB, all live values must be in their originally assigned registers.
fn copy_special<T1regunit: Into<RegUnit>, T2regunit: Into<RegUnit>>(
self,
src: T1regunit,
dst: T2regunit
) -> Inst
self,
src: T1regunit,
dst: T2regunit
) -> Inst
Copies the contents of ''src'' register to ''dst'' register.
This instructions copies the contents of one register to another register without involving any SSA values. This is used for copying special registers, e.g. copying the stack register to the frame register in a function prologue.
fn copy_to_ssa<T1regunit: Into<RegUnit>>(
self,
Any: Type,
src: T1regunit
) -> Value
self,
Any: Type,
src: T1regunit
) -> Value
Copies the contents of ''src'' register to ''a'' SSA name.
This instruction copies the contents of one register, regardless of its SSA name, to another register, creating a new SSA name. In that sense it is a one-sided version of ''copy_special''. This instruction is internal and should not be created by Cranelift users.
fn copy_nop(self, x: Value) -> Value
Stack-slot-to-the-same-stack-slot copy, which is guaranteed to turn into a no-op. This instruction is for use only within Cranelift itself.
This instruction copies its input, preserving the value type.
fn adjust_sp_down(self, delta: Value) -> Inst
Subtracts delta
offset value from the stack pointer register.
This instruction is used to adjust the stack pointer by a dynamic amount.
fn adjust_sp_up_imm<T1imm64: Into<Imm64>>(self, Offset: T1imm64) -> Inst
Adds Offset
immediate offset value to the stack pointer register.
This instruction is used to adjust the stack pointer, primarily in function
prologues and epilogues. Offset
is constrained to the size of a signed
32-bit integer.
fn adjust_sp_down_imm<T1imm64: Into<Imm64>>(self, Offset: T1imm64) -> Inst
Subtracts Offset
immediate offset value from the stack pointer
register.
This instruction is used to adjust the stack pointer, primarily in function
prologues and epilogues. Offset
is constrained to the size of a signed
32-bit integer.
fn ifcmp_sp(self, addr: Value) -> Value
Compare addr
with the stack pointer and set the CPU flags.
This is like ifcmp
where addr
is the LHS operand and the stack
pointer is the RHS.
fn regspill<T1regunit: Into<RegUnit>>(
self,
x: Value,
src: T1regunit,
SS: StackSlot
) -> Inst
self,
x: Value,
src: T1regunit,
SS: StackSlot
) -> Inst
Temporarily divert x
from src
to SS
.
This instruction moves the location of a value from a register to a stack slot without creating a new SSA value. It is used by the register allocator to temporarily rearrange register assignments in order to satisfy instruction constraints.
See also regmove
.
fn regfill<T1regunit: Into<RegUnit>>(
self,
x: Value,
SS: StackSlot,
dst: T1regunit
) -> Inst
self,
x: Value,
SS: StackSlot,
dst: T1regunit
) -> Inst
Temporarily divert x
from SS
to dst
.
This instruction moves the location of a value from a stack slot to a register without creating a new SSA value. It is used by the register allocator to temporarily rearrange register assignments in order to satisfy instruction constraints.
See also regmove
.
fn safepoint(self, args: &[Value]) -> Inst
This instruction will provide live reference values at a point in the function. It can only be used by the compiler.
fn vsplit(self, x: Value) -> (Value, Value)
Split a vector into two halves.
Split the vector x
into two separate values, each containing half of
the lanes from x
. The result may be two scalars if x
only had
two lanes.
fn vconcat(self, x: Value, y: Value) -> Value
Vector concatenation.
Return a vector formed by concatenating x
and y
. The resulting
vector type has twice as many lanes as each of the inputs. The lanes of
x
appear as the low-numbered lanes, and the lanes of y
become
the high-numbered lanes of a
.
It is possible to form a vector by concatenating two scalars.
fn vselect(self, c: Value, x: Value, y: Value) -> Value
Vector lane select.
Select lanes from x
or y
controlled by the lanes of the boolean
vector c
.
fn splat(self, TxN: Type, x: Value) -> Value
Vector splat.
Return a vector whose lanes are all x
.
fn insertlane<T1uimm8: Into<Uimm8>>(
self,
x: Value,
Idx: T1uimm8,
y: Value
) -> Value
self,
x: Value,
Idx: T1uimm8,
y: Value
) -> Value
Insert y
as lane Idx
in x.
The lane index, Idx
, is an immediate value, not an SSA value. It
must indicate a valid lane index for the type of x
.
fn extractlane<T1uimm8: Into<Uimm8>>(self, x: Value, Idx: T1uimm8) -> Value
Extract lane Idx
from x
.
The lane index, Idx
, is an immediate value, not an SSA value. It
must indicate a valid lane index for the type of x
. Note that the upper bits of a
may or may not be zeroed depending on the ISA but the type system should prevent using
a
as anything other than the extracted value.
fn icmp<T1intcc: Into<IntCC>>(self, Cond: T1intcc, x: Value, y: Value) -> Value
Integer comparison.
The condition code determines if the operands are interpreted as signed or unsigned integers.
Signed | Unsigned | Condition |
---|---|---|
eq | eq | Equal |
ne | ne | Not equal |
slt | ult | Less than |
sge | uge | Greater than or equal |
sgt | ugt | Greater than |
sle | ule | Less than or equal |
of | * | Overflow |
nof | * | No Overflow |
* The unsigned version of overflow conditions have ISA-specific semantics and thus have been kept as methods on the TargetIsa trait as unsigned_add_overflow_condition and unsigned_sub_overflow_condition.
When this instruction compares integer vectors, it returns a boolean vector of lane-wise comparisons.
fn icmp_imm<T1intcc: Into<IntCC>, T2imm64: Into<Imm64>>(
self,
Cond: T1intcc,
x: Value,
Y: T2imm64
) -> Value
self,
Cond: T1intcc,
x: Value,
Y: T2imm64
) -> Value
Compare scalar integer to a constant.
This is the same as the icmp
instruction, except one operand is
an immediate constant.
This instruction can only compare scalars. Use icmp
for
lane-wise vector comparisons.
fn ifcmp(self, x: Value, y: Value) -> Value
Compare scalar integers and return flags.
Compare two scalar integer values and return integer CPU flags representing the result.
fn ifcmp_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Compare scalar integer to a constant and return flags.
Like icmp_imm
, but returns integer CPU flags instead of testing
a specific condition code.
fn iadd(self, x: Value, y: Value) -> Value
Wrapping integer addition: a := x + y \pmod{2^B}
.
This instruction does not depend on the signed/unsigned interpretation of the operands.
fn uadd_sat(self, x: Value, y: Value) -> Value
Add with unsigned saturation.
This is similar to iadd
but the operands are interpreted as unsigned integers and their
summed result, instead of wrapping, will be saturated to the highest unsigned integer for
the controlling type (e.g. 0xFF
for i8).
fn sadd_sat(self, x: Value, y: Value) -> Value
Add with signed saturation.
This is similar to iadd
but the operands are interpreted as signed integers and their
summed result, instead of wrapping, will be saturated to the lowest or highest
signed integer for the controlling type (e.g. 0x80
or 0x7F
for i8). For example,
since an iadd_ssat.i8
of 0x70
and 0x70
is greater than 0x7F
, the result will be
clamped to 0x7F
.
fn isub(self, x: Value, y: Value) -> Value
Wrapping integer subtraction: a := x - y \pmod{2^B}
.
This instruction does not depend on the signed/unsigned interpretation of the operands.
fn usub_sat(self, x: Value, y: Value) -> Value
Subtract with unsigned saturation.
This is similar to isub
but the operands are interpreted as unsigned integers and their
difference, instead of wrapping, will be saturated to the lowest unsigned integer for
the controlling type (e.g. 0x00
for i8).
fn ssub_sat(self, x: Value, y: Value) -> Value
Subtract with signed saturation.
This is similar to isub
but the operands are interpreted as signed integers and their
difference, instead of wrapping, will be saturated to the lowest or highest
signed integer for the controlling type (e.g. 0x80
or 0x7F
for i8).
fn ineg(self, x: Value) -> Value
Integer negation: a := -x \pmod{2^B}
.
fn imul(self, x: Value, y: Value) -> Value
Wrapping integer multiplication: a := x y \pmod{2^B}
.
This instruction does not depend on the signed/unsigned interpretation of the operands.
Polymorphic over all integer types (vector and scalar).
fn umulhi(self, x: Value, y: Value) -> Value
Unsigned integer multiplication, producing the high half of a double-length result.
Polymorphic over all scalar integer types, but does not support vector types.
fn smulhi(self, x: Value, y: Value) -> Value
Signed integer multiplication, producing the high half of a double-length result.
Polymorphic over all scalar integer types, but does not support vector types.
fn udiv(self, x: Value, y: Value) -> Value
Unsigned integer division: a := \lfloor {x \over y} \rfloor
.
This operation traps if the divisor is zero.
fn sdiv(self, x: Value, y: Value) -> Value
Signed integer division rounded toward zero: a := sign(xy) \lfloor {|x| \over |y|}\rfloor
.
This operation traps if the divisor is zero, or if the result is not
representable in B
bits two's complement. This only happens
when x = -2^{B-1}, y = -1
.
fn urem(self, x: Value, y: Value) -> Value
Unsigned integer remainder.
This operation traps if the divisor is zero.
fn srem(self, x: Value, y: Value) -> Value
Signed integer remainder. The result has the sign of the dividend.
This operation traps if the divisor is zero.
fn iadd_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Add immediate integer.
Same as iadd
, but one operand is an immediate constant.
Polymorphic over all scalar integer types, but does not support vector types.
fn imul_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Integer multiplication by immediate constant.
Polymorphic over all scalar integer types, but does not support vector types.
fn udiv_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Unsigned integer division by an immediate constant.
This operation traps if the divisor is zero.
fn sdiv_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Signed integer division by an immediate constant.
This operation traps if the divisor is zero, or if the result is not
representable in B
bits two's complement. This only happens
when x = -2^{B-1}, Y = -1
.
fn urem_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Unsigned integer remainder with immediate divisor.
This operation traps if the divisor is zero.
fn srem_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Signed integer remainder with immediate divisor.
This operation traps if the divisor is zero.
fn irsub_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Immediate reverse wrapping subtraction: a := Y - x \pmod{2^B}
.
Also works as integer negation when Y = 0
. Use iadd_imm
with a negative immediate operand for the reverse immediate
subtraction.
Polymorphic over all scalar integer types, but does not support vector types.
fn iadd_cin(self, x: Value, y: Value, c_in: Value) -> Value
Add integers with carry in.
Same as iadd
with an additional carry input. Computes:
a = x + y + c_{in} \pmod 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn iadd_ifcin(self, x: Value, y: Value, c_in: Value) -> Value
Add integers with carry in.
Same as iadd
with an additional carry flag input. Computes:
a = x + y + c_{in} \pmod 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn iadd_cout(self, x: Value, y: Value) -> (Value, Value)
Add integers with carry out.
Same as iadd
with an additional carry output.
a &= x + y \pmod 2^B \\
c_{out} &= x+y >= 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn iadd_ifcout(self, x: Value, y: Value) -> (Value, Value)
Add integers with carry out.
Same as iadd
with an additional carry flag output.
a &= x + y \pmod 2^B \\
c_{out} &= x+y >= 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn iadd_carry(self, x: Value, y: Value, c_in: Value) -> (Value, Value)
Add integers with carry in and out.
Same as iadd
with an additional carry input and output.
a &= x + y + c_{in} \pmod 2^B \\
c_{out} &= x + y + c_{in} >= 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn iadd_ifcarry(self, x: Value, y: Value, c_in: Value) -> (Value, Value)
Add integers with carry in and out.
Same as iadd
with an additional carry flag input and output.
a &= x + y + c_{in} \pmod 2^B \\
c_{out} &= x + y + c_{in} >= 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn isub_bin(self, x: Value, y: Value, b_in: Value) -> Value
Subtract integers with borrow in.
Same as isub
with an additional borrow flag input. Computes:
a = x - (y + b_{in}) \pmod 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn isub_ifbin(self, x: Value, y: Value, b_in: Value) -> Value
Subtract integers with borrow in.
Same as isub
with an additional borrow flag input. Computes:
a = x - (y + b_{in}) \pmod 2^B
Polymorphic over all scalar integer types, but does not support vector types.
fn isub_bout(self, x: Value, y: Value) -> (Value, Value)
Subtract integers with borrow out.
Same as isub
with an additional borrow flag output.
a &= x - y \pmod 2^B \\
b_{out} &= x < y
Polymorphic over all scalar integer types, but does not support vector types.
fn isub_ifbout(self, x: Value, y: Value) -> (Value, Value)
Subtract integers with borrow out.
Same as isub
with an additional borrow flag output.
a &= x - y \pmod 2^B \\
b_{out} &= x < y
Polymorphic over all scalar integer types, but does not support vector types.
fn isub_borrow(self, x: Value, y: Value, b_in: Value) -> (Value, Value)
Subtract integers with borrow in and out.
Same as isub
with an additional borrow flag input and output.
a &= x - (y + b_{in}) \pmod 2^B \\
b_{out} &= x < y + b_{in}
Polymorphic over all scalar integer types, but does not support vector types.
fn isub_ifborrow(self, x: Value, y: Value, b_in: Value) -> (Value, Value)
Subtract integers with borrow in and out.
Same as isub
with an additional borrow flag input and output.
a &= x - (y + b_{in}) \pmod 2^B \\
b_{out} &= x < y + b_{in}
Polymorphic over all scalar integer types, but does not support vector types.
fn band(self, x: Value, y: Value) -> Value
Bitwise and.
fn bor(self, x: Value, y: Value) -> Value
Bitwise or.
fn bxor(self, x: Value, y: Value) -> Value
Bitwise xor.
fn bnot(self, x: Value) -> Value
Bitwise not.
fn band_not(self, x: Value, y: Value) -> Value
Bitwise and not.
Computes x & ~y
.
fn bor_not(self, x: Value, y: Value) -> Value
Bitwise or not.
Computes x | ~y
.
fn bxor_not(self, x: Value, y: Value) -> Value
Bitwise xor not.
Computes x ^ ~y
.
fn band_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Bitwise and with immediate.
Same as band
, but one operand is an immediate constant.
Polymorphic over all scalar integer types, but does not support vector types.
fn bor_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Bitwise or with immediate.
Same as bor
, but one operand is an immediate constant.
Polymorphic over all scalar integer types, but does not support vector types.
fn bxor_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Bitwise xor with immediate.
Same as bxor
, but one operand is an immediate constant.
Polymorphic over all scalar integer types, but does not support vector types.
fn rotl(self, x: Value, y: Value) -> Value
Rotate left.
Rotate the bits in x
by y
places.
fn rotr(self, x: Value, y: Value) -> Value
Rotate right.
Rotate the bits in x
by y
places.
fn rotl_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Rotate left by immediate.
fn rotr_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Rotate right by immediate.
fn ishl(self, x: Value, y: Value) -> Value
Integer shift left. Shift the bits in x
towards the MSB by y
places. Shift in zero bits to the LSB.
The shift amount is masked to the size of x
.
When shifting a B-bits integer type, this instruction computes:
s &:= y \pmod B,
a &:= x \cdot 2^s \pmod{2^B}.
fn ushr(self, x: Value, y: Value) -> Value
Unsigned shift right. Shift bits in x
towards the LSB by y
places, shifting in zero bits to the MSB. Also called a logical
shift.
The shift amount is masked to the size of the register.
When shifting a B-bits integer type, this instruction computes:
s &:= y \pmod B,
a &:= \lfloor x \cdot 2^{-s} \rfloor.
fn sshr(self, x: Value, y: Value) -> Value
Signed shift right. Shift bits in x
towards the LSB by y
places, shifting in sign bits to the MSB. Also called an arithmetic
shift.
The shift amount is masked to the size of the register.
fn ishl_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Integer shift left by immediate.
The shift amount is masked to the size of x
.
fn ushr_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Unsigned shift right by immediate.
The shift amount is masked to the size of the register.
fn sshr_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value
Signed shift right by immediate.
The shift amount is masked to the size of the register.
fn bitrev(self, x: Value) -> Value
Reverse the bits of a integer.
Reverses the bits in x
.
fn clz(self, x: Value) -> Value
Count leading zero bits.
Starting from the MSB in x
, count the number of zero bits before
reaching the first one bit. When x
is zero, returns the size of x
in bits.
fn cls(self, x: Value) -> Value
Count leading sign bits.
Starting from the MSB after the sign bit in x
, count the number of
consecutive bits identical to the sign bit. When x
is 0 or -1,
returns one less than the size of x in bits.
fn ctz(self, x: Value) -> Value
Count trailing zeros.
Starting from the LSB in x
, count the number of zero bits before
reaching the first one bit. When x
is zero, returns the size of x
in bits.
fn popcnt(self, x: Value) -> Value
Population count
Count the number of one bits in x
.
fn fcmp<T1floatcc: Into<FloatCC>>(
self,
Cond: T1floatcc,
x: Value,
y: Value
) -> Value
self,
Cond: T1floatcc,
x: Value,
y: Value
) -> Value
Floating point comparison.
Two IEEE 754-2008 floating point numbers, x
and y
, relate to each
other in exactly one of four ways:
== ==========================================
UN Unordered when one or both numbers is NaN.
EQ When x = y
. (And 0.0 = -0.0
).
LT When x < y
.
GT When x > y
.
== ==========================================
The 14 floatcc
condition codes each correspond to a subset of
the four relations, except for the empty set which would always be
false, and the full set which would always be true.
The condition codes are divided into 7 'ordered' conditions which don't include UN, and 7 unordered conditions which all include UN.
+-------+------------+---------+------------+-------------------------+ |Ordered |Unordered |Condition | +=======+============+=========+============+=========================+ |ord |EQ | LT | GT|uno |UN |NaNs absent / present. | +-------+------------+---------+------------+-------------------------+ |eq |EQ |ueq |UN | EQ |Equal | +-------+------------+---------+------------+-------------------------+ |one |LT | GT |ne |UN | LT | GT|Not equal | +-------+------------+---------+------------+-------------------------+ |lt |LT |ult |UN | LT |Less than | +-------+------------+---------+------------+-------------------------+ |le |LT | EQ |ule |UN | LT | EQ|Less than or equal | +-------+------------+---------+------------+-------------------------+ |gt |GT |ugt |UN | GT |Greater than | +-------+------------+---------+------------+-------------------------+ |ge |GT | EQ |uge |UN | GT | EQ|Greater than or equal | +-------+------------+---------+------------+-------------------------+
The standard C comparison operators, <, <=, >, >=
, are all ordered,
so they are false if either operand is NaN. The C equality operator,
==
, is ordered, and since inequality is defined as the logical
inverse it is unordered. They map to the floatcc
condition
codes as follows:
==== ====== ============
C Cond
Subset
==== ====== ============
==
eq EQ
!=
ne UN | LT | GT
<
lt LT
<=
le LT | EQ
>
gt GT
>=
ge GT | EQ
==== ====== ============
This subset of condition codes also corresponds to the WebAssembly floating point comparisons of the same name.
When this instruction compares floating point vectors, it returns a boolean vector with the results of lane-wise comparisons.
fn ffcmp(self, x: Value, y: Value) -> Value
Floating point comparison returning flags.
Compares two numbers like fcmp
, but returns floating point CPU
flags instead of testing a specific condition.
fn fadd(self, x: Value, y: Value) -> Value
Floating point addition.
fn fsub(self, x: Value, y: Value) -> Value
Floating point subtraction.
fn fmul(self, x: Value, y: Value) -> Value
Floating point multiplication.
fn fdiv(self, x: Value, y: Value) -> Value
Floating point division.
Unlike the integer division instructions and
udiv`, this can't trap. Division by zero is infinity or
NaN, depending on the dividend.
fn sqrt(self, x: Value) -> Value
Floating point square root.
fn fma(self, x: Value, y: Value, z: Value) -> Value
Floating point fused multiply-and-add.
Computes a := xy+z
without any intermediate rounding of the
product.
fn fneg(self, x: Value) -> Value
Floating point negation.
Note that this is a pure bitwise operation.
fn fabs(self, x: Value) -> Value
Floating point absolute value.
Note that this is a pure bitwise operation.
fn fcopysign(self, x: Value, y: Value) -> Value
Floating point copy sign.
Note that this is a pure bitwise operation. The sign bit from y
is
copied to the sign bit of x
.
fn fmin(self, x: Value, y: Value) -> Value
Floating point minimum, propagating NaNs.
If either operand is NaN, this returns a NaN.
fn fmax(self, x: Value, y: Value) -> Value
Floating point maximum, propagating NaNs.
If either operand is NaN, this returns a NaN.
fn ceil(self, x: Value) -> Value
Round floating point round to integral, towards positive infinity.
fn floor(self, x: Value) -> Value
Round floating point round to integral, towards negative infinity.
fn trunc(self, x: Value) -> Value
Round floating point round to integral, towards zero.
fn nearest(self, x: Value) -> Value
Round floating point round to integral, towards nearest with ties to even.
fn is_null(self, x: Value) -> Value
Reference verification.
The condition code determines if the reference type in question is null or not.
fn trueif<T1intcc: Into<IntCC>>(self, Cond: T1intcc, f: Value) -> Value
Test integer CPU flags for a specific condition.
Check the CPU flags in f
against the Cond
condition code and
return true when the condition code is satisfied.
fn trueff<T1floatcc: Into<FloatCC>>(self, Cond: T1floatcc, f: Value) -> Value
Test floating point CPU flags for a specific condition.
Check the CPU flags in f
against the Cond
condition code and
return true when the condition code is satisfied.
fn bitcast(self, MemTo: Type, x: Value) -> Value
Reinterpret the bits in x
as a different type.
The input and output types must be storable to memory and of the same size. A bitcast is equivalent to storing one type and loading the other type from the same address.
fn raw_bitcast(self, AnyTo: Type, x: Value) -> Value
Cast the bits in x
as a different type of the same bit width.
This instruction does not change the data's representation but allows
data in registers to be used as different types, e.g. an i32x4 as a
b8x16. The only constraint on the result a
is that it can be
raw_bitcast
back to the original type. Also, in a raw_bitcast between
vector types with the same number of lanes, the value of each result
lane is a raw_bitcast of the corresponding operand lane. TODO there is
currently no mechanism for enforcing the bit width constraint.
fn scalar_to_vector(self, TxN: Type, s: Value) -> Value
Scalar To Vector -- move a value out of a scalar register and into a vector register; the scalar will be moved to the lowest-order bits of the vector register. Note that this instruction is intended as a low-level legalization instruction and frontends should prefer insertlane; on certain architectures, scalar_to_vector may zero the highest-order bits for some types (e.g. integers) but not for others (e.g. floats).
fn breduce(self, BoolTo: Type, x: Value) -> Value
Convert x
to a smaller boolean type in the platform-defined way.
The result type must have the same number of vector lanes as the input, and each lane must not have more bits that the input lanes. If the input and output types are the same, this is a no-op.
fn bextend(self, BoolTo: Type, x: Value) -> Value
Convert x
to a larger boolean type in the platform-defined way.
The result type must have the same number of vector lanes as the input, and each lane must not have fewer bits that the input lanes. If the input and output types are the same, this is a no-op.
fn bint(self, IntTo: Type, x: Value) -> Value
Convert x
to an integer.
True maps to 1 and false maps to 0. The result type must have the same number of vector lanes as the input.
fn bmask(self, IntTo: Type, x: Value) -> Value
Convert x
to an integer mask.
True maps to all 1s and false maps to all 0s. The result type must have the same number of vector lanes as the input.
fn ireduce(self, IntTo: Type, x: Value) -> Value
Convert x
to a smaller integer type by dropping high bits.
Each lane in x
is converted to a smaller integer type by discarding
the most significant bits. This is the same as reducing modulo
2^n
.
The result type must have the same number of vector lanes as the input, and each lane must not have more bits that the input lanes. If the input and output types are the same, this is a no-op.
fn uextend(self, IntTo: Type, x: Value) -> Value
Convert x
to a larger integer type by zero-extending.
Each lane in x
is converted to a larger integer type by adding
zeroes. The result has the same numerical value as x
when both are
interpreted as unsigned integers.
The result type must have the same number of vector lanes as the input, and each lane must not have fewer bits that the input lanes. If the input and output types are the same, this is a no-op.
fn sextend(self, IntTo: Type, x: Value) -> Value
Convert x
to a larger integer type by sign-extending.
Each lane in x
is converted to a larger integer type by replicating
the sign bit. The result has the same numerical value as x
when both
are interpreted as signed integers.
The result type must have the same number of vector lanes as the input, and each lane must not have fewer bits that the input lanes. If the input and output types are the same, this is a no-op.
fn fpromote(self, FloatTo: Type, x: Value) -> Value
Convert x
to a larger floating point format.
Each lane in x
is converted to the destination floating point format.
This is an exact operation.
Cranelift currently only supports two floating point formats
f32
andf64
. This may change in the future.
The result type must have the same number of vector lanes as the input, and the result lanes must not have fewer bits than the input lanes. If the input and output types are the same, this is a no-op.
fn fdemote(self, FloatTo: Type, x: Value) -> Value
Convert x
to a smaller floating point format.
Each lane in x
is converted to the destination floating point format
by rounding to nearest, ties to even.
Cranelift currently only supports two floating point formats
f32
andf64
. This may change in the future.
The result type must have the same number of vector lanes as the input, and the result lanes must not have more bits than the input lanes. If the input and output types are the same, this is a no-op.
fn fcvt_to_uint(self, IntTo: Type, x: Value) -> Value
Convert floating point to unsigned integer.
Each lane in x
is converted to an unsigned integer by rounding
towards zero. If x
is NaN or if the unsigned integral value cannot be
represented in the result type, this instruction traps.
The result type must have the same number of vector lanes as the input.
fn fcvt_to_uint_sat(self, IntTo: Type, x: Value) -> Value
Convert floating point to unsigned integer as fcvt_to_uint does, but saturates the input instead of trapping. NaN and negative values are converted to 0.
fn fcvt_to_sint(self, IntTo: Type, x: Value) -> Value
Convert floating point to signed integer.
Each lane in x
is converted to a signed integer by rounding towards
zero. If x
is NaN or if the signed integral value cannot be
represented in the result type, this instruction traps.
The result type must have the same number of vector lanes as the input.
fn fcvt_to_sint_sat(self, IntTo: Type, x: Value) -> Value
Convert floating point to signed integer as fcvt_to_sint does, but saturates the input instead of trapping. NaN values are converted to 0.
fn fcvt_from_uint(self, FloatTo: Type, x: Value) -> Value
Convert unsigned integer to floating point.
Each lane in x
is interpreted as an unsigned integer and converted to
floating point using round to nearest, ties to even.
The result type must have the same number of vector lanes as the input.
fn fcvt_from_sint(self, FloatTo: Type, x: Value) -> Value
Convert signed integer to floating point.
Each lane in x
is interpreted as a signed integer and converted to
floating point using round to nearest, ties to even.
The result type must have the same number of vector lanes as the input.
fn isplit(self, x: Value) -> (Value, Value)
Split an integer into low and high parts.
Vectors of integers are split lane-wise, so the results have the same number of lanes as the input, but the lanes are half the size.
Returns the low half of x
and the high half of x
as two independent
values.
fn iconcat(self, lo: Value, hi: Value) -> Value
Concatenate low and high bits to form a larger integer type.
Vectors of integers are concatenated lane-wise such that the result has the same number of lanes as the inputs, but the lanes are twice the size.
fn x86_udivmodx(self, nlo: Value, nhi: Value, d: Value) -> (Value, Value)
Extended unsigned division.
Concatenate the bits in nhi
and nlo
to form the numerator.
Interpret the bits as an unsigned number and divide by the unsigned
denominator d
. Trap when d
is zero or if the quotient is larger
than the range of the output.
Return both quotient and remainder.
fn x86_sdivmodx(self, nlo: Value, nhi: Value, d: Value) -> (Value, Value)
Extended signed division.
Concatenate the bits in nhi
and nlo
to form the numerator.
Interpret the bits as a signed number and divide by the signed
denominator d
. Trap when d
is zero or if the quotient is outside
the range of the output.
Return both quotient and remainder.
fn x86_umulx(self, argL: Value, argR: Value) -> (Value, Value)
Unsigned integer multiplication, producing a double-length result.
Polymorphic over all scalar integer types, but does not support vector types.
fn x86_smulx(self, argL: Value, argR: Value) -> (Value, Value)
Signed integer multiplication, producing a double-length result.
Polymorphic over all scalar integer types, but does not support vector types.
fn x86_cvtt2si(self, IntTo: Type, x: Value) -> Value
Convert with truncation floating point to signed integer.
The source floating point operand is converted to a signed integer by rounding towards zero. If the result can't be represented in the output type, returns the smallest signed value the output type can represent.
This instruction does not trap.
fn x86_fmin(self, x: Value, y: Value) -> Value
Floating point minimum with x86 semantics.
This is equivalent to the C ternary operator x < y ? x : y
which
differs from fmin
when either operand is NaN or when comparing
+0.0 to -0.0.
When the two operands don't compare as LT, y
is returned unchanged,
even if it is a signalling NaN.
fn x86_fmax(self, x: Value, y: Value) -> Value
Floating point maximum with x86 semantics.
This is equivalent to the C ternary operator x > y ? x : y
which
differs from fmax
when either operand is NaN or when comparing
+0.0 to -0.0.
When the two operands don't compare as GT, y
is returned unchanged,
even if it is a signalling NaN.
fn x86_push(self, x: Value) -> Inst
Pushes a value onto the stack.
Decrements the stack pointer and stores the specified value on to the top.
This is polymorphic in i32 and i64. However, it is only implemented for i64 in 64-bit mode, and only for i32 in 32-bit mode.
fn x86_pop(self, iWord: Type) -> Value
Pops a value from the stack.
Loads a value from the top of the stack and then increments the stack pointer.
This is polymorphic in i32 and i64. However, it is only implemented for i64 in 64-bit mode, and only for i32 in 32-bit mode.
fn x86_bsr(self, x: Value) -> (Value, Value)
Bit Scan Reverse -- returns the bit-index of the most significant 1 in the word. Result is undefined if the argument is zero. However, it sets the Z flag depending on the argument, so it is at least easy to detect and handle that case.
This is polymorphic in i32 and i64. It is implemented for both i64 and i32 in 64-bit mode, and only for i32 in 32-bit mode.
fn x86_bsf(self, x: Value) -> (Value, Value)
Bit Scan Forwards -- returns the bit-index of the least significant 1 in the word. Is otherwise identical to 'bsr', just above.
fn x86_pshufd<T1uimm8: Into<Uimm8>>(self, a: Value, i: T1uimm8) -> Value
Packed Shuffle Doublewords -- copies data from either memory or lanes in an extended register and re-orders the data according to the passed immediate byte.
fn x86_pshufb(self, a: Value, b: Value) -> Value
Packed Shuffle Bytes -- re-orders data in an extended register using a shuffle mask from either memory or another extended register
fn x86_pextr<T1uimm8: Into<Uimm8>>(self, x: Value, Idx: T1uimm8) -> Value
Extract lane Idx
from x
.
The lane index, Idx
, is an immediate value, not an SSA value. It
must indicate a valid lane index for the type of x
.
fn x86_pinsr<T1uimm8: Into<Uimm8>>(
self,
x: Value,
Idx: T1uimm8,
y: Value
) -> Value
self,
x: Value,
Idx: T1uimm8,
y: Value
) -> Value
Insert y
into x
at lane Idx
.
The lane index, Idx
, is an immediate value, not an SSA value. It
must indicate a valid lane index for the type of x
.
fn x86_insertps<T1uimm8: Into<Uimm8>>(
self,
x: Value,
Idx: T1uimm8,
y: Value
) -> Value
self,
x: Value,
Idx: T1uimm8,
y: Value
) -> Value
Insert a lane of y
into x
at using Idx
to encode both which lane the value is
extracted from and which it is inserted to. This is similar to x86_pinsr but inserts
floats, which are already stored in an XMM register.
fn x86_movsd(self, x: Value, y: Value) -> Value
Move the low 64 bits of the float vector y
to the low 64 bits of float vector x
fn x86_movlhps(self, x: Value, y: Value) -> Value
Move the low 64 bits of the float vector y
to the high 64 bits of float vector x
fn Unary(
self,
opcode: Opcode,
ctrl_typevar: Type,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
Unary(imms=(), vals=1)
fn UnaryImm(
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Imm64
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Imm64
) -> (Inst, &'f mut DataFlowGraph)
UnaryImm(imms=(imm: imm64), vals=0)
fn UnaryIeee32(
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Ieee32
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Ieee32
) -> (Inst, &'f mut DataFlowGraph)
UnaryIeee32(imms=(imm: ieee32), vals=0)
fn UnaryIeee64(
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Ieee64
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Ieee64
) -> (Inst, &'f mut DataFlowGraph)
UnaryIeee64(imms=(imm: ieee64), vals=0)
fn UnaryBool(
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: bool
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: bool
) -> (Inst, &'f mut DataFlowGraph)
UnaryBool(imms=(imm: boolean), vals=0)
fn UnaryConst(
self,
opcode: Opcode,
ctrl_typevar: Type,
constant_handle: Constant
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
constant_handle: Constant
) -> (Inst, &'f mut DataFlowGraph)
UnaryConst(imms=(constant_handle: poolConstant), vals=0)
fn UnaryGlobalValue(
self,
opcode: Opcode,
ctrl_typevar: Type,
global_value: GlobalValue
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
global_value: GlobalValue
) -> (Inst, &'f mut DataFlowGraph)
UnaryGlobalValue(imms=(global_value: global_value), vals=0)
fn Binary(
self,
opcode: Opcode,
ctrl_typevar: Type,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
Binary(imms=(), vals=2)
fn BinaryImm(
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Imm64,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Imm64,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
BinaryImm(imms=(imm: imm64), vals=1)
fn Ternary(
self,
opcode: Opcode,
ctrl_typevar: Type,
arg0: Value,
arg1: Value,
arg2: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
arg0: Value,
arg1: Value,
arg2: Value
) -> (Inst, &'f mut DataFlowGraph)
Ternary(imms=(), vals=3)
fn MultiAry(
self,
opcode: Opcode,
ctrl_typevar: Type,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
MultiAry(imms=(), vals=0)
fn NullAry(
self,
opcode: Opcode,
ctrl_typevar: Type
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type
) -> (Inst, &'f mut DataFlowGraph)
NullAry(imms=(), vals=0)
fn InsertLane(
self,
opcode: Opcode,
ctrl_typevar: Type,
lane: Uimm8,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
lane: Uimm8,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
InsertLane(imms=(lane: uimm8), vals=2)
fn ExtractLane(
self,
opcode: Opcode,
ctrl_typevar: Type,
lane: Uimm8,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
lane: Uimm8,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
ExtractLane(imms=(lane: uimm8), vals=1)
fn Shuffle(
self,
opcode: Opcode,
ctrl_typevar: Type,
mask: Immediate,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
mask: Immediate,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
Shuffle(imms=(mask: uimm128), vals=2)
fn IntCompare(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
IntCompare(imms=(cond: intcc), vals=2)
fn IntCompareImm(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
imm: Imm64,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
imm: Imm64,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
IntCompareImm(imms=(cond: intcc, imm: imm64), vals=1)
fn IntCond(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
IntCond(imms=(cond: intcc), vals=1)
fn FloatCompare(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
FloatCompare(imms=(cond: floatcc), vals=2)
fn FloatCond(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
FloatCond(imms=(cond: floatcc), vals=1)
fn IntSelect(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
arg0: Value,
arg1: Value,
arg2: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
arg0: Value,
arg1: Value,
arg2: Value
) -> (Inst, &'f mut DataFlowGraph)
IntSelect(imms=(cond: intcc), vals=3)
fn Jump(
self,
opcode: Opcode,
ctrl_typevar: Type,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
Jump(imms=(destination: ebb), vals=0)
fn Branch(
self,
opcode: Opcode,
ctrl_typevar: Type,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
Branch(imms=(destination: ebb), vals=1)
fn BranchInt(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
BranchInt(imms=(cond: intcc, destination: ebb), vals=1)
fn BranchFloat(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
BranchFloat(imms=(cond: floatcc, destination: ebb), vals=1)
fn BranchIcmp(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
destination: Ebb,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
BranchIcmp(imms=(cond: intcc, destination: ebb), vals=2)
fn BranchTable(
self,
opcode: Opcode,
ctrl_typevar: Type,
destination: Ebb,
table: JumpTable,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
destination: Ebb,
table: JumpTable,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
BranchTable(imms=(destination: ebb, table: jump_table), vals=1)
fn BranchTableEntry(
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Uimm8,
table: JumpTable,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
imm: Uimm8,
table: JumpTable,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
BranchTableEntry(imms=(imm: uimm8, table: jump_table), vals=2)
fn BranchTableBase(
self,
opcode: Opcode,
ctrl_typevar: Type,
table: JumpTable
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
table: JumpTable
) -> (Inst, &'f mut DataFlowGraph)
BranchTableBase(imms=(table: jump_table), vals=0)
fn IndirectJump(
self,
opcode: Opcode,
ctrl_typevar: Type,
table: JumpTable,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
table: JumpTable,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
IndirectJump(imms=(table: jump_table), vals=1)
fn Call(
self,
opcode: Opcode,
ctrl_typevar: Type,
func_ref: FuncRef,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
func_ref: FuncRef,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
Call(imms=(func_ref: func_ref), vals=0)
fn CallIndirect(
self,
opcode: Opcode,
ctrl_typevar: Type,
sig_ref: SigRef,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
sig_ref: SigRef,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
CallIndirect(imms=(sig_ref: sig_ref), vals=1)
fn FuncAddr(
self,
opcode: Opcode,
ctrl_typevar: Type,
func_ref: FuncRef
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
func_ref: FuncRef
) -> (Inst, &'f mut DataFlowGraph)
FuncAddr(imms=(func_ref: func_ref), vals=0)
fn Load(
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
Load(imms=(flags: memflags, offset: offset32), vals=1)
fn LoadComplex(
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
LoadComplex(imms=(flags: memflags, offset: offset32), vals=0)
fn Store(
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
arg0: Value,
arg1: Value
) -> (Inst, &'f mut DataFlowGraph)
Store(imms=(flags: memflags, offset: offset32), vals=2)
fn StoreComplex(
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
flags: MemFlags,
offset: Offset32,
args: ValueList
) -> (Inst, &'f mut DataFlowGraph)
StoreComplex(imms=(flags: memflags, offset: offset32), vals=1)
fn StackLoad(
self,
opcode: Opcode,
ctrl_typevar: Type,
stack_slot: StackSlot,
offset: Offset32
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
stack_slot: StackSlot,
offset: Offset32
) -> (Inst, &'f mut DataFlowGraph)
StackLoad(imms=(stack_slot: stack_slot, offset: offset32), vals=0)
fn StackStore(
self,
opcode: Opcode,
ctrl_typevar: Type,
stack_slot: StackSlot,
offset: Offset32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
stack_slot: StackSlot,
offset: Offset32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
StackStore(imms=(stack_slot: stack_slot, offset: offset32), vals=1)
fn HeapAddr(
self,
opcode: Opcode,
ctrl_typevar: Type,
heap: Heap,
imm: Uimm32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
heap: Heap,
imm: Uimm32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
HeapAddr(imms=(heap: heap, imm: uimm32), vals=1)
fn TableAddr(
self,
opcode: Opcode,
ctrl_typevar: Type,
table: Table,
offset: Offset32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
table: Table,
offset: Offset32,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
TableAddr(imms=(table: table, offset: offset32), vals=1)
fn RegMove(
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit,
dst: RegUnit,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit,
dst: RegUnit,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
RegMove(imms=(src: regunit, dst: regunit), vals=1)
fn CopySpecial(
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit,
dst: RegUnit
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit,
dst: RegUnit
) -> (Inst, &'f mut DataFlowGraph)
CopySpecial(imms=(src: regunit, dst: regunit), vals=0)
fn CopyToSsa(
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit
) -> (Inst, &'f mut DataFlowGraph)
CopyToSsa(imms=(src: regunit), vals=0)
fn RegSpill(
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit,
dst: StackSlot,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
src: RegUnit,
dst: StackSlot,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
RegSpill(imms=(src: regunit, dst: stack_slot), vals=1)
fn RegFill(
self,
opcode: Opcode,
ctrl_typevar: Type,
src: StackSlot,
dst: RegUnit,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
src: StackSlot,
dst: RegUnit,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
RegFill(imms=(src: stack_slot, dst: regunit), vals=1)
fn Trap(
self,
opcode: Opcode,
ctrl_typevar: Type,
code: TrapCode
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
code: TrapCode
) -> (Inst, &'f mut DataFlowGraph)
Trap(imms=(code: trapcode), vals=0)
fn CondTrap(
self,
opcode: Opcode,
ctrl_typevar: Type,
code: TrapCode,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
code: TrapCode,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
CondTrap(imms=(code: trapcode), vals=1)
fn IntCondTrap(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
code: TrapCode,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: IntCC,
code: TrapCode,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
IntCondTrap(imms=(cond: intcc, code: trapcode), vals=1)
fn FloatCondTrap(
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
code: TrapCode,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
self,
opcode: Opcode,
ctrl_typevar: Type,
cond: FloatCC,
code: TrapCode,
arg0: Value
) -> (Inst, &'f mut DataFlowGraph)
FloatCondTrap(imms=(cond: floatcc, code: trapcode), vals=1)
Implementors
impl<'f, T: InstBuilderBase<'f>> InstBuilder<'f> for T
[src]
Any type implementing InstBuilderBase
gets all the InstBuilder
methods for free.