#[repr(u8)]pub enum Opcode {
Show 183 variants
Jump = 1,
Brif = 2,
BrTable = 3,
Debugtrap = 4,
Trap = 5,
Trapz = 6,
Trapnz = 7,
Return = 8,
Call = 9,
CallIndirect = 10,
ReturnCall = 11,
ReturnCallIndirect = 12,
FuncAddr = 13,
Splat = 14,
Swizzle = 15,
X86Pshufb = 16,
Insertlane = 17,
Extractlane = 18,
Smin = 19,
Umin = 20,
Smax = 21,
Umax = 22,
AvgRound = 23,
UaddSat = 24,
SaddSat = 25,
UsubSat = 26,
SsubSat = 27,
Load = 28,
Store = 29,
Uload8 = 30,
Sload8 = 31,
Istore8 = 32,
Uload16 = 33,
Sload16 = 34,
Istore16 = 35,
Uload32 = 36,
Sload32 = 37,
Istore32 = 38,
StackSwitch = 39,
Uload8x8 = 40,
Sload8x8 = 41,
Uload16x4 = 42,
Sload16x4 = 43,
Uload32x2 = 44,
Sload32x2 = 45,
StackLoad = 46,
StackStore = 47,
StackAddr = 48,
DynamicStackLoad = 49,
DynamicStackStore = 50,
DynamicStackAddr = 51,
GlobalValue = 52,
SymbolValue = 53,
TlsValue = 54,
GetPinnedReg = 55,
SetPinnedReg = 56,
GetFramePointer = 57,
GetStackPointer = 58,
GetReturnAddress = 59,
Iconst = 60,
F16const = 61,
F32const = 62,
F64const = 63,
F128const = 64,
Vconst = 65,
Shuffle = 66,
Nop = 67,
Select = 68,
SelectSpectreGuard = 69,
Bitselect = 70,
X86Blendv = 71,
VanyTrue = 72,
VallTrue = 73,
VhighBits = 74,
Icmp = 75,
IcmpImm = 76,
Iadd = 77,
Isub = 78,
Ineg = 79,
Iabs = 80,
Imul = 81,
Umulhi = 82,
Smulhi = 83,
SqmulRoundSat = 84,
X86Pmulhrsw = 85,
Udiv = 86,
Sdiv = 87,
Urem = 88,
Srem = 89,
IaddImm = 90,
ImulImm = 91,
UdivImm = 92,
SdivImm = 93,
UremImm = 94,
SremImm = 95,
IrsubImm = 96,
SaddOverflowCin = 97,
UaddOverflowCin = 98,
UaddOverflow = 99,
SaddOverflow = 100,
UsubOverflow = 101,
SsubOverflow = 102,
UmulOverflow = 103,
SmulOverflow = 104,
UaddOverflowTrap = 105,
SsubOverflowBin = 106,
UsubOverflowBin = 107,
Band = 108,
Bor = 109,
Bxor = 110,
Bnot = 111,
BandNot = 112,
BorNot = 113,
BxorNot = 114,
BandImm = 115,
BorImm = 116,
BxorImm = 117,
Rotl = 118,
Rotr = 119,
RotlImm = 120,
RotrImm = 121,
Ishl = 122,
Ushr = 123,
Sshr = 124,
IshlImm = 125,
UshrImm = 126,
SshrImm = 127,
Bitrev = 128,
Clz = 129,
Cls = 130,
Ctz = 131,
Bswap = 132,
Popcnt = 133,
Fcmp = 134,
Fadd = 135,
Fsub = 136,
Fmul = 137,
Fdiv = 138,
Sqrt = 139,
Fma = 140,
Fneg = 141,
Fabs = 142,
Fcopysign = 143,
Fmin = 144,
Fmax = 145,
Ceil = 146,
Floor = 147,
Trunc = 148,
Nearest = 149,
Bitcast = 150,
ScalarToVector = 151,
Bmask = 152,
Ireduce = 153,
Snarrow = 154,
Unarrow = 155,
Uunarrow = 156,
SwidenLow = 157,
SwidenHigh = 158,
UwidenLow = 159,
UwidenHigh = 160,
IaddPairwise = 161,
X86Pmaddubsw = 162,
Uextend = 163,
Sextend = 164,
Fpromote = 165,
Fdemote = 166,
Fvdemote = 167,
FvpromoteLow = 168,
FcvtToUint = 169,
FcvtToSint = 170,
FcvtToUintSat = 171,
FcvtToSintSat = 172,
X86Cvtt2dq = 173,
FcvtFromUint = 174,
FcvtFromSint = 175,
Isplit = 176,
Iconcat = 177,
AtomicRmw = 178,
AtomicCas = 179,
AtomicLoad = 180,
AtomicStore = 181,
Fence = 182,
ExtractVector = 183,
}
Expand description
An instruction opcode.
All instructions from all supported ISAs are present.
Variants§
Jump = 1
jump block_call
. (Jump)
Brif = 2
brif c, block_then, block_else
. (Brif)
Type inferred from c
.
BrTable = 3
br_table x, JT
. (BranchTable)
Debugtrap = 4
debugtrap
. (NullAry)
Trap = 5
trap code
. (Trap)
Trapz = 6
trapz c, code
. (CondTrap)
Type inferred from c
.
Trapnz = 7
trapnz c, code
. (CondTrap)
Type inferred from c
.
Return = 8
return rvals
. (MultiAry)
Call = 9
rvals = call FN, args
. (Call)
CallIndirect = 10
rvals = call_indirect SIG, callee, args
. (CallIndirect)
Type inferred from callee
.
ReturnCall = 11
return_call FN, args
. (Call)
ReturnCallIndirect = 12
return_call_indirect SIG, callee, args
. (CallIndirect)
Type inferred from callee
.
FuncAddr = 13
addr = func_addr FN
. (FuncAddr)
Splat = 14
a = splat x
. (Unary)
Swizzle = 15
a = swizzle x, y
. (Binary)
X86Pshufb = 16
a = x86_pshufb x, y
. (Binary)
Insertlane = 17
a = insertlane x, y, Idx
. (TernaryImm8)
Type inferred from x
.
Extractlane = 18
a = extractlane x, Idx
. (BinaryImm8)
Type inferred from x
.
Smin = 19
a = smin x, y
. (Binary)
Type inferred from x
.
Umin = 20
a = umin x, y
. (Binary)
Type inferred from x
.
Smax = 21
a = smax x, y
. (Binary)
Type inferred from x
.
Umax = 22
a = umax x, y
. (Binary)
Type inferred from x
.
AvgRound = 23
a = avg_round x, y
. (Binary)
Type inferred from x
.
UaddSat = 24
a = uadd_sat x, y
. (Binary)
Type inferred from x
.
SaddSat = 25
a = sadd_sat x, y
. (Binary)
Type inferred from x
.
UsubSat = 26
a = usub_sat x, y
. (Binary)
Type inferred from x
.
SsubSat = 27
a = ssub_sat x, y
. (Binary)
Type inferred from x
.
Load = 28
a = load MemFlags, p, Offset
. (Load)
Store = 29
store MemFlags, x, p, Offset
. (Store)
Type inferred from x
.
Uload8 = 30
a = uload8 MemFlags, p, Offset
. (Load)
Sload8 = 31
a = sload8 MemFlags, p, Offset
. (Load)
Istore8 = 32
istore8 MemFlags, x, p, Offset
. (Store)
Type inferred from x
.
Uload16 = 33
a = uload16 MemFlags, p, Offset
. (Load)
Sload16 = 34
a = sload16 MemFlags, p, Offset
. (Load)
Istore16 = 35
istore16 MemFlags, x, p, Offset
. (Store)
Type inferred from x
.
Uload32 = 36
a = uload32 MemFlags, p, Offset
. (Load)
Type inferred from p
.
Sload32 = 37
a = sload32 MemFlags, p, Offset
. (Load)
Type inferred from p
.
Istore32 = 38
istore32 MemFlags, x, p, Offset
. (Store)
Type inferred from x
.
StackSwitch = 39
out_payload0 = stack_switch store_context_ptr, load_context_ptr, in_payload0
. (Ternary)
Type inferred from load_context_ptr
.
Uload8x8 = 40
a = uload8x8 MemFlags, p, Offset
. (Load)
Type inferred from p
.
Sload8x8 = 41
a = sload8x8 MemFlags, p, Offset
. (Load)
Type inferred from p
.
Uload16x4 = 42
a = uload16x4 MemFlags, p, Offset
. (Load)
Type inferred from p
.
Sload16x4 = 43
a = sload16x4 MemFlags, p, Offset
. (Load)
Type inferred from p
.
Uload32x2 = 44
a = uload32x2 MemFlags, p, Offset
. (Load)
Type inferred from p
.
Sload32x2 = 45
a = sload32x2 MemFlags, p, Offset
. (Load)
Type inferred from p
.
StackLoad = 46
a = stack_load SS, Offset
. (StackLoad)
StackStore = 47
stack_store x, SS, Offset
. (StackStore)
Type inferred from x
.
StackAddr = 48
addr = stack_addr SS, Offset
. (StackLoad)
DynamicStackLoad = 49
a = dynamic_stack_load DSS
. (DynamicStackLoad)
DynamicStackStore = 50
dynamic_stack_store x, DSS
. (DynamicStackStore)
Type inferred from x
.
DynamicStackAddr = 51
addr = dynamic_stack_addr DSS
. (DynamicStackLoad)
GlobalValue = 52
a = global_value GV
. (UnaryGlobalValue)
SymbolValue = 53
a = symbol_value GV
. (UnaryGlobalValue)
TlsValue = 54
a = tls_value GV
. (UnaryGlobalValue)
GetPinnedReg = 55
addr = get_pinned_reg
. (NullAry)
SetPinnedReg = 56
set_pinned_reg addr
. (Unary)
Type inferred from addr
.
GetFramePointer = 57
addr = get_frame_pointer
. (NullAry)
GetStackPointer = 58
addr = get_stack_pointer
. (NullAry)
GetReturnAddress = 59
addr = get_return_address
. (NullAry)
Iconst = 60
a = iconst N
. (UnaryImm)
F16const = 61
a = f16const N
. (UnaryIeee16)
F32const = 62
a = f32const N
. (UnaryIeee32)
F64const = 63
a = f64const N
. (UnaryIeee64)
F128const = 64
a = f128const N
. (UnaryConst)
Vconst = 65
a = vconst N
. (UnaryConst)
Shuffle = 66
a = shuffle a, b, mask
. (Shuffle)
Nop = 67
nop
. (NullAry)
Select = 68
a = select c, x, y
. (Ternary)
Type inferred from x
.
SelectSpectreGuard = 69
a = select_spectre_guard c, x, y
. (Ternary)
Type inferred from x
.
Bitselect = 70
a = bitselect c, x, y
. (Ternary)
Type inferred from x
.
X86Blendv = 71
a = x86_blendv c, x, y
. (Ternary)
Type inferred from x
.
VanyTrue = 72
s = vany_true a
. (Unary)
Type inferred from a
.
VallTrue = 73
s = vall_true a
. (Unary)
Type inferred from a
.
VhighBits = 74
x = vhigh_bits a
. (Unary)
Icmp = 75
a = icmp Cond, x, y
. (IntCompare)
Type inferred from x
.
IcmpImm = 76
a = icmp_imm Cond, x, Y
. (IntCompareImm)
Type inferred from x
.
Iadd = 77
a = iadd x, y
. (Binary)
Type inferred from x
.
Isub = 78
a = isub x, y
. (Binary)
Type inferred from x
.
Ineg = 79
a = ineg x
. (Unary)
Type inferred from x
.
Iabs = 80
a = iabs x
. (Unary)
Type inferred from x
.
Imul = 81
a = imul x, y
. (Binary)
Type inferred from x
.
Umulhi = 82
a = umulhi x, y
. (Binary)
Type inferred from x
.
Smulhi = 83
a = smulhi x, y
. (Binary)
Type inferred from x
.
SqmulRoundSat = 84
a = sqmul_round_sat x, y
. (Binary)
Type inferred from x
.
X86Pmulhrsw = 85
a = x86_pmulhrsw x, y
. (Binary)
Type inferred from x
.
Udiv = 86
a = udiv x, y
. (Binary)
Type inferred from x
.
Sdiv = 87
a = sdiv x, y
. (Binary)
Type inferred from x
.
Urem = 88
a = urem x, y
. (Binary)
Type inferred from x
.
Srem = 89
a = srem x, y
. (Binary)
Type inferred from x
.
IaddImm = 90
a = iadd_imm x, Y
. (BinaryImm64)
Type inferred from x
.
ImulImm = 91
a = imul_imm x, Y
. (BinaryImm64)
Type inferred from x
.
UdivImm = 92
a = udiv_imm x, Y
. (BinaryImm64)
Type inferred from x
.
SdivImm = 93
a = sdiv_imm x, Y
. (BinaryImm64)
Type inferred from x
.
UremImm = 94
a = urem_imm x, Y
. (BinaryImm64)
Type inferred from x
.
SremImm = 95
a = srem_imm x, Y
. (BinaryImm64)
Type inferred from x
.
IrsubImm = 96
a = irsub_imm x, Y
. (BinaryImm64)
Type inferred from x
.
SaddOverflowCin = 97
a, c_out = sadd_overflow_cin x, y, c_in
. (Ternary)
Type inferred from y
.
UaddOverflowCin = 98
a, c_out = uadd_overflow_cin x, y, c_in
. (Ternary)
Type inferred from y
.
UaddOverflow = 99
a, of = uadd_overflow x, y
. (Binary)
Type inferred from x
.
SaddOverflow = 100
a, of = sadd_overflow x, y
. (Binary)
Type inferred from x
.
UsubOverflow = 101
a, of = usub_overflow x, y
. (Binary)
Type inferred from x
.
SsubOverflow = 102
a, of = ssub_overflow x, y
. (Binary)
Type inferred from x
.
UmulOverflow = 103
a, of = umul_overflow x, y
. (Binary)
Type inferred from x
.
SmulOverflow = 104
a, of = smul_overflow x, y
. (Binary)
Type inferred from x
.
UaddOverflowTrap = 105
a = uadd_overflow_trap x, y, code
. (IntAddTrap)
Type inferred from x
.
SsubOverflowBin = 106
a, b_out = ssub_overflow_bin x, y, b_in
. (Ternary)
Type inferred from y
.
UsubOverflowBin = 107
a, b_out = usub_overflow_bin x, y, b_in
. (Ternary)
Type inferred from y
.
Band = 108
a = band x, y
. (Binary)
Type inferred from x
.
Bor = 109
a = bor x, y
. (Binary)
Type inferred from x
.
Bxor = 110
a = bxor x, y
. (Binary)
Type inferred from x
.
Bnot = 111
a = bnot x
. (Unary)
Type inferred from x
.
BandNot = 112
a = band_not x, y
. (Binary)
Type inferred from x
.
BorNot = 113
a = bor_not x, y
. (Binary)
Type inferred from x
.
BxorNot = 114
a = bxor_not x, y
. (Binary)
Type inferred from x
.
BandImm = 115
a = band_imm x, Y
. (BinaryImm64)
Type inferred from x
.
BorImm = 116
a = bor_imm x, Y
. (BinaryImm64)
Type inferred from x
.
BxorImm = 117
a = bxor_imm x, Y
. (BinaryImm64)
Type inferred from x
.
Rotl = 118
a = rotl x, y
. (Binary)
Type inferred from x
.
Rotr = 119
a = rotr x, y
. (Binary)
Type inferred from x
.
RotlImm = 120
a = rotl_imm x, Y
. (BinaryImm64)
Type inferred from x
.
RotrImm = 121
a = rotr_imm x, Y
. (BinaryImm64)
Type inferred from x
.
Ishl = 122
a = ishl x, y
. (Binary)
Type inferred from x
.
Ushr = 123
a = ushr x, y
. (Binary)
Type inferred from x
.
Sshr = 124
a = sshr x, y
. (Binary)
Type inferred from x
.
IshlImm = 125
a = ishl_imm x, Y
. (BinaryImm64)
Type inferred from x
.
UshrImm = 126
a = ushr_imm x, Y
. (BinaryImm64)
Type inferred from x
.
SshrImm = 127
a = sshr_imm x, Y
. (BinaryImm64)
Type inferred from x
.
Bitrev = 128
a = bitrev x
. (Unary)
Type inferred from x
.
Clz = 129
a = clz x
. (Unary)
Type inferred from x
.
Cls = 130
a = cls x
. (Unary)
Type inferred from x
.
Ctz = 131
a = ctz x
. (Unary)
Type inferred from x
.
Bswap = 132
a = bswap x
. (Unary)
Type inferred from x
.
Popcnt = 133
a = popcnt x
. (Unary)
Type inferred from x
.
Fcmp = 134
a = fcmp Cond, x, y
. (FloatCompare)
Type inferred from x
.
Fadd = 135
a = fadd x, y
. (Binary)
Type inferred from x
.
Fsub = 136
a = fsub x, y
. (Binary)
Type inferred from x
.
Fmul = 137
a = fmul x, y
. (Binary)
Type inferred from x
.
Fdiv = 138
a = fdiv x, y
. (Binary)
Type inferred from x
.
Sqrt = 139
a = sqrt x
. (Unary)
Type inferred from x
.
Fma = 140
a = fma x, y, z
. (Ternary)
Type inferred from y
.
Fneg = 141
a = fneg x
. (Unary)
Type inferred from x
.
Fabs = 142
a = fabs x
. (Unary)
Type inferred from x
.
Fcopysign = 143
a = fcopysign x, y
. (Binary)
Type inferred from x
.
Fmin = 144
a = fmin x, y
. (Binary)
Type inferred from x
.
Fmax = 145
a = fmax x, y
. (Binary)
Type inferred from x
.
Ceil = 146
a = ceil x
. (Unary)
Type inferred from x
.
Floor = 147
a = floor x
. (Unary)
Type inferred from x
.
Trunc = 148
a = trunc x
. (Unary)
Type inferred from x
.
Nearest = 149
a = nearest x
. (Unary)
Type inferred from x
.
Bitcast = 150
a = bitcast MemFlags, x
. (LoadNoOffset)
ScalarToVector = 151
a = scalar_to_vector s
. (Unary)
Bmask = 152
a = bmask x
. (Unary)
Ireduce = 153
a = ireduce x
. (Unary)
Snarrow = 154
a = snarrow x, y
. (Binary)
Type inferred from x
.
Unarrow = 155
a = unarrow x, y
. (Binary)
Type inferred from x
.
Uunarrow = 156
a = uunarrow x, y
. (Binary)
Type inferred from x
.
SwidenLow = 157
a = swiden_low x
. (Unary)
Type inferred from x
.
SwidenHigh = 158
a = swiden_high x
. (Unary)
Type inferred from x
.
UwidenLow = 159
a = uwiden_low x
. (Unary)
Type inferred from x
.
UwidenHigh = 160
a = uwiden_high x
. (Unary)
Type inferred from x
.
IaddPairwise = 161
a = iadd_pairwise x, y
. (Binary)
Type inferred from x
.
X86Pmaddubsw = 162
a = x86_pmaddubsw x, y
. (Binary)
Uextend = 163
a = uextend x
. (Unary)
Sextend = 164
a = sextend x
. (Unary)
Fpromote = 165
a = fpromote x
. (Unary)
Fdemote = 166
a = fdemote x
. (Unary)
Fvdemote = 167
a = fvdemote x
. (Unary)
FvpromoteLow = 168
x = fvpromote_low a
. (Unary)
FcvtToUint = 169
a = fcvt_to_uint x
. (Unary)
FcvtToSint = 170
a = fcvt_to_sint x
. (Unary)
FcvtToUintSat = 171
a = fcvt_to_uint_sat x
. (Unary)
FcvtToSintSat = 172
a = fcvt_to_sint_sat x
. (Unary)
X86Cvtt2dq = 173
a = x86_cvtt2dq x
. (Unary)
FcvtFromUint = 174
a = fcvt_from_uint x
. (Unary)
FcvtFromSint = 175
a = fcvt_from_sint x
. (Unary)
Isplit = 176
lo, hi = isplit x
. (Unary)
Type inferred from x
.
Iconcat = 177
a = iconcat lo, hi
. (Binary)
Type inferred from lo
.
AtomicRmw = 178
a = atomic_rmw MemFlags, AtomicRmwOp, p, x
. (AtomicRmw)
AtomicCas = 179
a = atomic_cas MemFlags, p, e, x
. (AtomicCas)
Type inferred from x
.
AtomicLoad = 180
a = atomic_load MemFlags, p
. (LoadNoOffset)
AtomicStore = 181
atomic_store MemFlags, x, p
. (StoreNoOffset)
Type inferred from x
.
Fence = 182
fence
. (NullAry)
ExtractVector = 183
a = extract_vector x, y
. (BinaryImm8)
Type inferred from x
.
Implementations§
Source§impl Opcode
impl Opcode
Sourcepub fn is_terminator(self) -> bool
pub fn is_terminator(self) -> bool
True for instructions that terminate the block
Sourcepub fn other_side_effects(self) -> bool
pub fn other_side_effects(self) -> bool
Does this instruction have other side effects besides can_* flags?
Sourcepub fn side_effects_idempotent(self) -> bool
pub fn side_effects_idempotent(self) -> bool
Despite having side effects, is this instruction okay to GVN?
Source§impl Opcode
impl Opcode
Sourcepub fn format(self) -> InstructionFormat
pub fn format(self) -> InstructionFormat
Get the instruction format for this opcode.
Sourcepub fn constraints(self) -> OpcodeConstraints
pub fn constraints(self) -> OpcodeConstraints
Get the constraint descriptor for this opcode.
Panic if this is called on NotAnOpcode
.
Sourcepub fn is_safepoint(self) -> bool
pub fn is_safepoint(self) -> bool
Is this instruction a GC safepoint?
Safepoints are all kinds of calls, except for tail calls.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Opcode
impl<'de> Deserialize<'de> for Opcode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Opcode
impl Eq for Opcode
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.