Struct cranelift_codegen::ir::InsertBuilder

source ·
pub struct InsertBuilder<'f, IIB: InstInserterBase<'f>> { /* private fields */ }
Expand description

Builder that inserts an instruction at the current position.

An InsertBuilder is a wrapper for an InstInserterBase that turns it into an instruction builder with some additional facilities for creating instructions that reuse existing values as their results.

Implementations§

source§

impl<'f, IIB: InstInserterBase<'f>> InsertBuilder<'f, IIB>

source

pub fn new(inserter: IIB) -> Self

Create a new builder which inserts instructions at pos. The dfg and pos.layout references should be from the same Function.

source

pub fn with_results<Array>( self, reuse: Array, ) -> InsertReuseBuilder<'f, IIB, Array>
where Array: AsRef<[Option<Value>]>,

Reuse result values in reuse.

Convert this builder into one that will reuse the provided result values instead of allocating new ones. The provided values for reuse must not be attached to anything. Any missing result values will be allocated as normal.

The reuse argument is expected to be an array of Option<Value>.

source

pub fn with_result( self, v: Value, ) -> InsertReuseBuilder<'f, IIB, [Option<Value>; 1]>

Reuse a single result value.

Convert this into a builder that will reuse v as the single result value. The reused result value v must not be attached to anything.

This method should only be used when building an instruction with exactly one result. Use with_results() for the more general case.

Trait Implementations§

source§

impl<'f, IIB: InstInserterBase<'f>> InstBuilderBase<'f> for InsertBuilder<'f, IIB>

source§

fn data_flow_graph(&self) -> &DataFlowGraph

Get an immutable reference to the data flow graph that will hold the constructed instructions.
source§

fn data_flow_graph_mut(&mut self) -> &mut DataFlowGraph

Get a mutable reference to the data flow graph that will hold the constructed instructions.
source§

