Trait cretonne_codegen::ir::InstBuilder [] [src]

pub trait InstBuilder<'f>: InstBuilderBase<'f> {
    fn jump(self, EBB: Ebb, args: &[Value]) -> Inst { ... }
fn fallthrough(self, EBB: Ebb, args: &[Value]) -> Inst { ... }
fn brz(self, c: Value, EBB: Ebb, args: &[Value]) -> Inst { ... }
fn brnz(self, c: Value, EBB: Ebb, args: &[Value]) -> Inst { ... }
fn br_icmp<T1intcc: Into<IntCC>>(
        self,
        Cond: T1intcc,
        x: Value,
        y: Value,
        EBB: Ebb,
        args: &[Value]
    ) -> Inst { ... }
fn brif<T1intcc: Into<IntCC>>(
        self,
        Cond: T1intcc,
        f: Value,
        EBB: Ebb,
        args: &[Value]
    ) -> Inst { ... }
fn brff<T1floatcc: Into<FloatCC>>(
        self,
        Cond: T1floatcc,
        f: Value,
        EBB: Ebb,
        args: &[Value]
    ) -> Inst { ... }
fn br_table(self, x: Value, JT: JumpTable) -> Inst { ... }
fn trap<T1trapcode: Into<TrapCode>>(self, code: T1trapcode) -> Inst { ... }
fn trapz<T1trapcode: Into<TrapCode>>(
        self,
        c: Value,
        code: T1trapcode
    ) -> Inst { ... }
fn trapnz<T1trapcode: Into<TrapCode>>(
        self,
        c: Value,
        code: T1trapcode
    ) -> Inst { ... }
fn trapif<T1intcc: Into<IntCC>, T2trapcode: Into<TrapCode>>(
        self,
        Cond: T1intcc,
        f: Value,
        code: T2trapcode
    ) -> Inst { ... }
fn trapff<T1floatcc: Into<FloatCC>, T2trapcode: Into<TrapCode>>(
        self,
        Cond: T1floatcc,
        f: Value,
        code: T2trapcode
    ) -> Inst { ... }
fn return_(self, rvals: &[Value]) -> Inst { ... }
fn call(self, FN: FuncRef, args: &[Value]) -> Inst { ... }
fn call_indirect(self, SIG: SigRef, callee: Value, args: &[Value]) -> Inst { ... }
fn func_addr(self, iAddr: Type, FN: FuncRef) -> Value { ... }
fn load<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        Mem: Type,
        Flags: T1memflags,
        p: Value,
        Offset: T2offset32
    ) -> Value { ... }
fn store<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        Flags: T1memflags,
        x: Value,
        p: Value,
        Offset: T2offset32
    ) -> Inst { ... }
fn uload8<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        iExt8: Type,
        Flags: T1memflags,
        p: Value,
        Offset: T2offset32
    ) -> Value { ... }
fn sload8<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        iExt8: Type,
        Flags: T1memflags,
        p: Value,
        Offset: T2offset32
    ) -> Value { ... }
fn istore8<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        Flags: T1memflags,
        x: Value,
        p: Value,
        Offset: T2offset32
    ) -> Inst { ... }
fn uload16<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        iExt16: Type,
        Flags: T1memflags,
        p: Value,
        Offset: T2offset32
    ) -> Value { ... }
fn sload16<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        iExt16: Type,
        Flags: T1memflags,
        p: Value,
        Offset: T2offset32
    ) -> Value { ... }
fn istore16<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        Flags: T1memflags,
        x: Value,
        p: Value,
        Offset: T2offset32
    ) -> Inst { ... }
fn uload32<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        Flags: T1memflags,
        p: Value,
        Offset: T2offset32
    ) -> Value { ... }
fn sload32<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        Flags: T1memflags,
        p: Value,
        Offset: T2offset32
    ) -> Value { ... }
fn istore32<T1memflags: Into<MemFlags>, T2offset32: Into<Offset32>>(
        self,
        Flags: T1memflags,
        x: Value,
        p: Value,
        Offset: T2offset32
    ) -> Inst { ... }
fn stack_load<T1offset32: Into<Offset32>>(
        self,
        Mem: Type,
        SS: StackSlot,
        Offset: T1offset32
    ) -> Value { ... }
