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

pub enum Opcode {
    Jump,
    Fallthrough,
    Brz,
    Brnz,
    BrIcmp,
    Brif,
    Brff,
    BrTable,
    JumpTableEntry,
    JumpTableBase,
    IndirectJumpTableBr,
    Debugtrap,
    Trap,
    Trapz,
    ResumableTrap,
    Trapnz,
    Trapif,
    Trapff,
    Return,
    FallthroughReturn,
    Call,
    CallIndirect,
    FuncAddr,
    Load,
    LoadComplex,
    Store,
    StoreComplex,
    Uload8,
    Uload8Complex,
    Sload8,
    Sload8Complex,
    Istore8,
    Istore8Complex,
    Uload16,
    Uload16Complex,
    Sload16,
    Sload16Complex,
    Istore16,
    Istore16Complex,
    Uload32,
    Uload32Complex,
    Sload32,
    Sload32Complex,
    Istore32,
    Istore32Complex,
    StackLoad,
    StackStore,
    StackAddr,
    GlobalValue,
    SymbolValue,
    HeapAddr,
    GetPinnedReg,
    SetPinnedReg,
    TableAddr,
    Iconst,
    F32const,
    F64const,
    Bconst,
    Vconst,
    Shuffle,
    Null,
    Nop,
    Select,
    Selectif,
    Bitselect,
    Copy,
    Spill,
    Fill,
    FillNop,
    Regmove,
    CopySpecial,
    CopyToSsa,
    CopyNop,
    AdjustSpDown,
    AdjustSpUpImm,
    AdjustSpDownImm,
    IfcmpSp,
    Regspill,
    Regfill,
    Safepoint,
    Vsplit,
    Vconcat,
    Vselect,
    VanyTrue,
    VallTrue,
    Splat,
    Insertlane,
    Extractlane,
    Icmp,
    IcmpImm,
    Ifcmp,
    IfcmpImm,
    Iadd,
    UaddSat,
    SaddSat,
    Isub,
    UsubSat,
    SsubSat,
    Ineg,
    Imul,
    Umulhi,
    Smulhi,
    Udiv,
    Sdiv,
    Urem,
    Srem,
    IaddImm,
    ImulImm,
    UdivImm,
    SdivImm,
    UremImm,
    SremImm,
    IrsubImm,
    IaddCin,
    IaddIfcin,
    IaddCout,
    IaddIfcout,
    IaddCarry,
    IaddIfcarry,
    IsubBin,
    IsubIfbin,
    IsubBout,
    IsubIfbout,
    IsubBorrow,
    IsubIfborrow,
    Band,
    Bor,
    Bxor,
    Bnot,
    BandNot,
    BorNot,
    BxorNot,
    BandImm,
    BorImm,
    BxorImm,
    Rotl,
    Rotr,
    RotlImm,
    RotrImm,
    Ishl,
    Ushr,
    Sshr,
    IshlImm,
    UshrImm,
    SshrImm,
    Bitrev,
    Clz,
    Cls,
    Ctz,
    Popcnt,
    Fcmp,
    Ffcmp,
    Fadd,
    Fsub,
    Fmul,
    Fdiv,
    Sqrt,
    Fma,
    Fneg,
    Fabs,
    Fcopysign,
    Fmin,
    Fmax,
    Ceil,
    Floor,
    Trunc,
    Nearest,
    IsNull,
    IsInvalid,
    Trueif,
    Trueff,
    Bitcast,
    RawBitcast,
    ScalarToVector,
    Breduce,
    Bextend,
    Bint,
    Bmask,
    Ireduce,
    Uextend,
    Sextend,
    Fpromote,
    Fdemote,
    FcvtToUint,
    FcvtToUintSat,
    FcvtToSint,
    FcvtToSintSat,
    FcvtFromUint,
    FcvtFromSint,
    Isplit,
    Iconcat,
    X86Udivmodx,
    X86Sdivmodx,
    X86Umulx,
    X86Smulx,
    X86Cvtt2si,
    X86Fmin,
    X86Fmax,
    X86Push,
    X86Pop,
    X86Bsr,
    X86Bsf,
    X86Pshufd,
    X86Pshufb,
    X86Pextr,
    X86Pinsr,
    X86Insertps,
    X86Movsd,
    X86Movlhps,
    X86Psll,
    X86Psrl,
    X86Psra,
    X86Ptest,
    X86Pmaxs,
    X86Pmaxu,
    X86Pmins,
    X86Pminu,
}

An instruction opcode.

All instructions from all supported ISAs are present.

Variants

Jump

jump block, args. (Jump)

Fallthrough

fallthrough block, args. (Jump)