fn build( self, data: InstructionData, ctrl_typevar: Type, ) -> (Inst, &'f mut DataFlowGraph)

Insert an instruction and return a reference to it, consuming the builder. Read more

Auto Trait Implementations§

§

impl<'f, IIB> Freeze for InsertBuilder<'f, IIB>
where IIB: Freeze,

§

impl<'f, IIB> RefUnwindSafe for InsertBuilder<'f, IIB>
where IIB: RefUnwindSafe,

§

impl<'f, IIB> Send for InsertBuilder<'f, IIB>
where IIB: Send,

§

impl<'f, IIB> Sync for InsertBuilder<'f, IIB>
where IIB: Sync,

§

impl<'f, IIB> Unpin for InsertBuilder<'f, IIB>
where IIB: Unpin,

§

impl<'f, IIB> UnwindSafe for InsertBuilder<'f, IIB>
where IIB: UnwindSafe,

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'f, T> InstBuilder<'f> for T
where T: InstBuilderBase<'f>,

source§

fn jump(self, block_call_label: Block, block_call_args: &[Value]) -> Inst

Jump. Read more
source§

fn brif( self, c: Value, block_then_label: Block, block_then_args: &[Value], block_else_label: Block, block_else_args: &[Value], ) -> Inst

Conditional branch when cond is non-zero. Read more
source§

fn br_table(self, x: Value, JT: JumpTable) -> Inst

Indirect branch via jump table. Read more
source§

fn debugtrap(self) -> Inst

Encodes an assembly debug trap.
source§

fn trap<T1: Into<TrapCode>>(self, code: T1) -> Inst

Terminate execution unconditionally. Read more
source§

fn trapz<T1: Into<TrapCode>>(self, c: Value, code: T1) -> Inst

Trap when zero. Read more
source§

fn resumable_trap<T1: Into<TrapCode>>(self, code: T1) -> Inst

A resumable trap. Read more
source§

fn trapnz<T1: Into<TrapCode>>(self, c: Value, code: T1) -> Inst

Trap when non-zero. Read more
source§

fn resumable_trapnz<T1: Into<TrapCode>>(self, c: Value, code: T1) -> Inst

A resumable trap to be called when the passed condition is non-zero. Read more
source§

fn return_(self, rvals: &[Value]) -> Inst

Return from the function. Read more
source§

fn call(self, FN: FuncRef, args: &[Value]) -> Inst

Direct function call. Read more
source§

fn call_indirect(self, SIG: SigRef, callee: Value, args: &[Value]) -> Inst

Indirect function call. Read more
source§

fn return_call(self, FN: FuncRef, args: &[Value]) -> Inst

Direct tail call. Read more
source§

fn return_call_indirect( self, SIG: SigRef, callee: Value, args: &[Value], ) -> Inst

Indirect tail call. Read more
source§

fn func_addr(self, iAddr: Type, FN: FuncRef) -> Value

Get the address of a function. Read more
source§

fn splat(self, TxN: Type, x: Value) -> Value

Vector splat. Read more
source§

fn swizzle(self, x: Value, y: Value) -> Value

Vector swizzle. Read more
source§

fn x86_pshufb(self, x: Value, y: Value) -> Value

A vector swizzle lookalike which has the semantics of pshufb on x64. Read more
source§

fn insertlane<T1: Into<Uimm8>>(self, x: Value, y: Value, Idx: T1) -> Value

Insert y as lane Idx in x. Read more
source§

fn extractlane<T1: Into<Uimm8>>(self, x: Value, Idx: T1) -> Value

Extract lane Idx from x. Read more
source§

fn smin(self, x: Value, y: Value) -> Value

Signed integer minimum. Read more
source§

fn umin(self, x: Value, y: Value) -> Value

Unsigned integer minimum. Read more
source§

fn smax(self, x: Value, y: Value) -> Value

Signed integer maximum. Read more
source§

fn umax(self, x: Value, y: Value) -> Value

Unsigned integer maximum. Read more
source§

fn avg_round(self, x: Value, y: Value) -> Value

Unsigned average with rounding: a := (x + y + 1) // 2 Read more
source§

fn uadd_sat(self, x: Value, y: Value) -> Value

Add with unsigned saturation. Read more
source§

fn sadd_sat(self, x: Value, y: Value) -> Value

Add with signed saturation. Read more
source§

fn usub_sat(self, x: Value, y: Value) -> Value

Subtract with unsigned saturation. Read more
source§

fn ssub_sat(self, x: Value, y: Value) -> Value

Subtract with signed saturation. Read more
source§

fn load<T1: Into<MemFlags>, T2: Into<Offset32>>( self, Mem: Type, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load from memory at p + Offset. Read more
source§

fn store<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, x: Value, p: Value, Offset: T2, ) -> Inst

Store x to memory at p + Offset. Read more
source§

fn uload8<T1: Into<MemFlags>, T2: Into<Offset32>>( self, iExt8: Type, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load 8 bits from memory at p + Offset and zero-extend. Read more
source§

fn sload8<T1: Into<MemFlags>, T2: Into<Offset32>>( self, iExt8: Type, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load 8 bits from memory at p + Offset and sign-extend. Read more
source§

fn istore8<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, x: Value, p: Value, Offset: T2, ) -> Inst

Store the low 8 bits of x to memory at p + Offset. Read more
source§

fn uload16<T1: Into<MemFlags>, T2: Into<Offset32>>( self, iExt16: Type, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load 16 bits from memory at p + Offset and zero-extend. Read more
source§

fn sload16<T1: Into<MemFlags>, T2: Into<Offset32>>( self, iExt16: Type, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load 16 bits from memory at p + Offset and sign-extend. Read more
source§

fn istore16<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, x: Value, p: Value, Offset: T2, ) -> Inst

Store the low 16 bits of x to memory at p + Offset. Read more
source§

fn uload32<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load 32 bits from memory at p + Offset and zero-extend. Read more
source§

fn sload32<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load 32 bits from memory at p + Offset and sign-extend. Read more
source§

fn istore32<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, x: Value, p: Value, Offset: T2, ) -> Inst

Store the low 32 bits of x to memory at p + Offset. Read more
source§

fn uload8x8<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load an 8x8 vector (64 bits) from memory at p + Offset and zero-extend into an i16x8 vector. Read more
source§

fn sload8x8<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load an 8x8 vector (64 bits) from memory at p + Offset and sign-extend into an i16x8 vector. Read more
source§

fn uload16x4<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load a 16x4 vector (64 bits) from memory at p + Offset and zero-extend into an i32x4 vector. Read more
source§

fn sload16x4<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load a 16x4 vector (64 bits) from memory at p + Offset and sign-extend into an i32x4 vector. Read more
source§

fn uload32x2<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load an 32x2 vector (64 bits) from memory at p + Offset and zero-extend into an i64x2 vector. Read more
source§

fn sload32x2<T1: Into<MemFlags>, T2: Into<Offset32>>( self, MemFlags: T1, p: Value, Offset: T2, ) -> Value

Load a 32x2 vector (64 bits) from memory at p + Offset and sign-extend into an i64x2 vector. Read more
source§

fn stack_load<T1: Into<Offset32>>( self, Mem: Type, SS: StackSlot, Offset: T1, ) -> Value

Load a value from a stack slot at the constant offset. Read more
source§

fn stack_store<T1: Into<Offset32>>( self, x: Value, SS: StackSlot, Offset: T1, ) -> Inst

Store a value to a stack slot at a constant offset. Read more
source§

fn stack_addr<T1: Into<Offset32>>( self, iAddr: Type, SS: StackSlot, Offset: T1, ) -> Value

Get the address of a stack slot. Read more
source§

fn dynamic_stack_load(self, Mem: Type, DSS: DynamicStackSlot) -> Value

Load a value from a dynamic stack slot. Read more
source§

fn dynamic_stack_store(self, x: Value, DSS: DynamicStackSlot) -> Inst

Store a value to a dynamic stack slot. Read more
source§

fn dynamic_stack_addr(self, iAddr: Type, DSS: DynamicStackSlot) -> Value

Get the address of a dynamic stack slot. Read more
source§

fn global_value(self, Mem: Type, GV: GlobalValue) -> Value

Compute the value of global GV. Read more
source§

fn symbol_value(self, Mem: Type, GV: GlobalValue) -> Value

Compute the value of global GV, which is a symbolic value. Read more
source§

fn tls_value(self, Mem: Type, GV: GlobalValue) -> Value

Compute the value of global GV, which is a TLS (thread local storage) value. Read more
source§

fn get_pinned_reg(self, iAddr: Type) -> Value

Gets the content of the pinned register, when it’s enabled. Read more
source§

fn set_pinned_reg(self, addr: Value) -> Inst

Sets the content of the pinned register, when it’s enabled. Read more
source§

fn get_frame_pointer(self, iAddr: Type) -> Value

Get the address in the frame pointer register. Read more
source§

fn get_stack_pointer(self, iAddr: Type) -> Value

Get the address in the stack pointer register. Read more
source§

fn get_return_address(self, iAddr: Type) -> Value

Get the PC where this function will transfer control to when it returns. Read more
source§

fn table_addr<T1: Into<Offset32>>( self, iAddr: Type, T: Table, p: Value, Offset: T1, ) -> Value

Bounds check and compute absolute address of a table entry. Read more
source§

fn iconst<T1: Into<Imm64>>(self, NarrowInt: Type, N: T1) -> Value

Integer constant. Read more
source§

fn f32const<T1: Into<Ieee32>>(self, N: T1) -> Value

Floating point constant. Read more
source§

fn f64const<T1: Into<Ieee64>>(self, N: T1) -> Value

Floating point constant. Read more
source§

fn vconst<T1: Into<Constant>>(self, TxN: Type, N: T1) -> Value

SIMD vector constant. Read more
source§

fn shuffle<T1: Into<Immediate>>(self, a: Value, b: Value, mask: T1) -> Value

SIMD vector shuffle. Read more
source§

fn null(self, Ref: Type) -> Value

Null constant value for reference types. Read more
source§

fn nop(self) -> Inst

Just a dummy instruction. Read more
source§

fn select(self, c: Value, x: Value, y: Value) -> Value

Conditional select. Read more
source§

fn select_spectre_guard(self, c: Value, x: Value, y: Value) -> Value

Conditional select intended for Spectre guards. Read more
source§

fn bitselect(self, c: Value, x: Value, y: Value) -> Value

Conditional select of bits. Read more
source§

fn x86_blendv(self, c: Value, x: Value, y: Value) -> Value

A bitselect-lookalike instruction except with the semantics of blendv-related instructions on x86. Read more
source§

fn vany_true(self, a: Value) -> Value

Reduce a vector to a scalar boolean. Read more
source§

fn vall_true(self, a: Value) -> Value

Reduce a vector to a scalar boolean. Read more
source§

fn vhigh_bits(self, Int: Type, a: Value) -> Value

Reduce a vector to a scalar integer. Read more
source§

fn icmp<T1: Into<IntCC>>(self, Cond: T1, x: Value, y: Value) -> Value

Integer comparison. Read more
source§

fn icmp_imm<T1: Into<IntCC>, T2: Into<Imm64>>( self, Cond: T1, x: Value, Y: T2, ) -> Value

Compare scalar integer to a constant. Read more
source§

fn iadd(self, x: Value, y: Value) -> Value

Wrapping integer addition: a := x + y \pmod{2^B}. Read more
source§

fn isub(self, x: Value, y: Value) -> Value

Wrapping integer subtraction: a := x - y \pmod{2^B}. Read more
source§

fn ineg(self, x: Value) -> Value

Integer negation: a := -x \pmod{2^B}. Read more
source§

fn iabs(self, x: Value) -> Value

Integer absolute value with wrapping: a := |x|. Read more
source§

fn imul(self, x: Value, y: Value) -> Value

Wrapping integer multiplication: a := x y \pmod{2^B}. Read more
source§

fn umulhi(self, x: Value, y: Value) -> Value

Unsigned integer multiplication, producing the high half of a double-length result. Read more
source§

fn smulhi(self, x: Value, y: Value) -> Value

Signed integer multiplication, producing the high half of a double-length result. Read more
source§

fn sqmul_round_sat(self, x: Value, y: Value) -> Value

Fixed-point multiplication of numbers in the QN format, where N + 1 is the number bitwidth: a := signed_saturate((x * y + 1 << (Q - 1)) >> Q) Read more
source§

fn x86_pmulhrsw(self, x: Value, y: Value) -> Value

A similar instruction to sqmul_round_sat except with the semantics of x86’s pmulhrsw instruction. Read more
source§

fn udiv(self, x: Value, y: Value) -> Value

Unsigned integer division: a := \lfloor {x \over y} \rfloor. Read more
source§

fn sdiv(self, x: Value, y: Value) -> Value

Signed integer division rounded toward zero: a := sign(xy) \lfloor {|x| \over |y|}\rfloor. Read more
source§

fn urem(self, x: Value, y: Value) -> Value

Unsigned integer remainder. Read more
source§

fn srem(self, x: Value, y: Value) -> Value

Signed integer remainder. The result has the sign of the dividend. Read more
source§

fn iadd_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Add immediate integer. Read more
source§

fn imul_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Integer multiplication by immediate constant. Read more
source§

fn udiv_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Unsigned integer division by an immediate constant. Read more
source§

fn sdiv_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Signed integer division by an immediate constant. Read more
source§

fn urem_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Unsigned integer remainder with immediate divisor. Read more
source§

fn srem_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Signed integer remainder with immediate divisor. Read more
source§

fn irsub_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Immediate reverse wrapping subtraction: a := Y - x \pmod{2^B}. Read more
source§

fn iadd_cin(self, x: Value, y: Value, c_in: Value) -> Value

Add integers with carry in. Read more
source§

fn iadd_cout(self, x: Value, y: Value) -> (Value, Value)

Add integers with carry out. Read more
source§

fn iadd_carry(self, x: Value, y: Value, c_in: Value) -> (Value, Value)

Add integers with carry in and out. Read more
source§

fn uadd_overflow_trap<T1: Into<TrapCode>>( self, x: Value, y: Value, code: T1, ) -> Value

Unsigned addition of x and y, trapping if the result overflows. Read more
source§

fn isub_bin(self, x: Value, y: Value, b_in: Value) -> Value

Subtract integers with borrow in. Read more
source§

fn isub_bout(self, x: Value, y: Value) -> (Value, Value)

Subtract integers with borrow out. Read more
source§

fn isub_borrow(self, x: Value, y: Value, b_in: Value) -> (Value, Value)

Subtract integers with borrow in and out. Read more
source§

fn band(self, x: Value, y: Value) -> Value

Bitwise and. Read more
source§

fn bor(self, x: Value, y: Value) -> Value

Bitwise or. Read more
source§

fn bxor(self, x: Value, y: Value) -> Value

Bitwise xor. Read more
source§

fn bnot(self, x: Value) -> Value

Bitwise not. Read more
source§

fn band_not(self, x: Value, y: Value) -> Value

Bitwise and not. Read more
source§

fn bor_not(self, x: Value, y: Value) -> Value

Bitwise or not. Read more
source§

fn bxor_not(self, x: Value, y: Value) -> Value

Bitwise xor not. Read more
source§

fn band_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Bitwise and with immediate. Read more
source§

fn bor_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Bitwise or with immediate. Read more
source§

fn bxor_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Bitwise xor with immediate. Read more
source§

fn rotl(self, x: Value, y: Value) -> Value

Rotate left. Read more
source§

fn rotr(self, x: Value, y: Value) -> Value

Rotate right. Read more
source§

fn rotl_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Rotate left by immediate. Read more
source§

fn rotr_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Rotate right by immediate. Read more
source§

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. Read more
source§

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. Read more
source§

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. Read more
source§

fn ishl_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Integer shift left by immediate. Read more
source§

fn ushr_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Unsigned shift right by immediate. Read more
source§

fn sshr_imm<T1: Into<Imm64>>(self, x: Value, Y: T1) -> Value

Signed shift right by immediate. Read more
source§

fn bitrev(self, x: Value) -> Value

Reverse the bits of a integer. Read more
source§

fn clz(self, x: Value) -> Value

Count leading zero bits. Read more
source§

fn cls(self, x: Value) -> Value

Count leading sign bits. Read more
source§

fn ctz(self, x: Value) -> Value

Count trailing zeros. Read more
source§

fn bswap(self, x: Value) -> Value

Reverse the byte order of an integer. Read more
source§

fn popcnt(self, x: Value) -> Value

Population count Read more
source§

fn fcmp<T1: Into<FloatCC>>(self, Cond: T1, x: Value, y: Value) -> Value

Floating point comparison. Read more
source§

fn fadd(self, x: Value, y: Value) -> Value

Floating point addition. Read more
source§

fn fsub(self, x: Value, y: Value) -> Value

Floating point subtraction. Read more
source§

fn fmul(self, x: Value, y: Value) -> Value

Floating point multiplication. Read more
source§

fn fdiv(self, x: Value, y: Value) -> Value

Floating point division. Read more
source§

fn sqrt(self, x: Value) -> Value

Floating point square root. Read more
source§

fn fma(self, x: Value, y: Value, z: Value) -> Value

Floating point fused multiply-and-add. Read more
source§

fn fneg(self, x: Value) -> Value

Floating point negation. Read more
source§

fn fabs(self, x: Value) -> Value

Floating point absolute value. Read more
source§

fn fcopysign(self, x: Value, y: Value) -> Value

Floating point copy sign. Read more
source§

fn fmin(self, x: Value, y: Value) -> Value

Floating point minimum, propagating NaNs using the WebAssembly rules. Read more
source§

fn fmin_pseudo(self, x: Value, y: Value) -> Value

Floating point pseudo-minimum, propagating NaNs. This behaves differently from fmin. See https://github.com/WebAssembly/simd/pull/122 for background. Read more
source§

fn fmax(self, x: Value, y: Value) -> Value

Floating point maximum, propagating NaNs using the WebAssembly rules. Read more
source§

fn fmax_pseudo(self, x: Value, y: Value) -> Value

Floating point pseudo-maximum, propagating NaNs. This behaves differently from fmax. See https://github.com/WebAssembly/simd/pull/122 for background. Read more
source§

fn ceil(self, x: Value) -> Value

Round floating point round to integral, towards positive infinity. Read more
source§

fn floor(self, x: Value) -> Value

Round floating point round to integral, towards negative infinity. Read more
source§

fn trunc(self, x: Value) -> Value

Round floating point round to integral, towards zero. Read more
source§

fn nearest(self, x: Value) -> Value

Round floating point round to integral, towards nearest with ties to even. Read more
source§

fn is_null(self, x: Value) -> Value

Reference verification. Read more
source§

fn is_invalid(self, x: Value) -> Value

Reference verification. Read more
source§

fn bitcast<T1: Into<MemFlags>>( self, MemTo: Type, MemFlags: T1, x: Value, ) -> Value

Reinterpret the bits in x as a different type. Read more
source§

fn scalar_to_vector(self, TxN: Type, s: Value) -> Value

Copies a scalar value to a vector value. The scalar is copied into the least significant lane of the vector, and all other lanes will be zero. Read more
source§

fn bmask(self, IntTo: Type, x: Value) -> Value

Convert x to an integer mask. Read more
source§

fn ireduce(self, Int: Type, x: Value) -> Value

Convert x to a smaller integer type by discarding the most significant bits. Read more
source§

fn snarrow(self, x: Value, y: Value) -> Value

Combine x and y into a vector with twice the lanes but half the integer width while saturating overflowing values to the signed maximum and minimum. Read more
source§

fn unarrow(self, x: Value, y: Value) -> Value

Combine x and y into a vector with twice the lanes but half the integer width while saturating overflowing values to the unsigned maximum and minimum. Read more
source§

fn uunarrow(self, x: Value, y: Value) -> Value

Combine x and y into a vector with twice the lanes but half the integer width while saturating overflowing values to the unsigned maximum and minimum. Read more
source§

fn swiden_low(self, x: Value) -> Value

Widen the low lanes of x using signed extension. Read more
source§

fn swiden_high(self, x: Value) -> Value

Widen the high lanes of x using signed extension. Read more
source§

fn uwiden_low(self, x: Value) -> Value

Widen the low lanes of x using unsigned extension. Read more
source§

fn uwiden_high(self, x: Value) -> Value

Widen the high lanes of x using unsigned extension. Read more
source§

fn iadd_pairwise(self, x: Value, y: Value) -> Value

Does lane-wise integer pairwise addition on two operands, putting the combined results into a single vector result. Here a pair refers to adjacent lanes in a vector, i.e. i2 + (i2+1) for i == num_lanes/2. The first operand pairwise add results will make up the low half of the resulting vector while the second operand pairwise add results will make up the upper half of the resulting vector. Read more
source§

fn x86_pmaddubsw(self, x: Value, y: Value) -> Value

An instruction with equivalent semantics to pmaddubsw on x86. Read more
source§

fn uextend(self, Int: Type, x: Value) -> Value

Convert x to a larger integer type by zero-extending. Read more
source§

fn sextend(self, Int: Type, x: Value) -> Value

Convert x to a larger integer type by sign-extending. Read more
source§

fn fpromote(self, FloatScalar: Type, x: Value) -> Value

Convert x to a larger floating point format. Read more
source§

fn fdemote(self, FloatScalar: Type, x: Value) -> Value

Convert x to a smaller floating point format. Read more
source§

fn fvdemote(self, x: Value) -> Value

Convert x to a smaller floating point format. Read more
source§

fn fvpromote_low(self, a: Value) -> Value

Converts packed single precision floating point to packed double precision floating point. Read more
source§

fn fcvt_to_uint(self, IntTo: Type, x: Value) -> Value

Converts floating point scalars to unsigned integer. Read more
source§

fn fcvt_to_sint(self, IntTo: Type, x: Value) -> Value

Converts floating point scalars to signed integer. Read more
source§

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. Read more
source§

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. Read more
source§

fn x86_cvtt2dq(self, IntTo: Type, x: Value) -> Value

A float-to-integer conversion instruction for vectors-of-floats which has the same semantics as cvttp{s,d}2dq on x86. This specifically returns INT_MIN for NaN or out-of-bounds lanes. Read more
source§

fn fcvt_from_uint(self, FloatTo: Type, x: Value) -> Value

Convert unsigned integer to floating point. Read more
source§

fn fcvt_from_sint(self, FloatTo: Type, x: Value) -> Value

Convert signed integer to floating point. Read more
source§

fn fcvt_low_from_sint(self, FloatTo: Type, x: Value) -> Value

Converts packed signed 32-bit integers to packed double precision floating point. Read more
source§

fn isplit(self, x: Value) -> (Value, Value)

Split an integer into low and high parts. Read more
source§

fn iconcat(self, lo: Value, hi: Value) -> Value

Concatenate low and high bits to form a larger integer type. Read more
source§

fn atomic_rmw<T1: Into<MemFlags>, T2: Into<AtomicRmwOp>>( self, AtomicMem: Type, MemFlags: T1, AtomicRmwOp: T2, p: Value, x: Value, ) -> Value

Atomically read-modify-write memory at p, with second operand x. The old value is returned. p has the type of the target word size, and x may be an integer type of 8, 16, 32 or 64 bits, even on a 32-bit target. The type of the returned value is the same as the type of x. This operation is sequentially consistent and creates happens-before edges that order normal (non-atomic) loads and stores. Read more
source§

fn atomic_cas<T1: Into<MemFlags>>( self, MemFlags: T1, p: Value, e: Value, x: Value, ) -> Value

Perform an atomic compare-and-swap operation on memory at p, with expected value e, storing x if the value at p equals e. The old value at p is returned, regardless of whether the operation succeeds or fails. p has the type of the target word size, and x and e must have the same type and the same size, which may be an integer type of 8, 16, 32 or 64 bits, even on a 32-bit target. The type of the returned value is the same as the type of x and e. This operation is sequentially consistent and creates happens-before edges that order normal (non-atomic) loads and stores. Read more
source§

fn atomic_load<T1: Into<MemFlags>>( self, AtomicMem: Type, MemFlags: T1, p: Value, ) -> Value

Atomically load from memory at p. Read more
source§

fn atomic_store<T1: Into<MemFlags>>( self, MemFlags: T1, x: Value, p: Value, ) -> Inst

Atomically store x to memory at p. Read more
source§

fn fence(self) -> Inst

A memory fence. This must provide ordering to ensure that, at a minimum, neither loads nor stores of any kind may move forwards or backwards across the fence. This operation is sequentially consistent.
source§

fn extract_vector<T1: Into<Uimm8>>(self, x: Value, y: T1) -> Value

Return a fixed length sub vector, extracted from a dynamic vector. Read more
source§

fn AtomicCas( self, opcode: Opcode, ctrl_typevar: Type, flags: MemFlags, arg0: Value, arg1: Value, arg2: Value, ) -> (Inst, &'f mut DataFlowGraph)

AtomicCas(imms=(flags: ir::MemFlags), vals=3, blocks=0)
source§

fn AtomicRmw( self, opcode: Opcode, ctrl_typevar: Type, flags: MemFlags, op: AtomicRmwOp, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

AtomicRmw(imms=(flags: ir::MemFlags, op: ir::AtomicRmwOp), vals=2, blocks=0)
source§

fn Binary( self, opcode: Opcode, ctrl_typevar: Type, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

Binary(imms=(), vals=2, blocks=0)
source§

fn BinaryImm64( self, opcode: Opcode, ctrl_typevar: Type, imm: Imm64, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

BinaryImm64(imms=(imm: ir::immediates::Imm64), vals=1, blocks=0)
source§

fn BinaryImm8( self, opcode: Opcode, ctrl_typevar: Type, imm: Uimm8, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

BinaryImm8(imms=(imm: ir::immediates::Uimm8), vals=1, blocks=0)
source§

fn BranchTable( self, opcode: Opcode, ctrl_typevar: Type, table: JumpTable, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

BranchTable(imms=(table: ir::JumpTable), vals=1, blocks=0)
source§

fn Brif( self, opcode: Opcode, ctrl_typevar: Type, block0: BlockCall, block1: BlockCall, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

Brif(imms=(), vals=1, blocks=2)
source§

fn Call( self, opcode: Opcode, ctrl_typevar: Type, func_ref: FuncRef, args: ValueList, ) -> (Inst, &'f mut DataFlowGraph)

Call(imms=(func_ref: ir::FuncRef), vals=0, blocks=0)
source§

fn CallIndirect( self, opcode: Opcode, ctrl_typevar: Type, sig_ref: SigRef, args: ValueList, ) -> (Inst, &'f mut DataFlowGraph)

CallIndirect(imms=(sig_ref: ir::SigRef), vals=1, blocks=0)
source§

fn CondTrap( self, opcode: Opcode, ctrl_typevar: Type, code: TrapCode, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

CondTrap(imms=(code: ir::TrapCode), vals=1, blocks=0)
source§

fn DynamicStackLoad( self, opcode: Opcode, ctrl_typevar: Type, dynamic_stack_slot: DynamicStackSlot, ) -> (Inst, &'f mut DataFlowGraph)

DynamicStackLoad(imms=(dynamic_stack_slot: ir::DynamicStackSlot), vals=0, blocks=0)
source§

fn DynamicStackStore( self, opcode: Opcode, ctrl_typevar: Type, dynamic_stack_slot: DynamicStackSlot, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

DynamicStackStore(imms=(dynamic_stack_slot: ir::DynamicStackSlot), vals=1, blocks=0)
source§

fn FloatCompare( self, opcode: Opcode, ctrl_typevar: Type, cond: FloatCC, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

FloatCompare(imms=(cond: ir::condcodes::FloatCC), vals=2, blocks=0)
source§

fn FuncAddr( self, opcode: Opcode, ctrl_typevar: Type, func_ref: FuncRef, ) -> (Inst, &'f mut DataFlowGraph)

FuncAddr(imms=(func_ref: ir::FuncRef), vals=0, blocks=0)
source§

fn IntAddTrap( self, opcode: Opcode, ctrl_typevar: Type, code: TrapCode, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

IntAddTrap(imms=(code: ir::TrapCode), vals=2, blocks=0)
source§

fn IntCompare( self, opcode: Opcode, ctrl_typevar: Type, cond: IntCC, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

IntCompare(imms=(cond: ir::condcodes::IntCC), vals=2, blocks=0)
source§

fn IntCompareImm( self, opcode: Opcode, ctrl_typevar: Type, cond: IntCC, imm: Imm64, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

IntCompareImm(imms=(cond: ir::condcodes::IntCC, imm: ir::immediates::Imm64), vals=1, blocks=0)
source§

fn Jump( self, opcode: Opcode, ctrl_typevar: Type, block0: BlockCall, ) -> (Inst, &'f mut DataFlowGraph)

Jump(imms=(), vals=0, blocks=1)
source§

fn Load( self, opcode: Opcode, ctrl_typevar: Type, flags: MemFlags, offset: Offset32, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

Load(imms=(flags: ir::MemFlags, offset: ir::immediates::Offset32), vals=1, blocks=0)
source§

fn LoadNoOffset( self, opcode: Opcode, ctrl_typevar: Type, flags: MemFlags, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

LoadNoOffset(imms=(flags: ir::MemFlags), vals=1, blocks=0)
source§

fn MultiAry( self, opcode: Opcode, ctrl_typevar: Type, args: ValueList, ) -> (Inst, &'f mut DataFlowGraph)

MultiAry(imms=(), vals=0, blocks=0)
source§

fn NullAry( self, opcode: Opcode, ctrl_typevar: Type, ) -> (Inst, &'f mut DataFlowGraph)

NullAry(imms=(), vals=0, blocks=0)
source§

fn Shuffle( self, opcode: Opcode, ctrl_typevar: Type, imm: Immediate, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

Shuffle(imms=(imm: ir::Immediate), vals=2, blocks=0)
source§

fn StackLoad( self, opcode: Opcode, ctrl_typevar: Type, stack_slot: StackSlot, offset: Offset32, ) -> (Inst, &'f mut DataFlowGraph)

StackLoad(imms=(stack_slot: ir::StackSlot, offset: ir::immediates::Offset32), vals=0, blocks=0)
source§

fn StackStore( self, opcode: Opcode, ctrl_typevar: Type, stack_slot: StackSlot, offset: Offset32, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

StackStore(imms=(stack_slot: ir::StackSlot, offset: ir::immediates::Offset32), vals=1, blocks=0)
source§

fn Store( self, opcode: Opcode, ctrl_typevar: Type, flags: MemFlags, offset: Offset32, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

Store(imms=(flags: ir::MemFlags, offset: ir::immediates::Offset32), vals=2, blocks=0)
source§

fn StoreNoOffset( self, opcode: Opcode, ctrl_typevar: Type, flags: MemFlags, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

StoreNoOffset(imms=(flags: ir::MemFlags), vals=2, blocks=0)
source§

fn TableAddr( self, opcode: Opcode, ctrl_typevar: Type, table: Table, offset: Offset32, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

TableAddr(imms=(table: ir::Table, offset: ir::immediates::Offset32), vals=1, blocks=0)
source§

fn Ternary( self, opcode: Opcode, ctrl_typevar: Type, arg0: Value, arg1: Value, arg2: Value, ) -> (Inst, &'f mut DataFlowGraph)

Ternary(imms=(), vals=3, blocks=0)
source§

fn TernaryImm8( self, opcode: Opcode, ctrl_typevar: Type, imm: Uimm8, arg0: Value, arg1: Value, ) -> (Inst, &'f mut DataFlowGraph)

TernaryImm8(imms=(imm: ir::immediates::Uimm8), vals=2, blocks=0)
source§

fn Trap( self, opcode: Opcode, ctrl_typevar: Type, code: TrapCode, ) -> (Inst, &'f mut DataFlowGraph)

Trap(imms=(code: ir::TrapCode), vals=0, blocks=0)
source§

fn Unary( self, opcode: Opcode, ctrl_typevar: Type, arg0: Value, ) -> (Inst, &'f mut DataFlowGraph)

Unary(imms=(), vals=1, blocks=0)
source§

fn UnaryConst( self, opcode: Opcode, ctrl_typevar: Type, constant_handle: Constant, ) -> (Inst, &'f mut DataFlowGraph)

UnaryConst(imms=(constant_handle: ir::Constant), vals=0, blocks=0)
source§

fn UnaryGlobalValue( self, opcode: Opcode, ctrl_typevar: Type, global_value: GlobalValue, ) -> (Inst, &'f mut DataFlowGraph)

UnaryGlobalValue(imms=(global_value: ir::GlobalValue), vals=0, blocks=0)
source§

fn UnaryIeee32( self, opcode: Opcode, ctrl_typevar: Type, imm: Ieee32, ) -> (Inst, &'f mut DataFlowGraph)

UnaryIeee32(imms=(imm: ir::immediates::Ieee32), vals=0, blocks=0)
source§

fn UnaryIeee64( self, opcode: Opcode, ctrl_typevar: Type, imm: Ieee64, ) -> (Inst, &'f mut DataFlowGraph)

UnaryIeee64(imms=(imm: ir::immediates::Ieee64), vals=0, blocks=0)
source§

fn UnaryImm( self, opcode: Opcode, ctrl_typevar: Type, imm: Imm64, ) -> (Inst, &'f mut DataFlowGraph)

UnaryImm(imms=(imm: ir::immediates::Imm64), vals=0, blocks=0)
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, 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.