fn stack_store<T1offset32: Into<Offset32>>(
        self,
        x: Value,
        SS: StackSlot,
        Offset: T1offset32
    ) -> Inst { ... }
fn stack_addr<T1offset32: Into<Offset32>>(
        self,
        iAddr: Type,
        SS: StackSlot,
        Offset: T1offset32
    ) -> Value { ... }
fn global_addr(self, iAddr: Type, GV: GlobalVar) -> Value { ... }
fn globalsym_addr(self, iAddr: Type, GV: GlobalVar) -> Value { ... }
fn heap_addr<T1uimm32: Into<Uimm32>>(
        self,
        iAddr: Type,
        H: Heap,
        p: Value,
        Size: T1uimm32
    ) -> Value { ... }
fn iconst<T1imm64: Into<Imm64>>(self, Int: Type, N: T1imm64) -> Value { ... }
fn f32const<T1ieee32: Into<Ieee32>>(self, N: T1ieee32) -> Value { ... }
fn f64const<T1ieee64: Into<Ieee64>>(self, N: T1ieee64) -> Value { ... }
fn bconst<T1bool: Into<bool>>(self, Bool: Type, N: T1bool) -> Value { ... }
fn select(self, c: Value, x: Value, y: Value) -> Value { ... }
fn selectif<T1intcc: Into<IntCC>>(
        self,
        Any: Type,
        cc: T1intcc,
        flags: Value,
        x: Value,
        y: Value
    ) -> Value { ... }
fn copy(self, x: Value) -> Value { ... }
fn spill(self, x: Value) -> Value { ... }
fn fill(self, x: Value) -> Value { ... }
fn regmove<T1regunit: Into<RegUnit>, T2regunit: Into<RegUnit>>(
        self,
        x: Value,
        src: T1regunit,
        dst: T2regunit
    ) -> Inst { ... }
fn copy_special<T1regunit: Into<RegUnit>, T2regunit: Into<RegUnit>>(
        self,
        src: T1regunit,
        dst: T2regunit
    ) -> Inst { ... }
fn stack_check(self, GV: GlobalVar) -> Inst { ... }
fn adjust_sp_imm<T1imm64: Into<Imm64>>(self, Offset: T1imm64) -> Inst { ... }
fn ifcmp_sp(self, addr: Value) -> Value { ... }
fn regspill<T1regunit: Into<RegUnit>>(
        self,
        x: Value,
        src: T1regunit,
        SS: StackSlot
    ) -> Inst { ... }
fn regfill<T1regunit: Into<RegUnit>>(
        self,
        x: Value,
        SS: StackSlot,
        dst: T1regunit
    ) -> Inst { ... }
fn vsplit(self, x: Value) -> (Value, Value) { ... }
fn vconcat(self, x: Value, y: Value) -> Value { ... }
fn vselect(self, c: Value, x: Value, y: Value) -> Value { ... }
fn splat(self, TxN: Type, x: Value) -> Value { ... }
fn insertlane<T1uimm8: Into<Uimm8>>(
        self,
        x: Value,
        Idx: T1uimm8,
        y: Value
    ) -> Value { ... }
fn extractlane<T1uimm8: Into<Uimm8>>(self, x: Value, Idx: T1uimm8) -> Value { ... }
fn icmp<T1intcc: Into<IntCC>>(
        self,
        Cond: T1intcc,
        x: Value,
        y: Value
    ) -> Value { ... }
fn icmp_imm<T1intcc: Into<IntCC>, T2imm64: Into<Imm64>>(
        self,
        Cond: T1intcc,
        x: Value,
        Y: T2imm64
    ) -> Value { ... }
