cranelift_codegen::ir

Struct ReplaceBuilder

Source
pub struct ReplaceBuilder<'f> { /* private fields */ }
Expand description

Instruction builder that replaces an existing instruction.

The inserted instruction will have the same Inst number as the old one.

If the old instruction still has result values attached, it is assumed that the new instruction produces the same number and types of results. The old result values are preserved. If the replacement instruction format does not support multiple results, the builder panics. It is a bug to leave result values dangling.

Implementations§

Source§

impl<'f> ReplaceBuilder<'f>

Source

pub fn new(dfg: &'f mut DataFlowGraph, inst: Inst) -> Self

Create a ReplaceBuilder that will overwrite inst.

Trait Implementations§

Source§

impl<'f> InstBuilderBase<'f> for ReplaceBuilder<'f>

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> Freeze for ReplaceBuilder<'f>

§

impl<'f> RefUnwindSafe for ReplaceBuilder<'f>

§

impl<'f> Send for ReplaceBuilder<'f>

§

impl<'f> Sync for ReplaceBuilder<'f>

§

impl<'f> Unpin for ReplaceBuilder<'f>

§

impl<'f> !UnwindSafe for ReplaceBuilder<'f>

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 trapnz<T1: Into<TrapCode>>(self, c: Value, code: T1) -> Inst

Trap when 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 stack_switch( self, store_context_ptr: Value, load_context_ptr: Value, in_payload0: Value, ) -> Value

Suspends execution of the current stack and resumes execution of another one. 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 iconst<T1: Into<Imm64>>(self, NarrowInt: Type, N: T1) -> Value

Integer constant. Read more
Source§

fn f16const<T1: Into<Ieee16>>(self, N: T1) -> Value

Floating point 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 f128const<T1: Into<Constant>>(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 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, NarrowInt: 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 sadd_overflow_cin(self, x: Value, y: Value, c_in: Value) -> (Value, Value)

Add signed integers with carry in and overflow out. Read more
Source§

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

Add unsigned integers with carry in and overflow out. Read more
Source§

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

Add integers unsigned with overflow out. of is set when the addition overflowed. Read more
Source§

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

Add integers signed with overflow out. of is set when the addition over- or underflowed. Polymorphic over all scalar integer types, but does not support vector types. Read more
Source§

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

Subtract integers unsigned with overflow out. of is set when the subtraction underflowed. Read more
Source§

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

Subtract integers signed with overflow out. of is set when the subtraction over- or underflowed. Polymorphic over all scalar integer types, but does not support vector types. Read more
Source§

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

Multiply integers unsigned with overflow out. of is set when the multiplication overflowed. Read more
Source§

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

Multiply integers signed with overflow out. of is set when the multiplication over- or underflowed. Polymorphic over all scalar integer types except i128, but does not support vector types. 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 ssub_overflow_bin(self, x: Value, y: Value, b_in: Value) -> (Value, Value)

Subtract signed integers with borrow in and overflow out. Read more
Source§

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

Subtract unsigned integers with borrow in and overflow 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 fmax(self, x: Value, y: Value) -> Value

Floating point maximum, propagating NaNs using the WebAssembly rules. 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 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 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 any integer type; note that some targets require specific target features to be enabled in order to support 128-bit integer atomics. 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 any integer type; note that some targets require specific target features to be enabled in order to support 128-bit integer atomics. 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 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 UnaryIeee16( self, opcode: Opcode, ctrl_typevar: Type, imm: Ieee16, ) -> (Inst, &'f mut DataFlowGraph)

UnaryIeee16(imms=(imm: ir::immediates::Ieee16), 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>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.