#[repr(u8)]
pub enum Opcode {
Show 185 variants Jump, Brif, BrTable, Debugtrap, Trap, Trapz, ResumableTrap, Trapnz, ResumableTrapnz, Return, Call, CallIndirect, ReturnCall, ReturnCallIndirect, FuncAddr, Splat, Swizzle, X86Pshufb, Insertlane, Extractlane, Smin, Umin, Smax, Umax, AvgRound, UaddSat, SaddSat, UsubSat, SsubSat, Load, Store, Uload8, Sload8, Istore8, Uload16, Sload16, Istore16, Uload32, Sload32, Istore32, Uload8x8, Sload8x8, Uload16x4, Sload16x4, Uload32x2, Sload32x2, StackLoad, StackStore, StackAddr, DynamicStackLoad, DynamicStackStore, DynamicStackAddr, GlobalValue, SymbolValue, TlsValue, GetPinnedReg, SetPinnedReg, GetFramePointer, GetStackPointer, GetReturnAddress, TableAddr, Iconst, F32const, F64const, Vconst, Shuffle, Null, Nop, Select, SelectSpectreGuard, Bitselect, X86Blendv, VanyTrue, VallTrue, VhighBits, Icmp, IcmpImm, Iadd, Isub, Ineg, Iabs, Imul, Umulhi, Smulhi, SqmulRoundSat, X86Pmulhrsw, Udiv, Sdiv, Urem, Srem, IaddImm, ImulImm, UdivImm, SdivImm, UremImm, SremImm, IrsubImm, IaddCin, IaddCout, IaddCarry, UaddOverflowTrap, IsubBin, IsubBout, IsubBorrow, Band, Bor, Bxor, Bnot, BandNot, BorNot, BxorNot, BandImm, BorImm, BxorImm, Rotl, Rotr, RotlImm, RotrImm, Ishl, Ushr, Sshr, IshlImm, UshrImm, SshrImm, Bitrev, Clz, Cls, Ctz, Bswap, Popcnt, Fcmp, Fadd, Fsub, Fmul, Fdiv, Sqrt, Fma, Fneg, Fabs, Fcopysign, Fmin, FminPseudo, Fmax, FmaxPseudo, Ceil, Floor, Trunc, Nearest, IsNull, IsInvalid, Bitcast, ScalarToVector, Bmask, Ireduce, Snarrow, Unarrow, Uunarrow, SwidenLow, SwidenHigh, UwidenLow, UwidenHigh, IaddPairwise, X86Pmaddubsw, Uextend, Sextend, Fpromote, Fdemote, Fvdemote, FvpromoteLow, FcvtToUint, FcvtToSint, FcvtToUintSat, FcvtToSintSat, X86Cvtt2dq, FcvtFromUint, FcvtFromSint, FcvtLowFromSint, Isplit, Iconcat, AtomicRmw, AtomicCas, AtomicLoad, AtomicStore, Fence, ExtractVector,
}
Expand description

An instruction opcode.

All instructions from all supported ISAs are present.

Variants§

§

Jump

jump block_call. (Jump)

§

Brif

brif c, block_then, block_else. (Brif) Type inferred from c.

§

BrTable

br_table x, JT. (BranchTable)

§

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.

§

ResumableTrapnz

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

§

Return

return rvals. (MultiAry)

§

Call

rvals = call FN, args. (Call)

§

CallIndirect

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

§

ReturnCall

return_call FN, args. (Call)

§

ReturnCallIndirect

return_call_indirect SIG, callee, args. (CallIndirect) Type inferred from callee.

§

FuncAddr

addr = func_addr FN. (FuncAddr)

§

Splat

a = splat x. (Unary)

§

Swizzle

a = swizzle x, y. (Binary)

§

X86Pshufb

a = x86_pshufb x, y. (Binary)

§

Insertlane

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

§

Extractlane

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

§

Smin

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

§

Umin

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

§

Smax

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

§

Umax

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

§

AvgRound

a = avg_round 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.

§

UsubSat

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

§

SsubSat

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

§

Load

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

§

Store

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

§

Uload8

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

§

Sload8

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

§

Istore8

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

§

Uload16

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

§

Sload16

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

§

Istore16

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

§

Uload32

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

§

Sload32

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

§

Istore32

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

§

Uload8x8

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

§

Sload8x8

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

§

Uload16x4

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

§

Sload16x4

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

§

Uload32x2

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

§

Sload32x2

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

§

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)

§

DynamicStackLoad

a = dynamic_stack_load DSS. (DynamicStackLoad)

§

DynamicStackStore

dynamic_stack_store x, DSS. (DynamicStackStore) Type inferred from x.

§

DynamicStackAddr

addr = dynamic_stack_addr DSS. (DynamicStackLoad)

§

GlobalValue

a = global_value GV. (UnaryGlobalValue)

§

SymbolValue

a = symbol_value GV. (UnaryGlobalValue)

§

TlsValue

a = tls_value GV. (UnaryGlobalValue)

§

GetPinnedReg

addr = get_pinned_reg. (NullAry)

§

SetPinnedReg

set_pinned_reg addr. (Unary) Type inferred from addr.

§

GetFramePointer

addr = get_frame_pointer. (NullAry)

§

GetStackPointer

addr = get_stack_pointer. (NullAry)

§

GetReturnAddress

addr = get_return_address. (NullAry)

§

TableAddr

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

§

Iconst

a = iconst N. (UnaryImm)

§

F32const

a = f32const N. (UnaryIeee32)

§

F64const

a = f64const N. (UnaryIeee64)