fn ifcmp(self, x: Value, y: Value) -> Value { ... }
fn ifcmp_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn iadd(self, x: Value, y: Value) -> Value { ... }
fn isub(self, x: Value, y: Value) -> Value { ... }
fn imul(self, x: Value, y: Value) -> Value { ... }
fn umulhi(self, x: Value, y: Value) -> Value { ... }
fn smulhi(self, x: Value, y: Value) -> Value { ... }
fn udiv(self, x: Value, y: Value) -> Value { ... }
fn sdiv(self, x: Value, y: Value) -> Value { ... }
fn urem(self, x: Value, y: Value) -> Value { ... }
fn srem(self, x: Value, y: Value) -> Value { ... }
fn iadd_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn imul_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn udiv_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn sdiv_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn urem_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn srem_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn irsub_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn iadd_cin(self, x: Value, y: Value, c_in: Value) -> Value { ... }
fn iadd_cout(self, x: Value, y: Value) -> (Value, Value) { ... }
fn iadd_carry(self, x: Value, y: Value, c_in: Value) -> (Value, Value) { ... }
fn isub_bin(self, x: Value, y: Value, b_in: Value) -> Value { ... }
fn isub_bout(self, x: Value, y: Value) -> (Value, Value) { ... }
fn isub_borrow(self, x: Value, y: Value, b_in: Value) -> (Value, Value) { ... }
fn band(self, x: Value, y: Value) -> Value { ... }
fn bor(self, x: Value, y: Value) -> Value { ... }
fn bxor(self, x: Value, y: Value) -> Value { ... }
fn bnot(self, x: Value) -> Value { ... }
fn band_not(self, x: Value, y: Value) -> Value { ... }
fn bor_not(self, x: Value, y: Value) -> Value { ... }
fn bxor_not(self, x: Value, y: Value) -> Value { ... }
fn band_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn bor_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn bxor_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn rotl(self, x: Value, y: Value) -> Value { ... }
fn rotr(self, x: Value, y: Value) -> Value { ... }
fn rotl_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn rotr_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn ishl(self, x: Value, y: Value) -> Value { ... }
fn ushr(self, x: Value, y: Value) -> Value { ... }
fn sshr(self, x: Value, y: Value) -> Value { ... }
fn ishl_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn ushr_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn sshr_imm<T1imm64: Into<Imm64>>(self, x: Value, Y: T1imm64) -> Value { ... }
fn clz(self, x: Value) -> Value { ... }
fn cls(self, x: Value) -> Value { ... }
fn ctz(self, x: Value) -> Value { ... }
fn popcnt(self, x: Value) -> Value { ... }
fn fcmp<T1floatcc: Into<FloatCC>>(
        self,
        Cond: T1floatcc,
        x: Value,
        y: Value
    ) -> Value { ... }
fn ffcmp(self, x: Value, y: Value) -> Value { ... }
fn fadd(self, x: Value, y: Value) -> Value { ... }
fn fsub(self, x: Value, y: Value) -> Value { ... }
fn fmul(self, x: Value, y: Value) -> Value { ... }
fn fdiv(self, x: Value, y: Value) -> Value { ... }
fn sqrt(self, x: Value) -> Value { ... }
fn fma(self, x: Value, y: Value, z: Value) -> Value { ... }
fn fneg(self, x: Value) -> Value { ... }
fn fabs(self, x: Value) -> Value { ... }
fn fcopysign(self, x: Value, y: Value) -> Value { ... }
fn fmin(self, x: Value, y: Value) -> Value { ... }
fn fmax(self, x: Value, y: Value) -> Value { ... }
fn ceil(self, x: Value) -> Value { ... }
fn floor(self, x: Value) -> Value { ... }
fn trunc(self, x: Value) -> Value { ... }
fn nearest(self, x: Value) -> Value { ... }
fn trueif<T1intcc: Into<IntCC>>(self, Cond: T1intcc, f: Value) -> Value { ... }
fn trueff<T1floatcc: Into<FloatCC>>(
        self,
        Cond: T1floatcc,
        f: Value
    ) -> Value { ... }