Brz

brz c, block, args. (Branch) Type inferred from c.

Brnz

brnz c, block, args. (Branch) Type inferred from c.

BrIcmp

br_icmp Cond, x, y, block, args. (BranchIcmp) Type inferred from x.

Brif

brif Cond, f, block, args. (BranchInt)

Brff

brff Cond, f, block, args. (BranchFloat)

BrTable

br_table x, block, JT. (BranchTable) Type inferred from x.

JumpTableEntry

entry = jump_table_entry x, addr, Size, JT. (BranchTableEntry) Type inferred from x.

JumpTableBase

addr = jump_table_base JT. (BranchTableBase)

IndirectJumpTableBr

indirect_jump_table_br addr, JT. (IndirectJump) Type inferred from addr.

Debugtrap

debugtrap. (NullAry)

Trap

trap code. (Trap)

Trapz

trapz c, code. (CondTrap) Type inferred from c.

ResumableTrap

resumable_trap code. (Trap)

Trapnz

trapnz c, code. (CondTrap) Type inferred from c.

Trapif

trapif Cond, f, code. (IntCondTrap)

Trapff

trapff Cond, f, code. (FloatCondTrap)

Return

return rvals. (MultiAry)

FallthroughReturn

fallthrough_return rvals. (MultiAry)

Call

rvals = call FN, args. (Call)

CallIndirect

rvals = call_indirect SIG, callee, args. (CallIndirect) Type inferred from callee.

FuncAddr

addr = func_addr FN. (FuncAddr)

Load

a = load MemFlags, p, Offset. (Load)

LoadComplex

a = load_complex MemFlags, args, Offset. (LoadComplex)

Store

store MemFlags, x, p, Offset. (Store) Type inferred from x.

StoreComplex

store_complex MemFlags, x, args, Offset. (StoreComplex) Type inferred from x.

Uload8

a = uload8 MemFlags, p, Offset. (Load)

Uload8Complex

a = uload8_complex MemFlags, args, Offset. (LoadComplex)

Sload8

a = sload8 MemFlags, p, Offset. (Load)

Sload8Complex

a = sload8_complex MemFlags, args, Offset. (LoadComplex)

Istore8

istore8 MemFlags, x, p, Offset. (Store) Type inferred from x.

Istore8Complex

istore8_complex MemFlags, x, args, Offset. (StoreComplex) Type inferred from x.

Uload16

a = uload16 MemFlags, p, Offset. (Load)

Uload16Complex

a = uload16_complex MemFlags, args, Offset. (LoadComplex)

Sload16

a = sload16 MemFlags, p, Offset. (Load)

Sload16Complex

a = sload16_complex MemFlags, args, Offset. (LoadComplex)

Istore16

istore16 MemFlags, x, p, Offset. (Store) Type inferred from x.

Istore16Complex

istore16_complex MemFlags, x, args, Offset. (StoreComplex) Type inferred from x.

Uload32

a = uload32 MemFlags, p, Offset. (Load) Type inferred from p.

Uload32Complex

a = uload32_complex MemFlags, args, Offset. (LoadComplex)

Sload32

a = sload32 MemFlags, p, Offset. (Load) Type inferred from p.

Sload32Complex

a = sload32_complex MemFlags, args, Offset. (LoadComplex)

Istore32

istore32 MemFlags, x, p, Offset. (Store) Type inferred from x.

Istore32Complex

istore32_complex MemFlags, x, args, Offset. (StoreComplex)

StackLoad

a = stack_load SS, Offset. (StackLoad)

StackStore

stack_store x, SS, Offset. (StackStore) Type inferred from x.

StackAddr

addr = stack_addr SS, Offset. (StackLoad)

GlobalValue

a = global_value GV. (UnaryGlobalValue)

SymbolValue

a = symbol_value GV. (UnaryGlobalValue)

HeapAddr

addr = heap_addr H, p, Size. (HeapAddr)

GetPinnedReg

addr = get_pinned_reg. (NullAry)

SetPinnedReg

set_pinned_reg addr. (Unary) Type inferred from addr.

TableAddr

addr = table_addr T, p, Offset. (TableAddr)

Iconst

a = iconst N. (UnaryImm)

F32const

a = f32const N. (UnaryIeee32)

F64const

a = f64const N. (UnaryIeee64)

Bconst

a = bconst N. (UnaryBool)

Vconst

a = vconst N. (UnaryConst)

Shuffle

a = shuffle a, b, mask. (Shuffle) Type inferred from a.

Null

a = null. (NullAry)

Nop

nop. (NullAry)

Select

a = select c, x, y. (Ternary) Type inferred from x.

