[][src]Enum cranelift_codegen::ir::instructions::InstructionData

pub enum InstructionData {
    Binary {
        opcode: Opcode,
        args: [Value; 2],
    },
    BinaryImm {
        opcode: Opcode,
        arg: Value,
        imm: Imm64,
    },
    Branch {
        opcode: Opcode,
        args: ValueList,
        destination: Block,
    },
    BranchFloat {
        opcode: Opcode,
        args: ValueList,
        cond: FloatCC,
        destination: Block,
    },
    BranchIcmp {
        opcode: Opcode,
        args: ValueList,
        cond: IntCC,
        destination: Block,
    },
    BranchInt {
        opcode: Opcode,
        args: ValueList,
        cond: IntCC,
        destination: Block,
    },
    BranchTable {
        opcode: Opcode,
        arg: Value,
        destination: Block,
        table: JumpTable,
    },
    BranchTableBase {
        opcode: Opcode,
        table: JumpTable,
    },
    BranchTableEntry {
        opcode: Opcode,
        args: [Value; 2],
        imm: Uimm8,
        table: JumpTable,
    },
    Call {
        opcode: Opcode,
        args: ValueList,
        func_ref: FuncRef,
    },
    CallIndirect {
        opcode: Opcode,
        args: ValueList,
        sig_ref: SigRef,
    },
    CondTrap {
        opcode: Opcode,
        arg: Value,
        code: TrapCode,
    },
    CopySpecial {
        opcode: Opcode,
        src: RegUnit,
        dst: RegUnit,
    },
    CopyToSsa {
        opcode: Opcode,
        src: RegUnit,
    },
    ExtractLane {
        opcode: Opcode,
        arg: Value,
        lane: Uimm8,
    },
    FloatCompare {
        opcode: Opcode,
        args: [Value; 2],
        cond: FloatCC,
    },
    FloatCond {
        opcode: Opcode,
        arg: Value,
        cond: FloatCC,
    },
    FloatCondTrap {
        opcode: Opcode,
        arg: Value,
        cond: FloatCC,
        code: TrapCode,
    },
    FuncAddr {
        opcode: Opcode,
        func_ref: FuncRef,
    },
    HeapAddr {
        opcode: Opcode,
        arg: Value,
        heap: Heap,
        imm: Uimm32,
    },
    IndirectJump {
        opcode: Opcode,
        arg: Value,
        table: JumpTable,
    },
    InsertLane {
        opcode: Opcode,
        args: [Value; 2],
        lane: Uimm8,
    },
    IntCompare {
        opcode: Opcode,
        args: [Value; 2],
        cond: IntCC,
    },
    IntCompareImm {
        opcode: Opcode,
        arg: Value,
        cond: IntCC,
        imm: Imm64,
    },
    IntCond {
        opcode: Opcode,
        arg: Value,
        cond: IntCC,
    },
    IntCondTrap {
        opcode: Opcode,
        arg: Value,
        cond: IntCC,
        code: TrapCode,
    },
    IntSelect {
        opcode: Opcode,
        args: [Value; 3],
        cond: IntCC,
    },
    Jump {
        opcode: Opcode,
        args: ValueList,
        destination: Block,
    },
    Load {
        opcode: Opcode,
        arg: Value,
        flags: MemFlags,
        offset: Offset32,
    },
    LoadComplex {
        opcode: Opcode,
        args: ValueList,
        flags: MemFlags,
        offset: Offset32,
    },
    MultiAry {
        opcode: Opcode,
        args: ValueList,
    },
    NullAry {
        opcode: Opcode,
    },
    RegFill {
        opcode: Opcode,
        arg: Value,
        src: StackSlot,
        dst: RegUnit,
    },
    RegMove {
        opcode: Opcode,
        arg: Value,
        src: RegUnit,
        dst: RegUnit,
    },
    RegSpill {
        opcode: Opcode,
        arg: Value,
        src: RegUnit,
        dst: StackSlot,
    },
    Shuffle {
        opcode: Opcode,
        args: [Value; 2],
        mask: Immediate,
    },
    StackLoad {
        opcode: Opcode,
        stack_slot: StackSlot,
        offset: Offset32,
    },
    StackStore {
        opcode: Opcode,
        arg: Value,
        stack_slot: StackSlot,
        offset: Offset32,
    },
    Store {
        opcode: Opcode,
        args: [Value; 2],
        flags: MemFlags,
        offset: Offset32,
    },
    StoreComplex {
        opcode: Opcode,
        args: ValueList,
        flags: MemFlags,
        offset: Offset32,
    },
    TableAddr {
        opcode: Opcode,
        arg: Value,
        table: Table,
        offset: Offset32,
    },
    Ternary {
        opcode: Opcode,
        args: [Value; 3],
    },
    Trap {
        opcode: Opcode,
        code: TrapCode,
    },
    Unary {
        opcode: Opcode,
        arg: Value,
    },
    UnaryBool {
        opcode: Opcode,
        imm: bool,
    },
    UnaryConst {
        opcode: Opcode,
        constant_handle: Constant,
    },
    UnaryGlobalValue {
        opcode: Opcode,
        global_value: GlobalValue,
    },
    UnaryIeee32 {
        opcode: Opcode,
        imm: Ieee32,
    },
    UnaryIeee64 {
        opcode: Opcode,
        imm: Ieee64,
    },
    UnaryImm {
        opcode: Opcode,
        imm: Imm64,
    },
}

