Enum cranelift_codegen::ir::instructions::InstructionData [−][src]
pub enum InstructionData {
Unary {
opcode: Opcode,
arg: Value,
},
UnaryImm {
opcode: Opcode,
imm: Imm64,
},
UnaryIeee32 {
opcode: Opcode,
imm: Ieee32,
},
UnaryIeee64 {
opcode: Opcode,
imm: Ieee64,
},
UnaryBool {
opcode: Opcode,
imm: bool,
},
UnaryGlobalValue {
opcode: Opcode,
global_value: GlobalValue,
},
Binary {
opcode: Opcode,
args: [Value; 2],
},
BinaryImm {
opcode: Opcode,
arg: Value,
imm: Imm64,
},
Ternary {
opcode: Opcode,
args: [Value; 3],
},
MultiAry {
opcode: Opcode,
args: ValueList,
},
NullAry {
opcode: Opcode,
},
InsertLane {
opcode: Opcode,
args: [Value; 2],
lane: Uimm8,
},
ExtractLane {
opcode: Opcode,
arg: Value,
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,
},
FloatCompare {
opcode: Opcode,
args: [Value; 2],
cond: FloatCC,
},
FloatCond {
opcode: Opcode,
arg: Value,
cond: FloatCC,
},
IntSelect {
opcode: Opcode,
args: [Value; 3],
cond: IntCC,
},
Jump {
opcode: Opcode,
args: ValueList,
destination: Ebb,
},
Branch {
opcode: Opcode,
args: ValueList,
destination: Ebb,
},
BranchInt {
opcode: Opcode,
args: ValueList,
cond: IntCC,
destination: Ebb,
},
BranchFloat {
opcode: Opcode,
args: ValueList,
cond: FloatCC,
destination: Ebb,
},
BranchIcmp {
opcode: Opcode,
args: ValueList,
cond: IntCC,
destination: Ebb,
},
BranchTable {
opcode: Opcode,
arg: Value,
table: JumpTable,
},
Call {
opcode: Opcode,
args: ValueList,
func_ref: FuncRef,
},
CallIndirect {
opcode: Opcode,
args: ValueList,
sig_ref: SigRef,
},
FuncAddr {
opcode: Opcode,
func_ref: FuncRef,
},
Load {
opcode: Opcode,
arg: Value,
flags: MemFlags,
offset: Offset32,
},
LoadComplex {
opcode: Opcode,
args: ValueList,
flags: MemFlags,
offset: Offset32,
},
Store {
opcode: Opcode,
args: [Value; 2],
flags: MemFlags,
offset: Offset32,
},
StoreComplex {
opcode: Opcode,
args: ValueList,
flags: MemFlags,
offset: Offset32,
},
StackLoad {
opcode: Opcode,
stack_slot: StackSlot,
offset: Offset32,
},
StackStore {
opcode: Opcode,
arg: Value,
stack_slot: StackSlot,
offset: Offset32,
},
HeapAddr {
opcode: Opcode,
arg: Value,
heap: Heap,
imm: Uimm32,
},
RegMove {
opcode: Opcode,
arg: Value,
src: RegUnit,
dst: RegUnit,
},
CopySpecial {
opcode: Opcode,
src: RegUnit,
dst: RegUnit,
},
RegSpill {
opcode: Opcode,
arg: Value,
src: RegUnit,
dst: StackSlot,
},
RegFill {
opcode: Opcode,
arg: Value,
src: StackSlot,
dst: RegUnit,
},
Trap {
opcode: Opcode,
code: TrapCode,
},
CondTrap {
opcode: Opcode,
arg: Value,
code: TrapCode,
},
IntCondTrap {
opcode: Opcode,
arg: Value,
cond: IntCC,
code: TrapCode,
},
FloatCondTrap {
opcode: Opcode,
arg: Value,
cond: FloatCC,
code: TrapCode,
},
}Variants
UnaryFields of Unary
opcode: Opcode | |
arg: Value |
UnaryImmFields of UnaryImm
opcode: Opcode | |
imm: Imm64 |
UnaryIeee32Fields of UnaryIeee32
opcode: Opcode | |
imm: Ieee32 |
UnaryIeee64Fields of UnaryIeee64
opcode: Opcode | |
imm: Ieee64 |
UnaryBoolFields of UnaryBool
opcode: Opcode | |
imm: bool |
UnaryGlobalValueFields of UnaryGlobalValue
opcode: Opcode | |
global_value: GlobalValue |
BinaryFields of Binary
opcode: Opcode | |
args: [Value; 2] |
BinaryImmFields of BinaryImm
opcode: Opcode | |
arg: Value | |
imm: Imm64 |
TernaryFields of Ternary
opcode: Opcode | |
args: [Value; 3] |
MultiAryFields of MultiAry
opcode: Opcode | |
args: ValueList |
NullAryFields of NullAry
opcode: Opcode |
InsertLaneFields of InsertLane
opcode: Opcode | |
args: [Value; 2] | |
lane: Uimm8 |
ExtractLaneFields of ExtractLane
opcode: Opcode | |
arg: Value | |
lane: Uimm8 |
IntCompareFields of IntCompare
opcode: Opcode | |
args: [Value; 2] | |
cond: IntCC |
IntCompareImmFields of IntCompareImm
opcode: Opcode | |
arg: Value | |
cond: IntCC | |
imm: Imm64 |
IntCondFields of IntCond
opcode: Opcode | |
arg: Value | |
cond: IntCC |
FloatCompareFields of FloatCompare
opcode: Opcode | |
args: [Value; 2] | |
cond: FloatCC |
FloatCondFields of FloatCond
opcode: Opcode | |
arg: Value | |
cond: FloatCC |
IntSelectFields of IntSelect
opcode: Opcode | |
args: [Value; 3] | |
cond: IntCC |
JumpFields of Jump
opcode: Opcode | |
args: ValueList | |
destination: Ebb |
BranchFields of Branch
opcode: Opcode | |
args: ValueList | |
destination: Ebb |
BranchIntFields of BranchInt
opcode: Opcode | |
args: ValueList | |
cond: IntCC | |
destination: Ebb |
BranchFloatFields of BranchFloat
opcode: Opcode | |
args: ValueList | |
cond: FloatCC | |
destination: Ebb |
BranchIcmpFields of BranchIcmp
opcode: Opcode | |
args: ValueList | |
cond: IntCC | |
destination: Ebb |
BranchTableFields of BranchTable
opcode: Opcode | |
arg: Value | |
table: JumpTable |
CallFields of Call
opcode: Opcode | |
args: ValueList | |
func_ref: FuncRef |
CallIndirectFields of CallIndirect
opcode: Opcode | |
args: ValueList | |
sig_ref: SigRef |
FuncAddrFields of FuncAddr
opcode: Opcode | |
func_ref: FuncRef |
LoadFields of Load
opcode: Opcode | |
arg: Value | |
flags: MemFlags | |
offset: Offset32 |
LoadComplexFields of LoadComplex
opcode: Opcode | |
args: ValueList | |
flags: MemFlags | |
offset: Offset32 |
StoreFields of Store
opcode: Opcode | |
args: [Value; 2] | |
flags: MemFlags | |
offset: Offset32 |
StoreComplexFields of StoreComplex
opcode: Opcode | |
args: ValueList | |
flags: MemFlags | |
offset: Offset32 |
StackLoadFields of StackLoad
opcode: Opcode | |
stack_slot: StackSlot | |
offset: Offset32 |
StackStoreFields of StackStore
opcode: Opcode | |
arg: Value | |
stack_slot: StackSlot | |
offset: Offset32 |
HeapAddrFields of HeapAddr
opcode: Opcode | |
arg: Value | |
heap: Heap | |
imm: Uimm32 |
RegMoveFields of RegMove
opcode: Opcode | |
arg: Value | |
src: RegUnit | |
dst: RegUnit |
CopySpecialFields of CopySpecial
opcode: Opcode | |
src: RegUnit | |
dst: RegUnit |
RegSpillFields of RegSpill
opcode: Opcode | |
arg: Value | |
src: RegUnit | |
dst: StackSlot |
RegFillFields of RegFill
opcode: Opcode | |
arg: Value | |
src: StackSlot | |
dst: RegUnit |
TrapFields of Trap
opcode: Opcode | |
code: TrapCode |
CondTrapFields of CondTrap
opcode: Opcode | |
arg: Value | |
code: TrapCode |
IntCondTrapFields of IntCondTrap
opcode: Opcode | |
arg: Value | |
cond: IntCC | |
code: TrapCode |
FloatCondTrapFields of FloatCondTrap
opcode: Opcode | |
arg: Value | |
cond: FloatCC | |
code: TrapCode |
Methods
impl InstructionData[src]
impl InstructionDatapub fn opcode(&self) -> Opcode[src]
pub fn opcode(&self) -> OpcodeGet the opcode of this instruction.
pub fn typevar_operand(&self, pool: &ValueListPool) -> Option<Value>[src]
pub fn typevar_operand(&self, pool: &ValueListPool) -> Option<Value>Get the controlling type variable operand.
pub fn arguments<'a>(&'a self, pool: &'a ValueListPool) -> &[Value][src]
pub fn arguments<'a>(&'a self, pool: &'a ValueListPool) -> &[Value]Get the value arguments to this instruction.
pub fn arguments_mut<'a>(
&'a mut self,
pool: &'a mut ValueListPool
) -> &mut [Value][src]
pub fn arguments_mut<'a>(
&'a mut self,
pool: &'a mut ValueListPool
) -> &mut [Value]Get mutable references to the value arguments to this instruction.
pub fn take_value_list(&mut self) -> Option<ValueList>[src]
pub fn take_value_list(&mut self) -> Option<ValueList>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]
pub fn put_value_list(&mut self, vlist: ValueList)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]
pub fn eq(&self, other: &Self, pool: &ValueListPool) -> boolCompare 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]
pub fn hash<H: Hasher>(&self, state: &mut H, pool: &ValueListPool)Hash an InstructionData.
This operation requires a reference to a ValueListPool to
hash the contents of any ValueLists.
impl InstructionData[src]
impl InstructionDataAnalyzing 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]
pub fn analyze_branch<'a>(&'a self, pool: &'a ValueListPool) -> BranchInfo<'a>Return information about the destination of a branch or jump instruction.
Any instruction that can transfer control to another EBB reveals its possible destinations here.
pub fn branch_destination(&self) -> Option<Ebb>[src]
pub fn branch_destination(&self) -> Option<Ebb>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 Ebb>[src]
pub fn branch_destination_mut(&mut self) -> Option<&mut Ebb>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]
pub fn analyze_call<'a>(&'a self, pool: &'a ValueListPool) -> CallInfo<'a>Return information about a call instruction.
Any instruction that can call another function reveals its call signature here.
Trait Implementations
impl<'a> From<&'a InstructionData> for InstructionFormat[src]
impl<'a> From<&'a InstructionData> for InstructionFormatfn from(inst: &'a InstructionData) -> Self[src]
fn from(inst: &'a InstructionData) -> SelfPerforms the conversion.
impl Clone for InstructionData[src]
impl Clone for InstructionDatafn clone(&self) -> InstructionData[src]
fn clone(&self) -> InstructionDataReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for InstructionData[src]
impl Debug for InstructionDataAuto Trait Implementations
impl Send for InstructionData
impl Send for InstructionDataimpl Sync for InstructionData
impl Sync for InstructionData