Selectif

a = selectif cc, flags, x, y. (IntSelect)

Bitselect

a = bitselect c, x, y. (Ternary) Type inferred from x.

Copy

a = copy x. (Unary) Type inferred from x.

Spill

a = spill x. (Unary) Type inferred from x.

Fill

a = fill x. (Unary) Type inferred from x.

FillNop

a = fill_nop x. (Unary) Type inferred from x.

Regmove

regmove x, src, dst. (RegMove) Type inferred from x.

CopySpecial

copy_special src, dst. (CopySpecial)

CopyToSsa

a = copy_to_ssa src. (CopyToSsa)

CopyNop

a = copy_nop x. (Unary) Type inferred from x.

AdjustSpDown

adjust_sp_down delta. (Unary) Type inferred from delta.

AdjustSpUpImm

adjust_sp_up_imm Offset. (UnaryImm)

AdjustSpDownImm

adjust_sp_down_imm Offset. (UnaryImm)

IfcmpSp

f = ifcmp_sp addr. (Unary) Type inferred from addr.

Regspill

regspill x, src, SS. (RegSpill) Type inferred from x.

Regfill

regfill x, SS, dst. (RegFill) Type inferred from x.

Safepoint

safepoint args. (MultiAry)

Vsplit

lo, hi = vsplit x. (Unary) Type inferred from x.

Vconcat

a = vconcat x, y. (Binary) Type inferred from x.

Vselect

a = vselect c, x, y. (Ternary) Type inferred from x.

VanyTrue

s = vany_true a. (Unary) Type inferred from a.

VallTrue

s = vall_true a. (Unary) Type inferred from a.

Splat

a = splat x. (Unary)

Insertlane

a = insertlane x, Idx, y. (InsertLane) Type inferred from x.

Extractlane

a = extractlane x, Idx. (ExtractLane) Type inferred from x.

Icmp

a = icmp Cond, x, y. (IntCompare) Type inferred from x.

IcmpImm

a = icmp_imm Cond, x, Y. (IntCompareImm) Type inferred from x.

Ifcmp

f = ifcmp x, y. (Binary) Type inferred from x.

IfcmpImm

f = ifcmp_imm x, Y. (BinaryImm) Type inferred from x.

Iadd

a = iadd x, y. (Binary) Type inferred from x.

UaddSat

a = uadd_sat x, y. (Binary) Type inferred from x.

SaddSat

a = sadd_sat x, y. (Binary) Type inferred from x.

Isub

a = isub x, y. (Binary) Type inferred from x.

UsubSat

a = usub_sat x, y. (Binary) Type inferred from x.

SsubSat

a = ssub_sat x, y. (Binary) Type inferred from x.

Ineg

a = ineg x. (Unary) Type inferred from x.

Imul

a = imul x, y. (Binary) Type inferred from x.

Umulhi

a = umulhi x, y. (Binary) Type inferred from x.

Smulhi

a = smulhi x, y. (Binary) Type inferred from x.

Udiv

a = udiv x, y. (Binary) Type inferred from x.

Sdiv

a = sdiv x, y. (Binary) Type inferred from x.

Urem

a = urem x, y. (Binary) Type inferred from x.

Srem

a = srem x, y. (Binary) Type inferred from x.

IaddImm

a = iadd_imm x, Y. (BinaryImm) Type inferred from x.

ImulImm

a = imul_imm x, Y. (BinaryImm) Type inferred from x.

UdivImm

a = udiv_imm x, Y. (BinaryImm) Type inferred from x.

SdivImm

a = sdiv_imm x, Y. (BinaryImm) Type inferred from x.

UremImm

a = urem_imm x, Y. (BinaryImm) Type inferred from x.

SremImm

a = srem_imm x, Y. (BinaryImm) Type inferred from x.

IrsubImm

a = irsub_imm x, Y. (BinaryImm) Type inferred from x.

IaddCin

a = iadd_cin x, y, c_in. (Ternary) Type inferred from y.

IaddIfcin

a = iadd_ifcin x, y, c_in. (Ternary) Type inferred from y.

IaddCout

a, c_out = iadd_cout x, y. (Binary) Type inferred from x.

IaddIfcout

a, c_out = iadd_ifcout x, y. (Binary) Type inferred from x.

IaddCarry

a, c_out = iadd_carry x, y, c_in. (Ternary) Type inferred from y.

IaddIfcarry

a, c_out = iadd_ifcarry x, y, c_in. (Ternary) Type inferred from y.

IsubBin

a = isub_bin x, y, b_in. (Ternary) Type inferred from y.

IsubIfbin

a = isub_ifbin x, y, b_in. (Ternary) Type inferred from y.