§

Vconst

a = vconst N. (UnaryConst)

§

Shuffle

a = shuffle a, b, mask. (Shuffle)

§

Null

a = null. (NullAry)

§

Nop

nop. (NullAry)

§

Select

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

§

SelectSpectreGuard

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

§

Bitselect

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

§

X86Blendv

a = x86_blendv 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.

§

VhighBits

x = vhigh_bits a. (Unary)

§

Icmp

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

§

IcmpImm

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

§

Iadd

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

§

Isub

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

§

Ineg

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

§

Iabs

a = iabs 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.

§

SqmulRoundSat

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

§

X86Pmulhrsw

a = x86_pmulhrsw 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. (BinaryImm64) Type inferred from x.

§

ImulImm

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

§

UdivImm

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

§

SdivImm

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

§

UremImm

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

§

SremImm

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

§

IrsubImm

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

§

IaddCin

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

§

IaddCout

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

§

IaddCarry

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

§

UaddOverflowTrap

a = uadd_overflow_trap x, y, code. (IntAddTrap) Type inferred from x.

§

IsubBin

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

§

IsubBout

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

§

IsubBorrow

a, b_out = isub_borrow 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. (BinaryImm64) Type inferred from x.

§

BorImm

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

§

BxorImm

a = bxor_imm x, Y. (BinaryImm64) 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. (BinaryImm64) Type inferred from x.

§

RotrImm

a = rotr_imm x, Y. (BinaryImm64) 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. (BinaryImm64) Type inferred from x.

§

UshrImm

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

§

SshrImm

a = sshr_imm x, Y. (BinaryImm64) 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.

§

Bswap

a = bswap 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.

§

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.

§

FminPseudo

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

§

Fmax

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

§

FmaxPseudo

a = fmax_pseudo 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.

§

Bitcast

a = bitcast MemFlags, x. (LoadNoOffset)

§

ScalarToVector

a = scalar_to_vector s. (Unary)

§

Bmask

a = bmask x. (Unary)

§

Ireduce

a = ireduce x. (Unary)

§

Snarrow

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

§

Unarrow

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

§

Uunarrow

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

§

SwidenLow

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

§

SwidenHigh

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

§

UwidenLow

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

§

UwidenHigh

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

§

IaddPairwise

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

§

X86Pmaddubsw

a = x86_pmaddubsw x, y. (Binary)

§

Uextend

a = uextend x. (Unary)

§

Sextend

a = sextend x. (Unary)

§

Fpromote

a = fpromote x. (Unary)

§

Fdemote

a = fdemote x. (Unary)

§

Fvdemote

a = fvdemote x. (Unary)

§

FvpromoteLow

x = fvpromote_low a. (Unary)

§

FcvtToUint

a = fcvt_to_uint x. (Unary)

§

FcvtToSint

a = fcvt_to_sint x. (Unary)

§

FcvtToUintSat

a = fcvt_to_uint_sat x. (Unary)

§

FcvtToSintSat

a = fcvt_to_sint_sat x. (Unary)

§

X86Cvtt2dq

a = x86_cvtt2dq x. (Unary)

§

FcvtFromUint

a = fcvt_from_uint x. (Unary)

§

FcvtFromSint

a = fcvt_from_sint x. (Unary)

§

FcvtLowFromSint

a = fcvt_low_from_sint x. (Unary)

§

Isplit

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

§

Iconcat

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

§

AtomicRmw

a = atomic_rmw MemFlags, AtomicRmwOp, p, x. (AtomicRmw)

§

AtomicCas

a = atomic_cas MemFlags, p, e, x. (AtomicCas) Type inferred from x.

§

AtomicLoad

a = atomic_load MemFlags, p. (LoadNoOffset)

§

AtomicStore

atomic_store MemFlags, x, p. (StoreNoOffset) Type inferred from x.

§

Fence

fence. (NullAry)

§

ExtractVector

a = extract_vector x, y. (BinaryImm8) Type inferred from x.

Implementations§

source§

impl Opcode

source

pub fn is_terminator(self) -> bool

True for instructions that terminate the block

source

pub fn is_branch(self) -> bool

True for all branch or jump instructions.

source

pub fn is_call(self) -> bool

Is this a call instruction?

source

pub fn is_return(self) -> bool

Is this a return instruction?

source

pub fn can_load(self) -> bool

Can this instruction read from memory?

source

pub fn can_store(self) -> bool

Can this instruction write to memory?

source

pub fn can_trap(self) -> bool

Can this instruction cause a trap?

source

pub fn other_side_effects(self) -> bool

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

source

pub fn side_effects_idempotent(self) -> bool

Despite having side effects, is this instruction okay to GVN?

source

pub fn all() -> &'static [Opcode]

All cranelift opcodes.

source§

impl Opcode

source

pub fn format(self) -> InstructionFormat

Get the instruction format for this opcode.

source

pub fn constraints(self) -> OpcodeConstraints

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

source

pub fn is_resumable_trap(&self) -> bool

Returns true if the instruction is a resumable trap.

Trait Implementations§

source§

impl Clone for Opcode

source§

fn clone(&self) -> Opcode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Opcode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Opcode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for Opcode

source§

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

Parse an Opcode name from a string.

§

type Err = &'static str

The associated error which can be returned from parsing.
source§

impl Hash for Opcode

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<Opcode> for Opcode

source§

fn eq(&self, other: &Opcode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Opcode

source§

impl Eq for Opcode

source§

impl StructuralEq for Opcode

source§

impl StructuralPartialEq for Opcode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.