fn bitcast(self, MemTo: Type, x: Value) -> Value { ... }
fn breduce(self, BoolTo: Type, x: Value) -> Value { ... }
fn bextend(self, BoolTo: Type, x: Value) -> Value { ... }
fn bint(self, IntTo: Type, x: Value) -> Value { ... }
fn bmask(self, IntTo: Type, x: Value) -> Value { ... }
fn ireduce(self, IntTo: Type, x: Value) -> Value { ... }
fn uextend(self, IntTo: Type, x: Value) -> Value { ... }
fn sextend(self, IntTo: Type, x: Value) -> Value { ... }
fn fpromote(self, FloatTo: Type, x: Value) -> Value { ... }
fn fdemote(self, FloatTo: Type, x: Value) -> Value { ... }
fn fcvt_to_uint(self, IntTo: Type, x: Value) -> Value { ... }
fn fcvt_to_sint(self, IntTo: Type, x: Value) -> Value { ... }
fn fcvt_from_uint(self, FloatTo: Type, x: Value) -> Value { ... }
fn fcvt_from_sint(self, FloatTo: Type, x: Value) -> Value { ... }
fn isplit(self, x: Value) -> (Value, Value) { ... }
fn iconcat(self, lo: Value, hi: Value) -> Value { ... }
fn x86_udivmodx(self, nlo: Value, nhi: Value, d: Value) -> (Value, Value) { ... }
fn x86_sdivmodx(self, nlo: Value, nhi: Value, d: Value) -> (Value, Value) { ... }
fn x86_umulx(self, argL: Value, argR: Value) -> (Value, Value) { ... }
fn x86_smulx(self, argL: Value, argR: Value) -> (Value, Value) { ... }
fn x86_cvtt2si(self, IntTo: Type, x: Value) -> Value { ... }
fn x86_fmin(self, x: Value, y: Value) -> Value { ... }
fn x86_fmax(self, x: Value, y: Value) -> Value { ... }
fn x86_push(self, x: Value) -> Inst { ... }
fn x86_pop(self, iWord: Type) -> Value { ... }
fn x86_bsr(self, x: Value) -> (Value, Value) { ... }
fn x86_bsf(self, x: Value) -> (Value, Value) { ... }
fn Unary(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn UnaryImm(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        imm: Imm64
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn UnaryIeee32(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        imm: Ieee32
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn UnaryIeee64(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        imm: Ieee64
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn UnaryBool(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        imm: bool
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn UnaryGlobalVar(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        global_var: GlobalVar
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Binary(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        arg0: Value,
        arg1: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn BinaryImm(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        imm: Imm64,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Ternary(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        arg0: Value,
        arg1: Value,
        arg2: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn MultiAry(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn NullAry(
        self,
        opcode: Opcode,
        ctrl_typevar: Type
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn InsertLane(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        lane: Uimm8,
        arg0: Value,
        arg1: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn ExtractLane(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        lane: Uimm8,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn IntCompare(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: IntCC,
        arg0: Value,
        arg1: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn IntCompareImm(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: IntCC,
        imm: Imm64,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn IntCond(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: IntCC,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn FloatCompare(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: FloatCC,
        arg0: Value,
        arg1: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn FloatCond(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: FloatCC,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn IntSelect(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: IntCC,
        arg0: Value,
        arg1: Value,
        arg2: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Jump(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        destination: Ebb,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Branch(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        destination: Ebb,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn BranchInt(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: IntCC,
        destination: Ebb,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn BranchFloat(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: FloatCC,
        destination: Ebb,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn BranchIcmp(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: IntCC,
        destination: Ebb,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn BranchTable(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        table: JumpTable,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Call(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        func_ref: FuncRef,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn CallIndirect(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        sig_ref: SigRef,
        args: ValueList
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn FuncAddr(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        func_ref: FuncRef
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Load(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        flags: MemFlags,
        offset: Offset32,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Store(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        flags: MemFlags,
        offset: Offset32,
        arg0: Value,
        arg1: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn StackLoad(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        stack_slot: StackSlot,
        offset: Offset32
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn StackStore(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        stack_slot: StackSlot,
        offset: Offset32,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn HeapAddr(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        heap: Heap,
        imm: Uimm32,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn RegMove(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        src: RegUnit,
        dst: RegUnit,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn CopySpecial(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        src: RegUnit,
        dst: RegUnit
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn RegSpill(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        src: RegUnit,
        dst: StackSlot,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn RegFill(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        src: StackSlot,
        dst: RegUnit,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn Trap(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        code: TrapCode
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn CondTrap(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        code: TrapCode,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn IntCondTrap(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: IntCC,
        code: TrapCode,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... }
fn FloatCondTrap(
        self,
        opcode: Opcode,
        ctrl_typevar: Type,
        cond: FloatCC,
        code: TrapCode,
        arg0: Value
    ) -> (Inst, &'f mut DataFlowGraph) { ... } }

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

jump EBB, args

Jump.

fallthrough EBB, args

Fall through to the next EBB.

brz c, EBB, args

Branch when zero.

brnz c, EBB, args

Branch when non-zero.

br_icmp Cond, x, y, EBB, args

Compare scalar integers and branch.

brif Cond, f, EBB, args

Branch when condition is true in integer CPU flags.

brff Cond, f, EBB, args

Branch when condition is true in floating point CPU flags.

br_table x, JT

Indirect branch via jump table.

trap code

Terminate execution unconditionally.

trapz c, code

Trap when zero.

trapnz c, code

Trap when non-zero.

trapif Cond, f, code

Trap when condition is true in integer CPU flags.

trapff Cond, f, code

Trap when condition is true in floating point CPU flags.

return rvals

Return from the function.

rvals = call FN, args

Direct function call.

rvals = call_indirect SIG, callee, args

Indirect function call.

addr = func_addr FN

Get the address of a function.

a = load Flags, p, Offset

Load from memory at p + Offset.

store Flags, x, p, Offset

Store x to memory at p + Offset.

a = uload8 Flags, p, Offset

Load 8 bits from memory at p + Offset and zero-extend.

a = sload8 Flags, p, Offset

Load 8 bits from memory at p + Offset and sign-extend.

istore8 Flags, x, p, Offset

Store the low 8 bits of x to memory at p + Offset.

a = uload16 Flags, p, Offset

Load 16 bits from memory at p + Offset and zero-extend.

a = sload16 Flags, p, Offset

Load 16 bits from memory at p + Offset and sign-extend.

istore16 Flags, x, p, Offset

Store the low 16 bits of x to memory at p + Offset.

a = uload32 Flags, p, Offset

Load 32 bits from memory at p + Offset and zero-extend.

a = sload32 Flags, p, Offset

Load 32 bits from memory at p + Offset and sign-extend.

istore32 Flags, x, p, Offset

Store the low 32 bits of x to memory at p + Offset.

a = stack_load SS, Offset

Load a value from a stack slot at the constant offset.

stack_store x, SS, Offset

Store a value to a stack slot at a constant offset.

addr = stack_addr SS, Offset

Get the address of a stack slot.

addr = global_addr GV

Compute the address of global variable GV.

addr = globalsym_addr GV

Compute the address of global variable GV, which is a symbolic name.

addr = heap_addr H, p, Size

Bounds check and compute absolute address of heap memory.

a = iconst N

Integer constant.

a = f32const N

Floating point constant.

a = f64const N

Floating point constant.

a = bconst N

Boolean constant.

a = select c, x, y

Conditional select.

a = selectif cc, flags, x, y

Conditional select, dependent on integer condition codes.

a = copy x

Register-register copy.

a = spill x

Spill a register value to a stack slot.

a = fill x

Load a register value from a stack slot.

regmove x, src, dst

Temporarily divert x from src to dst.

copy_special src, dst

Copies the contents of ''src'' register to ''dst'' register.

stack_check GV

Check for stack overflow.

adjust_sp_imm Offset

Adds Offset immediate offset value to the stack pointer register.

f = ifcmp_sp addr

Compare addr with the stack pointer and set the CPU flags.

regspill x, src, SS

Temporarily divert x from src to SS.

regfill x, SS, dst

Temporarily divert x from SS to dst.

lo, hi = vsplit x

Split a vector into two halves.

a = vconcat x, y

Vector concatenation.

a = vselect c, x, y

Vector lane select.

a = splat x

Vector splat.

a = insertlane x, Idx, y

Insert y as lane Idx in x.

a = extractlane x, Idx

Extract lane Idx from x.

a = icmp Cond, x, y

Integer comparison.

a = icmp_imm Cond, x, Y

Compare scalar integer to a constant.

f = ifcmp x, y

Compare scalar integers and return flags.

f = ifcmp_imm x, Y

Compare scalar integer to a constant and return flags.

a = iadd x, y

Wrapping integer addition: :math:a := x + y \pmod{2^B}.

a = isub x, y

Wrapping integer subtraction: :math:a := x - y \pmod{2^B}.

a = imul x, y

Wrapping integer multiplication: :math:a := x y \pmod{2^B}.

a = umulhi x, y

Unsigned integer multiplication, producing the high half of a

a = smulhi x, y

Signed integer multiplication, producing the high half of a

a = udiv x, y

Unsigned integer division: :math:a := \lfloor {x \over y} \rfloor.

a = sdiv x, y

Signed integer division rounded toward zero: :math:`a := sign(xy)

a = urem x, y

Unsigned integer remainder.

a = srem x, y

Signed integer remainder. The result has the sign of the dividend.

a = iadd_imm x, Y

Add immediate integer.

a = imul_imm x, Y

Integer multiplication by immediate constant.

a = udiv_imm x, Y

Unsigned integer division by an immediate constant.

a = sdiv_imm x, Y

Signed integer division by an immediate constant.

a = urem_imm x, Y

Unsigned integer remainder with immediate divisor.

a = srem_imm x, Y

Signed integer remainder with immediate divisor.

a = irsub_imm x, Y

Immediate reverse wrapping subtraction: :math:a := Y - x \pmod{2^B}.

a = iadd_cin x, y, c_in

Add integers with carry in.

a, c_out = iadd_cout x, y

Add integers with carry out.

a, c_out = iadd_carry x, y, c_in

Add integers with carry in and out.

a = isub_bin x, y, b_in

Subtract integers with borrow in.

a, b_out = isub_bout x, y

Subtract integers with borrow out.

a, b_out = isub_borrow x, y, b_in

Subtract integers with borrow in and out.

a = band x, y

Bitwise and.

a = bor x, y

Bitwise or.

a = bxor x, y

Bitwise xor.

a = bnot x

Bitwise not.

a = band_not x, y

Bitwise and not.

a = bor_not x, y

Bitwise or not.

a = bxor_not x, y

Bitwise xor not.

a = band_imm x, Y

Bitwise and with immediate.

a = bor_imm x, Y

Bitwise or with immediate.

a = bxor_imm x, Y

Bitwise xor with immediate.

a = rotl x, y

Rotate left.

a = rotr x, y

Rotate right.

a = rotl_imm x, Y

Rotate left by immediate.

a = rotr_imm x, Y

Rotate right by immediate.

a = ishl x, y

Integer shift left. Shift the bits in x towards the MSB by y

a = ushr x, y

Unsigned shift right. Shift bits in x towards the LSB by y

a = sshr x, y

Signed shift right. Shift bits in x towards the LSB by y

a = ishl_imm x, Y

Integer shift left by immediate.

a = ushr_imm x, Y

Unsigned shift right by immediate.

a = sshr_imm x, Y

Signed shift right by immediate.

a = clz x

Count leading zero bits.

a = cls x

Count leading sign bits.

a = ctz x

Count trailing zeros.

a = popcnt x

Population count

a = fcmp Cond, x, y

Floating point comparison.

f = ffcmp x, y

Floating point comparison returning flags.

a = fadd x, y

Floating point addition.

a = fsub x, y

Floating point subtraction.

a = fmul x, y

Floating point multiplication.

a = fdiv x, y

Floating point division.

a = sqrt x

Floating point square root.

a = fma x, y, z

Floating point fused multiply-and-add.

a = fneg x

Floating point negation.

a = fabs x

Floating point absolute value.

a = fcopysign x, y

Floating point copy sign.

a = fmin x, y

Floating point minimum, propagating NaNs.

a = fmax x, y

Floating point maximum, propagating NaNs.

a = ceil x

Round floating point round to integral, towards positive infinity.

a = floor x

Round floating point round to integral, towards negative infinity.

a = trunc x

Round floating point round to integral, towards zero.

a = nearest x

Round floating point round to integral, towards nearest with ties to

a = trueif Cond, f

Test integer CPU flags for a specific condition.

a = trueff Cond, f

Test floating point CPU flags for a specific condition.

a = bitcast x

Reinterpret the bits in x as a different type.

a = breduce x

Convert x to a smaller boolean type in the platform-defined way.

a = bextend x

Convert x to a larger boolean type in the platform-defined way.

a = bint x

Convert x to an integer.

a = bmask x

Convert x to an integer mask.

a = ireduce x

Convert x to a smaller integer type by dropping high bits.

a = uextend x

Convert x to a larger integer type by zero-extending.

a = sextend x

Convert x to a larger integer type by sign-extending.

a = fpromote x

Convert x to a larger floating point format.

a = fdemote x

Convert x to a smaller floating point format.

a = fcvt_to_uint x

Convert floating point to unsigned integer.

a = fcvt_to_sint x

Convert floating point to signed integer.

a = fcvt_from_uint x

Convert unsigned integer to floating point.

a = fcvt_from_sint x

Convert signed integer to floating point.

lo, hi = isplit x

Split an integer into low and high parts.

a = iconcat lo, hi

Concatenate low and high bits to form a larger integer type.

q, r = x86_udivmodx nlo, nhi, d

Extended unsigned division.

q, r = x86_sdivmodx nlo, nhi, d

Extended signed division.

resLo, resHi = x86_umulx argL, argR

Unsigned integer multiplication, producing a double-length result.

resLo, resHi = x86_smulx argL, argR

Signed integer multiplication, producing a double-length result.

a = x86_cvtt2si x

Convert with truncation floating point to signed integer.

a = x86_fmin x, y

Floating point minimum with x86 semantics.

a = x86_fmax x, y

Floating point maximum with x86 semantics.

x86_push x

Pushes a value onto the stack.

x = x86_pop

Pops a value from the stack.

y, rflags = x86_bsr x

Bit Scan Reverse -- returns the bit-index of the most significant 1

y, rflags = x86_bsf x

Bit Scan Forwards -- returns the bit-index of the least significant 1

Unary(imms=(), vals=1)

UnaryImm(imms=(imm: imm64), vals=0)

UnaryIeee32(imms=(imm: ieee32), vals=0)

UnaryIeee64(imms=(imm: ieee64), vals=0)

UnaryBool(imms=(imm: bool), vals=0)

UnaryGlobalVar(imms=(global_var: global_var), vals=0)

Binary(imms=(), vals=2)

BinaryImm(imms=(imm: imm64), vals=1)

Ternary(imms=(), vals=3)

MultiAry(imms=(), vals=0)

NullAry(imms=(), vals=0)

InsertLane(imms=(lane: uimm8), vals=2)

ExtractLane(imms=(lane: uimm8), vals=1)

IntCompare(imms=(cond: intcc), vals=2)

IntCompareImm(imms=(cond: intcc, imm: imm64), vals=1)

IntCond(imms=(cond: intcc), vals=1)

FloatCompare(imms=(cond: floatcc), vals=2)

FloatCond(imms=(cond: floatcc), vals=1)

IntSelect(imms=(cond: intcc), vals=3)

Jump(imms=(destination: ebb), vals=0)

Branch(imms=(destination: ebb), vals=1)

BranchInt(imms=(cond: intcc, destination: ebb), vals=1)

BranchFloat(imms=(cond: floatcc, destination: ebb), vals=1)

BranchIcmp(imms=(cond: intcc, destination: ebb), vals=2)

BranchTable(imms=(table: jump_table), vals=1)

Call(imms=(func_ref: func_ref), vals=0)

CallIndirect(imms=(sig_ref: sig_ref), vals=1)

FuncAddr(imms=(func_ref: func_ref), vals=0)

Load(imms=(flags: memflags, offset: offset32), vals=1)

Store(imms=(flags: memflags, offset: offset32), vals=2)

StackLoad(imms=(stack_slot: stack_slot, offset: offset32), vals=0)

StackStore(imms=(stack_slot: stack_slot, offset: offset32), vals=1)

HeapAddr(imms=(heap: heap, imm: uimm32), vals=1)

RegMove(imms=(src: regunit, dst: regunit), vals=1)

CopySpecial(imms=(src: regunit, dst: regunit), vals=0)

RegSpill(imms=(src: regunit, dst: stack_slot), vals=1)

RegFill(imms=(src: stack_slot, dst: regunit), vals=1)

Trap(imms=(code: trapcode), vals=0)

CondTrap(imms=(code: trapcode), vals=1)

IntCondTrap(imms=(cond: intcc, code: trapcode), vals=1)

FloatCondTrap(imms=(cond: floatcc, code: trapcode), vals=1)

Implementors