IsubBout

a, b_out = isub_bout x, y. (Binary) Type inferred from x.

IsubIfbout

a, b_out = isub_ifbout x, y. (Binary) Type inferred from x.

IsubBorrow

a, b_out = isub_borrow x, y, b_in. (Ternary) Type inferred from y.

IsubIfborrow

a, b_out = isub_ifborrow x, y, b_in. (Ternary) Type inferred from y.

Band

a = band x, y. (Binary) Type inferred from x.

Bor

a = bor x, y. (Binary) Type inferred from x.

Bxor

a = bxor x, y. (Binary) Type inferred from x.

Bnot

a = bnot x. (Unary) Type inferred from x.

BandNot

a = band_not x, y. (Binary) Type inferred from x.

BorNot

a = bor_not x, y. (Binary) Type inferred from x.

BxorNot

a = bxor_not x, y. (Binary) Type inferred from x.

BandImm

a = band_imm x, Y. (BinaryImm) Type inferred from x.

BorImm

a = bor_imm x, Y. (BinaryImm) Type inferred from x.

BxorImm

a = bxor_imm x, Y. (BinaryImm) Type inferred from x.

Rotl

a = rotl x, y. (Binary) Type inferred from x.

Rotr

a = rotr x, y. (Binary) Type inferred from x.

RotlImm

a = rotl_imm x, Y. (BinaryImm) Type inferred from x.

RotrImm

a = rotr_imm x, Y. (BinaryImm) Type inferred from x.

Ishl

a = ishl x, y. (Binary) Type inferred from x.

Ushr

a = ushr x, y. (Binary) Type inferred from x.

Sshr

a = sshr x, y. (Binary) Type inferred from x.

IshlImm

a = ishl_imm x, Y. (BinaryImm) Type inferred from x.

UshrImm

a = ushr_imm x, Y. (BinaryImm) Type inferred from x.

SshrImm

a = sshr_imm x, Y. (BinaryImm) Type inferred from x.

Bitrev

a = bitrev x. (Unary) Type inferred from x.

Clz

a = clz x. (Unary) Type inferred from x.

Cls

a = cls x. (Unary) Type inferred from x.

Ctz

a = ctz x. (Unary) Type inferred from x.

Popcnt

a = popcnt x. (Unary) Type inferred from x.

Fcmp

a = fcmp Cond, x, y. (FloatCompare) Type inferred from x.

Ffcmp

f = ffcmp x, y. (Binary) Type inferred from x.

Fadd

a = fadd x, y. (Binary) Type inferred from x.

Fsub

a = fsub x, y. (Binary) Type inferred from x.

Fmul

a = fmul x, y. (Binary) Type inferred from x.

Fdiv

a = fdiv x, y. (Binary) Type inferred from x.

Sqrt

a = sqrt x. (Unary) Type inferred from x.

Fma

a = fma x, y, z. (Ternary) Type inferred from y.

Fneg

a = fneg x. (Unary) Type inferred from x.

Fabs

a = fabs x. (Unary) Type inferred from x.

Fcopysign

a = fcopysign x, y. (Binary) Type inferred from x.

Fmin

a = fmin x, y. (Binary) Type inferred from x.

Fmax

a = fmax x, y. (Binary) Type inferred from x.

Ceil

a = ceil x. (Unary) Type inferred from x.

Floor

a = floor x. (Unary) Type inferred from x.

Trunc

a = trunc x. (Unary) Type inferred from x.

Nearest

a = nearest x. (Unary) Type inferred from x.

IsNull

a = is_null x. (Unary) Type inferred from x.

IsInvalid

a = is_invalid x. (Unary) Type inferred from x.

Trueif

a = trueif Cond, f. (IntCond)

Trueff

a = trueff Cond, f. (FloatCond)

Bitcast

a = bitcast x. (Unary)

RawBitcast

a = raw_bitcast x. (Unary)

ScalarToVector

a = scalar_to_vector s. (Unary)

Breduce

a = breduce x. (Unary)

Bextend

a = bextend x. (Unary)

Bint

a = bint x. (Unary)

Bmask

a = bmask x. (Unary)

Ireduce

a = ireduce x. (Unary)

Uextend

a = uextend x. (Unary)

Sextend

a = sextend x. (Unary)

Fpromote

a = fpromote x. (Unary)

Fdemote

a = fdemote x. (Unary)

FcvtToUint

a = fcvt_to_uint x. (Unary)

FcvtToUintSat

a = fcvt_to_uint_sat x. (Unary)

FcvtToSint

a = fcvt_to_sint x. (Unary)

FcvtToSintSat