Variants

Binary

Fields of Binary

opcode: Opcodeargs: [Value; 2]
BinaryImm

Fields of BinaryImm

opcode: Opcodearg: Valueimm: Imm64
Branch

Fields of Branch

opcode: Opcodeargs: ValueListdestination: Block
BranchFloat

Fields of BranchFloat

opcode: Opcodeargs: ValueListcond: FloatCCdestination: Block
BranchIcmp

Fields of BranchIcmp

opcode: Opcodeargs: ValueListcond: IntCCdestination: Block
BranchInt

Fields of BranchInt

opcode: Opcodeargs: ValueListcond: IntCCdestination: Block
BranchTable

Fields of BranchTable

opcode: Opcodearg: Valuedestination: Blocktable: JumpTable
BranchTableBase

Fields of BranchTableBase

opcode: Opcodetable: JumpTable
BranchTableEntry

Fields of BranchTableEntry

opcode: Opcodeargs: [Value; 2]imm: Uimm8table: JumpTable
Call

Fields of Call

opcode: Opcodeargs: ValueListfunc_ref: FuncRef
CallIndirect

Fields of CallIndirect

opcode: Opcodeargs: ValueListsig_ref: SigRef
CondTrap

Fields of CondTrap

opcode: Opcodearg: Valuecode: TrapCode
CopySpecial

Fields of CopySpecial

opcode: Opcodesrc: RegUnitdst: RegUnit
CopyToSsa

Fields of CopyToSsa

opcode: Opcodesrc: RegUnit
ExtractLane

Fields of ExtractLane

opcode: Opcodearg: Valuelane: Uimm8
FloatCompare

Fields of FloatCompare

opcode: Opcodeargs: [Value; 2]cond: FloatCC
FloatCond

Fields of FloatCond

opcode: Opcodearg: Valuecond: FloatCC
FloatCondTrap

Fields of FloatCondTrap

opcode: Opcodearg: Valuecond: FloatCCcode: TrapCode
FuncAddr

Fields of FuncAddr

opcode: Opcodefunc_ref: FuncRef
HeapAddr

Fields of HeapAddr

opcode: Opcodearg: Valueheap: Heapimm: Uimm32
IndirectJump

Fields of IndirectJump

opcode: Opcodearg: Valuetable: JumpTable
InsertLane

Fields of InsertLane

opcode: Opcodeargs: [Value; 2]lane: Uimm8
IntCompare

Fields of IntCompare

opcode: Opcodeargs: [Value; 2]cond: IntCC
IntCompareImm

Fields of IntCompareImm

opcode: Opcodearg: Valuecond: IntCCimm: Imm64
IntCond

Fields of IntCond

opcode: Opcodearg: Valuecond: IntCC
IntCondTrap

Fields of IntCondTrap

opcode: Opcodearg: Valuecond: IntCCcode: TrapCode
IntSelect

Fields of IntSelect

opcode: Opcodeargs: [Value; 3]cond: IntCC
Jump

Fields of Jump

opcode: Opcodeargs: ValueListdestination: Block
Load

Fields of Load

opcode: Opcodearg: Valueflags: MemFlagsoffset: Offset32
LoadComplex

Fields of LoadComplex

opcode: Opcodeargs: ValueListflags: MemFlagsoffset: Offset32
MultiAry

Fields of MultiAry

opcode: Opcodeargs: ValueList
NullAry

Fields of NullAry

opcode: Opcode
RegFill

Fields of RegFill

opcode: Opcodearg: Valuesrc: StackSlotdst: RegUnit
RegMove

Fields of RegMove

opcode: Opcodearg: Valuesrc: RegUnitdst: RegUnit
RegSpill

Fields of RegSpill

opcode: Opcodearg: Valuesrc: RegUnitdst: StackSlot
Shuffle

Fields of Shuffle

opcode: Opcodeargs: [Value; 2]mask: Immediate
StackLoad

Fields of StackLoad

opcode: Opcodestack_slot: StackSlotoffset: Offset32
StackStore

Fields of StackStore

opcode: Opcodearg: Valuestack_slot: StackSlotoffset: Offset32
Store

Fields of Store

opcode: Opcodeargs: [Value; 2]flags: MemFlagsoffset: Offset32
StoreComplex

Fields of StoreComplex

opcode: Opcodeargs: ValueListflags: MemFlagsoffset: Offset32
TableAddr

Fields of TableAddr

opcode: Opcodearg: Valuetable: Tableoffset: Offset32
Ternary

Fields of Ternary

opcode: Opcodeargs: [Value; 3]
Trap

Fields of Trap

opcode: Opcodecode: TrapCode
Unary

Fields of Unary

opcode: Opcodearg: Value
UnaryBool

Fields of UnaryBool

opcode: Opcodeimm: bool
UnaryConst

Fields of UnaryConst

opcode: Opcodeconstant_handle: Constant
UnaryGlobalValue

Fields of UnaryGlobalValue

opcode: Opcodeglobal_value: GlobalValue
UnaryIeee32

Fields of UnaryIeee32

opcode: Opcodeimm: Ieee32
UnaryIeee64

Fields of UnaryIeee64

opcode: Opcodeimm: Ieee64
UnaryImm

Fields of UnaryImm

opcode: Opcodeimm: Imm64

Methods

impl InstructionData[src]

pub fn opcode(&self) -> Opcode[src]

Get the opcode of this instruction.

pub fn typevar_operand(&self, pool: &ValueListPool) -> Option<Value>[src]

Get the controlling type variable operand.

pub fn arguments<'a>(&'a self, pool: &'a ValueListPool) -> &[Value][src]

Get the value arguments to this instruction.

pub fn arguments_mut<'a>(
    &'a mut self,
    pool: &'a mut ValueListPool
) -> &mut [Value]
[src]

Get mutable references to the value arguments to this instruction.

pub fn take_value_list(&mut self) -> Option<ValueList>[src]

Take out the value list with all the value arguments and return it.

This leaves the value list in the instruction empty. Use put_value_list to put the value list back.

pub fn put_value_list(&mut self, vlist: ValueList)[src]

Put back a value list.

After removing a value list with take_value_list(), use this method to put it back. It is required that this instruction has a format that accepts a value list, and that the existing value list is empty. This avoids leaking list pool memory.

pub fn eq(&self, other: &Self, pool: &ValueListPool) -> bool[src]

Compare two InstructionData for equality.

This operation requires a reference to a ValueListPool to determine if the contents of any ValueLists are equal.

pub fn hash<H: Hasher>(&self, state: &mut H, pool: &ValueListPool)[src]

Hash an InstructionData.

This operation requires a reference to a ValueListPool to hash the contents of any ValueLists.

impl InstructionData[src]

Analyzing an instruction.

Avoid large matches on instruction formats by using the methods defined here to examine instructions.

pub fn analyze_branch<'a>(&'a self, pool: &'a ValueListPool) -> BranchInfo<'a>[src]

Return information about the destination of a branch or jump instruction.

Any instruction that can transfer control to another block reveals its possible destinations here.

pub fn branch_destination(&self) -> Option<Block>[src]

Get the single destination of this branch instruction, if it is a single destination branch or jump.

Multi-destination branches like br_table return None.

pub fn branch_destination_mut(&mut self) -> Option<&mut Block>[src]

Get a mutable reference to the single destination of this branch instruction, if it is a single destination branch or jump.

Multi-destination branches like br_table return None.

pub fn analyze_call<'a>(&'a self, pool: &'a ValueListPool) -> CallInfo<'a>[src]

Return information about a call instruction.

Any instruction that can call another function reveals its call signature here.

Trait Implementations

impl Clone for InstructionData[src]

impl Debug for InstructionData[src]

impl<'a> From<&'a InstructionData> for InstructionFormat[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.