a = fcvt_to_sint_sat x. (Unary)

FcvtFromUint

a = fcvt_from_uint x. (Unary)

FcvtFromSint

a = fcvt_from_sint x. (Unary)

Isplit

lo, hi = isplit x. (Unary) Type inferred from x.

Iconcat

a = iconcat lo, hi. (Binary) Type inferred from lo.

X86Udivmodx

q, r = x86_udivmodx nlo, nhi, d. (Ternary) Type inferred from nhi.

X86Sdivmodx

q, r = x86_sdivmodx nlo, nhi, d. (Ternary) Type inferred from nhi.

X86Umulx

resLo, resHi = x86_umulx argL, argR. (Binary) Type inferred from argL.

X86Smulx

resLo, resHi = x86_smulx argL, argR. (Binary) Type inferred from argL.

X86Cvtt2si

a = x86_cvtt2si x. (Unary)

X86Fmin

a = x86_fmin x, y. (Binary) Type inferred from x.

X86Fmax

a = x86_fmax x, y. (Binary) Type inferred from x.

X86Push

x86_push x. (Unary) Type inferred from x.

X86Pop

x = x86_pop. (NullAry)

X86Bsr

y, rflags = x86_bsr x. (Unary) Type inferred from x.

X86Bsf

y, rflags = x86_bsf x. (Unary) Type inferred from x.

X86Pshufd

a = x86_pshufd a, i. (ExtractLane) Type inferred from a.

X86Pshufb

a = x86_pshufb a, b. (Binary) Type inferred from a.

X86Pextr

a = x86_pextr x, Idx. (ExtractLane) Type inferred from x.

X86Pinsr

a = x86_pinsr x, Idx, y. (InsertLane) Type inferred from x.

X86Insertps

a = x86_insertps x, Idx, y. (InsertLane) Type inferred from x.

X86Movsd

a = x86_movsd x, y. (Binary) Type inferred from x.

X86Movlhps

a = x86_movlhps x, y. (Binary) Type inferred from x.

X86Psll

a = x86_psll x, y. (Binary) Type inferred from x.

X86Psrl

a = x86_psrl x, y. (Binary) Type inferred from x.

X86Psra

a = x86_psra x, y. (Binary) Type inferred from x.

X86Ptest

f = x86_ptest x, y. (Binary) Type inferred from x.

X86Pmaxs

a = x86_pmaxs x, y. (Binary) Type inferred from x.

X86Pmaxu

a = x86_pmaxu x, y. (Binary) Type inferred from x.

X86Pmins

a = x86_pmins x, y. (Binary) Type inferred from x.

X86Pminu

a = x86_pminu x, y. (Binary) Type inferred from x.

Methods

impl Opcode[src]

pub fn is_terminator(self) -> bool[src]

True for instructions that terminate the block

pub fn is_branch(self) -> bool[src]

True for all branch or jump instructions.

pub fn is_indirect_branch(self) -> bool[src]

True for all indirect branch or jump instructions.

pub fn is_call(self) -> bool[src]

Is this a call instruction?

pub fn is_return(self) -> bool[src]

Is this a return instruction?

pub fn is_ghost(self) -> bool[src]

Is this a ghost instruction?

pub fn can_load(self) -> bool[src]

Can this instruction read from memory?

pub fn can_store(self) -> bool[src]

Can this instruction write to memory?

pub fn can_trap(self) -> bool[src]

Can this instruction cause a trap?

pub fn other_side_effects(self) -> bool[src]

Does this instruction have other side effects besides can_* flags?

pub fn writes_cpu_flags(self) -> bool[src]

Does this instruction write to CPU flags?

impl Opcode[src]

pub fn format(self) -> InstructionFormat[src]

Get the instruction format for this opcode.

pub fn constraints(self) -> OpcodeConstraints[src]

Get the constraint descriptor for this opcode. Panic if this is called on NotAnOpcode.

Trait Implementations

impl Clone for Opcode[src]

impl Copy for Opcode[src]

impl Debug for Opcode[src]

impl Display for Opcode[src]

impl Eq for Opcode[src]

impl FromStr for Opcode[src]

type Err = &'static str

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, &'static str>[src]

Parse an Opcode name from a string.

impl Hash for Opcode[src]

impl PartialEq<Opcode> for Opcode[src]

impl StructuralEq for Opcode[src]

impl StructuralPartialEq for Opcode[src]

Auto Trait Implementations

impl RefUnwindSafe for Opcode

impl Send for Opcode

impl Sync for Opcode

impl Unpin for Opcode

impl UnwindSafe for Opcode

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?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> ToString for T where
    T: Display + ?Sized
[src]

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.