#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum InstructionFormat {
Unary,
UnaryImm,
UnaryIeee32,
UnaryIeee64,
UnaryBool,
UnaryGlobalValue,
Binary,
BinaryImm,
Ternary,
MultiAry,
NullAry,
InsertLane,
ExtractLane,
IntCompare,
IntCompareImm,
IntCond,
FloatCompare,
FloatCond,
IntSelect,
Jump,
Branch,
BranchInt,
BranchFloat,
BranchIcmp,
BranchTable,
BranchTableEntry,
BranchTableBase,
IndirectJump,
Call,
CallIndirect,
FuncAddr,
Load,
LoadComplex,
Store,
StoreComplex,
StackLoad,
StackStore,
HeapAddr,
TableAddr,
RegMove,
CopySpecial,
RegSpill,
RegFill,
Trap,
CondTrap,
IntCondTrap,
FloatCondTrap,
}
impl<'a> From<&'a InstructionData> for InstructionFormat {
fn from(inst: &'a InstructionData) -> Self {
match *inst {
InstructionData::Binary { .. } => {
InstructionFormat::Binary
}
InstructionData::BinaryImm { .. } => {
InstructionFormat::BinaryImm
}
InstructionData::Branch { .. } => {
InstructionFormat::Branch
}
InstructionData::BranchFloat { .. } => {
InstructionFormat::BranchFloat
}
InstructionData::BranchIcmp { .. } => {
InstructionFormat::BranchIcmp
}
InstructionData::BranchInt { .. } => {
InstructionFormat::BranchInt
}
InstructionData::BranchTable { .. } => {
InstructionFormat::BranchTable
}
InstructionData::BranchTableBase { .. } => {
InstructionFormat::BranchTableBase
}
InstructionData::BranchTableEntry { .. } => {
InstructionFormat::BranchTableEntry
}
InstructionData::Call { .. } => {
InstructionFormat::Call
}
InstructionData::CallIndirect { .. } => {
InstructionFormat::CallIndirect
}
InstructionData::CondTrap { .. } => {
InstructionFormat::CondTrap
}
InstructionData::CopySpecial { .. } => {
InstructionFormat::CopySpecial
}
InstructionData::ExtractLane { .. } => {
InstructionFormat::ExtractLane
}
InstructionData::FloatCompare { .. } => {
InstructionFormat::FloatCompare
}
InstructionData::FloatCond { .. } => {
InstructionFormat::FloatCond
}
InstructionData::FloatCondTrap { .. } => {
InstructionFormat::FloatCondTrap
}
InstructionData::FuncAddr { .. } => {
InstructionFormat::FuncAddr
}
InstructionData::HeapAddr { .. } => {
InstructionFormat::HeapAddr
}
InstructionData::IndirectJump { .. } => {
InstructionFormat::IndirectJump
}
InstructionData::InsertLane { .. } => {
InstructionFormat::InsertLane
}
InstructionData::IntCompare { .. } => {
InstructionFormat::IntCompare
}
InstructionData::IntCompareImm { .. } => {
InstructionFormat::IntCompareImm
}
InstructionData::IntCond { .. } => {
InstructionFormat::IntCond
}
InstructionData::IntCondTrap { .. } => {
InstructionFormat::IntCondTrap
}
InstructionData::IntSelect { .. } => {
InstructionFormat::IntSelect
}
InstructionData::Jump { .. } => {
InstructionFormat::Jump
}
InstructionData::Load { .. } => {
InstructionFormat::Load
}
InstructionData::LoadComplex { .. } => {
InstructionFormat::LoadComplex
}
InstructionData::MultiAry { .. } => {
InstructionFormat::MultiAry
}
InstructionData::NullAry { .. } => {
InstructionFormat::NullAry
}
InstructionData::RegFill { .. } => {
InstructionFormat::RegFill
}
InstructionData::RegMove { .. } => {
InstructionFormat::RegMove
}
InstructionData::RegSpill { .. } => {
InstructionFormat::RegSpill
}
InstructionData::StackLoad { .. } => {
InstructionFormat::StackLoad
}
InstructionData::StackStore { .. } => {
InstructionFormat::StackStore
}
InstructionData::Store { .. } => {
InstructionFormat::Store
}
InstructionData::StoreComplex { .. } => {
InstructionFormat::StoreComplex
}
InstructionData::TableAddr { .. } => {
InstructionFormat::TableAddr
}
InstructionData::Ternary { .. } => {
InstructionFormat::Ternary
}
InstructionData::Trap { .. } => {
InstructionFormat::Trap
}
InstructionData::Unary { .. } => {
InstructionFormat::Unary
}
InstructionData::UnaryBool { .. } => {
InstructionFormat::UnaryBool
}
InstructionData::UnaryGlobalValue { .. } => {
InstructionFormat::UnaryGlobalValue
}
InstructionData::UnaryIeee32 { .. } => {
InstructionFormat::UnaryIeee32
}
InstructionData::UnaryIeee64 { .. } => {
InstructionFormat::UnaryIeee64
}
InstructionData::UnaryImm { .. } => {
InstructionFormat::UnaryImm
}
}
}
}
#[derive(Clone, Debug)]
#[allow(missing_docs)]
pub enum InstructionData {
Unary {
opcode: Opcode,
arg: Value,
},
UnaryImm {
opcode: Opcode,
imm: ir::immediates::Imm64,
},
UnaryIeee32 {
opcode: Opcode,
imm: ir::immediates::Ieee32,
},
UnaryIeee64 {
opcode: Opcode,
imm: ir::immediates::Ieee64,
},
UnaryBool {
opcode: Opcode,
imm: bool,
},
UnaryGlobalValue {
opcode: Opcode,
global_value: ir::GlobalValue,
},
Binary {
opcode: Opcode,
args: [Value; 2],
},
BinaryImm {
opcode: Opcode,
arg: Value,
imm: ir::immediates::Imm64,
},
Ternary {
opcode: Opcode,
args: [Value; 3],
},
MultiAry {
opcode: Opcode,
args: ValueList,
},
NullAry {
opcode: Opcode,
},
InsertLane {
opcode: Opcode,
args: [Value; 2],
lane: ir::immediates::Uimm8,
},
ExtractLane {
opcode: Opcode,
arg: Value,
lane: ir::immediates::Uimm8,
},
IntCompare {
opcode: Opcode,
args: [Value; 2],
cond: ir::condcodes::IntCC,
},
IntCompareImm {
opcode: Opcode,
arg: Value,
cond: ir::condcodes::IntCC,
imm: ir::immediates::Imm64,
},
IntCond {
opcode: Opcode,
arg: Value,
cond: ir::condcodes::IntCC,
},
FloatCompare {
opcode: Opcode,
args: [Value; 2],
cond: ir::condcodes::FloatCC,
},
FloatCond {
opcode: Opcode,
arg: Value,
cond: ir::condcodes::FloatCC,
},
IntSelect {
opcode: Opcode,
args: [Value; 3],
cond: ir::condcodes::IntCC,
},
Jump {
opcode: Opcode,
args: ValueList,
destination: ir::Ebb,
},
Branch {
opcode: Opcode,
args: ValueList,
destination: ir::Ebb,
},
BranchInt {
opcode: Opcode,
args: ValueList,
cond: ir::condcodes::IntCC,
destination: ir::Ebb,
},
BranchFloat {
opcode: Opcode,
args: ValueList,
cond: ir::condcodes::FloatCC,
destination: ir::Ebb,
},
BranchIcmp {
opcode: Opcode,
args: ValueList,
cond: ir::condcodes::IntCC,
destination: ir::Ebb,
},
BranchTable {
opcode: Opcode,
arg: Value,
destination: ir::Ebb,
table: ir::JumpTable,
},
BranchTableEntry {
opcode: Opcode,
args: [Value; 2],
imm: ir::immediates::Uimm8,
table: ir::JumpTable,
},
BranchTableBase {
opcode: Opcode,
table: ir::JumpTable,
},
IndirectJump {
opcode: Opcode,
arg: Value,
table: ir::JumpTable,
},
Call {
opcode: Opcode,
args: ValueList,
func_ref: ir::FuncRef,
},
CallIndirect {
opcode: Opcode,
args: ValueList,
sig_ref: ir::SigRef,
},
FuncAddr {
opcode: Opcode,
func_ref: ir::FuncRef,
},
Load {
opcode: Opcode,
arg: Value,
flags: ir::MemFlags,
offset: ir::immediates::Offset32,
},
LoadComplex {
opcode: Opcode,
args: ValueList,
flags: ir::MemFlags,
offset: ir::immediates::Offset32,
},
Store {
opcode: Opcode,
args: [Value; 2],
flags: ir::MemFlags,
offset: ir::immediates::Offset32,
},
StoreComplex {
opcode: Opcode,
args: ValueList,
flags: ir::MemFlags,
offset: ir::immediates::Offset32,
},
StackLoad {
opcode: Opcode,
stack_slot: ir::StackSlot,
offset: ir::immediates::Offset32,
},
StackStore {
opcode: Opcode,
arg: Value,
stack_slot: ir::StackSlot,
offset: ir::immediates::Offset32,
},
HeapAddr {
opcode: Opcode,
arg: Value,
heap: ir::Heap,
imm: ir::immediates::Uimm32,
},
TableAddr {
opcode: Opcode,
arg: Value,
table: ir::Table,
offset: ir::immediates::Offset32,
},
RegMove {
opcode: Opcode,
arg: Value,
src: isa::RegUnit,
dst: isa::RegUnit,
},
CopySpecial {
opcode: Opcode,
src: isa::RegUnit,
dst: isa::RegUnit,
},
RegSpill {
opcode: Opcode,
arg: Value,
src: isa::RegUnit,
dst: ir::StackSlot,
},
RegFill {
opcode: Opcode,
arg: Value,
src: ir::StackSlot,
dst: isa::RegUnit,
},
Trap {
opcode: Opcode,
code: ir::TrapCode,
},
CondTrap {
opcode: Opcode,
arg: Value,
code: ir::TrapCode,
},
IntCondTrap {
opcode: Opcode,
arg: Value,
cond: ir::condcodes::IntCC,
code: ir::TrapCode,
},
FloatCondTrap {
opcode: Opcode,
arg: Value,
cond: ir::condcodes::FloatCC,
code: ir::TrapCode,
},
}
impl InstructionData {
pub fn opcode(&self) -> Opcode {
match *self {
InstructionData::Binary { opcode, .. } |
InstructionData::BinaryImm { opcode, .. } |
InstructionData::Branch { opcode, .. } |
InstructionData::BranchFloat { opcode, .. } |
InstructionData::BranchIcmp { opcode, .. } |
InstructionData::BranchInt { opcode, .. } |
InstructionData::BranchTable { opcode, .. } |
InstructionData::BranchTableBase { opcode, .. } |
InstructionData::BranchTableEntry { opcode, .. } |
InstructionData::Call { opcode, .. } |
InstructionData::CallIndirect { opcode, .. } |
InstructionData::CondTrap { opcode, .. } |
InstructionData::CopySpecial { opcode, .. } |
InstructionData::ExtractLane { opcode, .. } |
InstructionData::FloatCompare { opcode, .. } |
InstructionData::FloatCond { opcode, .. } |
InstructionData::FloatCondTrap { opcode, .. } |
InstructionData::FuncAddr { opcode, .. } |
InstructionData::HeapAddr { opcode, .. } |
InstructionData::IndirectJump { opcode, .. } |
InstructionData::InsertLane { opcode, .. } |
InstructionData::IntCompare { opcode, .. } |
InstructionData::IntCompareImm { opcode, .. } |
InstructionData::IntCond { opcode, .. } |
InstructionData::IntCondTrap { opcode, .. } |
InstructionData::IntSelect { opcode, .. } |
InstructionData::Jump { opcode, .. } |
InstructionData::Load { opcode, .. } |
InstructionData::LoadComplex { opcode, .. } |
InstructionData::MultiAry { opcode, .. } |
InstructionData::NullAry { opcode, .. } |
InstructionData::RegFill { opcode, .. } |
InstructionData::RegMove { opcode, .. } |
InstructionData::RegSpill { opcode, .. } |
InstructionData::StackLoad { opcode, .. } |
InstructionData::StackStore { opcode, .. } |
InstructionData::Store { opcode, .. } |
InstructionData::StoreComplex { opcode, .. } |
InstructionData::TableAddr { opcode, .. } |
InstructionData::Ternary { opcode, .. } |
InstructionData::Trap { opcode, .. } |
InstructionData::Unary { opcode, .. } |
InstructionData::UnaryBool { opcode, .. } |
InstructionData::UnaryGlobalValue { opcode, .. } |
InstructionData::UnaryIeee32 { opcode, .. } |
InstructionData::UnaryIeee64 { opcode, .. } |
InstructionData::UnaryImm { opcode, .. } => {
opcode
}
}
}
pub fn typevar_operand(&self, pool: &ir::ValueListPool) -> Option<Value> {
match *self {
InstructionData::BranchTableBase { .. } |
InstructionData::CopySpecial { .. } |
InstructionData::FuncAddr { .. } |
InstructionData::NullAry { .. } |
InstructionData::StackLoad { .. } |
InstructionData::Trap { .. } |
InstructionData::UnaryBool { .. } |
InstructionData::UnaryGlobalValue { .. } |
InstructionData::UnaryIeee32 { .. } |
InstructionData::UnaryIeee64 { .. } |
InstructionData::UnaryImm { .. } => {
None
}
InstructionData::BinaryImm { arg, .. } |
InstructionData::BranchTable { arg, .. } |
InstructionData::CondTrap { arg, .. } |
InstructionData::ExtractLane { arg, .. } |
InstructionData::FloatCond { arg, .. } |
InstructionData::FloatCondTrap { arg, .. } |
InstructionData::HeapAddr { arg, .. } |
InstructionData::IndirectJump { arg, .. } |
InstructionData::IntCompareImm { arg, .. } |
InstructionData::IntCond { arg, .. } |
InstructionData::IntCondTrap { arg, .. } |
InstructionData::Load { arg, .. } |
InstructionData::RegFill { arg, .. } |
InstructionData::RegMove { arg, .. } |
InstructionData::RegSpill { arg, .. } |
InstructionData::StackStore { arg, .. } |
InstructionData::TableAddr { arg, .. } |
InstructionData::Unary { arg, .. } => {
Some(arg)
}
InstructionData::Binary { args: ref args_arity2, .. } |
InstructionData::BranchTableEntry { args: ref args_arity2, .. } |
InstructionData::FloatCompare { args: ref args_arity2, .. } |
InstructionData::InsertLane { args: ref args_arity2, .. } |
InstructionData::IntCompare { args: ref args_arity2, .. } |
InstructionData::Store { args: ref args_arity2, .. } => {
Some(args_arity2[0])
}
InstructionData::IntSelect { args: ref args_arity3, .. } => {
Some(args_arity3[0])
}
InstructionData::Ternary { args: ref args_arity3, .. } => {
Some(args_arity3[1])
}
InstructionData::Branch { ref args, .. } |
InstructionData::BranchFloat { ref args, .. } |
InstructionData::BranchIcmp { ref args, .. } |
InstructionData::BranchInt { ref args, .. } |
InstructionData::Call { ref args, .. } |
InstructionData::CallIndirect { ref args, .. } |
InstructionData::Jump { ref args, .. } |
InstructionData::LoadComplex { ref args, .. } |
InstructionData::MultiAry { ref args, .. } |
InstructionData::StoreComplex { ref args, .. } => {
args.get(0, pool)
}
}
}
pub fn arguments<'a>(&'a self, pool: &'a ir::ValueListPool) -> &[Value] {
match *self {
InstructionData::BranchTableBase { .. } |
InstructionData::CopySpecial { .. } |
InstructionData::FuncAddr { .. } |
InstructionData::NullAry { .. } |
InstructionData::StackLoad { .. } |
InstructionData::Trap { .. } |
InstructionData::UnaryBool { .. } |
InstructionData::UnaryGlobalValue { .. } |
InstructionData::UnaryIeee32 { .. } |
InstructionData::UnaryIeee64 { .. } |
InstructionData::UnaryImm { .. } => {
&[]
}
InstructionData::Binary { args: ref args_arity2, .. } |
InstructionData::BranchTableEntry { args: ref args_arity2, .. } |
InstructionData::FloatCompare { args: ref args_arity2, .. } |
InstructionData::InsertLane { args: ref args_arity2, .. } |
InstructionData::IntCompare { args: ref args_arity2, .. } |
InstructionData::Store { args: ref args_arity2, .. } => {
args_arity2
}
InstructionData::IntSelect { args: ref args_arity3, .. } |
InstructionData::Ternary { args: ref args_arity3, .. } => {
args_arity3
}
InstructionData::BinaryImm { ref arg, .. } |
InstructionData::BranchTable { ref arg, .. } |
InstructionData::CondTrap { ref arg, .. } |
InstructionData::ExtractLane { ref arg, .. } |
InstructionData::FloatCond { ref arg, .. } |
InstructionData::FloatCondTrap { ref arg, .. } |
InstructionData::HeapAddr { ref arg, .. } |
InstructionData::IndirectJump { ref arg, .. } |
InstructionData::IntCompareImm { ref arg, .. } |
InstructionData::IntCond { ref arg, .. } |
InstructionData::IntCondTrap { ref arg, .. } |
InstructionData::Load { ref arg, .. } |
InstructionData::RegFill { ref arg, .. } |
InstructionData::RegMove { ref arg, .. } |
InstructionData::RegSpill { ref arg, .. } |
InstructionData::StackStore { ref arg, .. } |
InstructionData::TableAddr { ref arg, .. } |
InstructionData::Unary { ref arg, .. } => {
ref_slice(arg)
}
InstructionData::Branch { ref args, .. } |
InstructionData::BranchFloat { ref args, .. } |
InstructionData::BranchIcmp { ref args, .. } |
InstructionData::BranchInt { ref args, .. } |
InstructionData::Call { ref args, .. } |
InstructionData::CallIndirect { ref args, .. } |
InstructionData::Jump { ref args, .. } |
InstructionData::LoadComplex { ref args, .. } |
InstructionData::MultiAry { ref args, .. } |
InstructionData::StoreComplex { ref args, .. } => {
args.as_slice(pool)
}
}
}
pub fn arguments_mut<'a>(&'a mut self, pool: &'a mut ir::ValueListPool) -> &mut [Value] {
match *self {
InstructionData::BranchTableBase { .. } |
InstructionData::CopySpecial { .. } |
InstructionData::FuncAddr { .. } |
InstructionData::NullAry { .. } |
InstructionData::StackLoad { .. } |
InstructionData::Trap { .. } |
InstructionData::UnaryBool { .. } |
InstructionData::UnaryGlobalValue { .. } |
InstructionData::UnaryIeee32 { .. } |
InstructionData::UnaryIeee64 { .. } |
InstructionData::UnaryImm { .. } => {
&mut []
}
InstructionData::Binary { args: ref mut args_arity2, .. } |
InstructionData::BranchTableEntry { args: ref mut args_arity2, .. } |
InstructionData::FloatCompare { args: ref mut args_arity2, .. } |
InstructionData::InsertLane { args: ref mut args_arity2, .. } |
InstructionData::IntCompare { args: ref mut args_arity2, .. } |
InstructionData::Store { args: ref mut args_arity2, .. } => {
args_arity2
}
InstructionData::IntSelect { args: ref mut args_arity3, .. } |
InstructionData::Ternary { args: ref mut args_arity3, .. } => {
args_arity3
}
InstructionData::BinaryImm { ref mut arg, .. } |
InstructionData::BranchTable { ref mut arg, .. } |
InstructionData::CondTrap { ref mut arg, .. } |
InstructionData::ExtractLane { ref mut arg, .. } |
InstructionData::FloatCond { ref mut arg, .. } |
InstructionData::FloatCondTrap { ref mut arg, .. } |
InstructionData::HeapAddr { ref mut arg, .. } |
InstructionData::IndirectJump { ref mut arg, .. } |
InstructionData::IntCompareImm { ref mut arg, .. } |
InstructionData::IntCond { ref mut arg, .. } |
InstructionData::IntCondTrap { ref mut arg, .. } |
InstructionData::Load { ref mut arg, .. } |
InstructionData::RegFill { ref mut arg, .. } |
InstructionData::RegMove { ref mut arg, .. } |
InstructionData::RegSpill { ref mut arg, .. } |
InstructionData::StackStore { ref mut arg, .. } |
InstructionData::TableAddr { ref mut arg, .. } |
InstructionData::Unary { ref mut arg, .. } => {
ref_slice_mut(arg)
}
InstructionData::Branch { ref mut args, .. } |
InstructionData::BranchFloat { ref mut args, .. } |
InstructionData::BranchIcmp { ref mut args, .. } |
InstructionData::BranchInt { ref mut args, .. } |
InstructionData::Call { ref mut args, .. } |
InstructionData::CallIndirect { ref mut args, .. } |
InstructionData::Jump { ref mut args, .. } |
InstructionData::LoadComplex { ref mut args, .. } |
InstructionData::MultiAry { ref mut args, .. } |
InstructionData::StoreComplex { ref mut args, .. } => {
args.as_mut_slice(pool)
}
}
}
pub fn take_value_list(&mut self) -> Option<ir::ValueList> {
match *self {
InstructionData::Branch { ref mut args, .. } |
InstructionData::BranchFloat { ref mut args, .. } |
InstructionData::BranchIcmp { ref mut args, .. } |
InstructionData::BranchInt { ref mut args, .. } |
InstructionData::Call { ref mut args, .. } |
InstructionData::CallIndirect { ref mut args, .. } |
InstructionData::Jump { ref mut args, .. } |
InstructionData::LoadComplex { ref mut args, .. } |
InstructionData::MultiAry { ref mut args, .. } |
InstructionData::StoreComplex { ref mut args, .. } => {
Some(args.take())
}
_ => {
None
}
}
}
pub fn put_value_list(&mut self, vlist: ir::ValueList) {
let args = match *self {
InstructionData::MultiAry { ref mut args, .. } => args,
InstructionData::Jump { ref mut args, .. } => args,
InstructionData::Branch { ref mut args, .. } => args,
InstructionData::BranchInt { ref mut args, .. } => args,
InstructionData::BranchFloat { ref mut args, .. } => args,
InstructionData::BranchIcmp { ref mut args, .. } => args,
InstructionData::Call { ref mut args, .. } => args,
InstructionData::CallIndirect { ref mut args, .. } => args,
InstructionData::LoadComplex { ref mut args, .. } => args,
InstructionData::StoreComplex { ref mut args, .. } => args,
_ => panic!("No value list: {:?}", self),
};
debug_assert!(args.is_empty(), "Value list already in use");
*args = vlist;
}
pub fn eq(&self, other: &Self, pool: &ir::ValueListPool) -> bool {
if ::core::mem::discriminant(self) != ::core::mem::discriminant(other) {
return false;
}
match (self, other) {
(&InstructionData::Unary { opcode: ref opcode1, arg: ref arg1 }, &InstructionData::Unary { opcode: ref opcode2, arg: ref arg2 }) => {
opcode1 == opcode2
&& arg1 == arg2
}
(&InstructionData::UnaryImm { opcode: ref opcode1, imm: ref imm1 }, &InstructionData::UnaryImm { opcode: ref opcode2, imm: ref imm2 }) => {
opcode1 == opcode2
&& imm1 == imm2
}
(&InstructionData::UnaryIeee32 { opcode: ref opcode1, imm: ref imm1 }, &InstructionData::UnaryIeee32 { opcode: ref opcode2, imm: ref imm2 }) => {
opcode1 == opcode2
&& imm1 == imm2
}
(&InstructionData::UnaryIeee64 { opcode: ref opcode1, imm: ref imm1 }, &InstructionData::UnaryIeee64 { opcode: ref opcode2, imm: ref imm2 }) => {
opcode1 == opcode2
&& imm1 == imm2
}
(&InstructionData::UnaryBool { opcode: ref opcode1, imm: ref imm1 }, &InstructionData::UnaryBool { opcode: ref opcode2, imm: ref imm2 }) => {
opcode1 == opcode2
&& imm1 == imm2
}
(&InstructionData::UnaryGlobalValue { opcode: ref opcode1, global_value: ref global_value1 }, &InstructionData::UnaryGlobalValue { opcode: ref opcode2, global_value: ref global_value2 }) => {
opcode1 == opcode2
&& global_value1 == global_value2
}
(&InstructionData::Binary { opcode: ref opcode1, args: ref args1 }, &InstructionData::Binary { opcode: ref opcode2, args: ref args2 }) => {
opcode1 == opcode2
&& args1 == args2
}
(&InstructionData::BinaryImm { opcode: ref opcode1, arg: ref arg1, imm: ref imm1 }, &InstructionData::BinaryImm { opcode: ref opcode2, arg: ref arg2, imm: ref imm2 }) => {
opcode1 == opcode2
&& imm1 == imm2
&& arg1 == arg2
}
(&InstructionData::Ternary { opcode: ref opcode1, args: ref args1 }, &InstructionData::Ternary { opcode: ref opcode2, args: ref args2 }) => {
opcode1 == opcode2
&& args1 == args2
}
(&InstructionData::MultiAry { opcode: ref opcode1, args: ref args1 }, &InstructionData::MultiAry { opcode: ref opcode2, args: ref args2 }) => {
opcode1 == opcode2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::NullAry { opcode: ref opcode1 }, &InstructionData::NullAry { opcode: ref opcode2 }) => {
opcode1 == opcode2
}
(&InstructionData::InsertLane { opcode: ref opcode1, args: ref args1, lane: ref lane1 }, &InstructionData::InsertLane { opcode: ref opcode2, args: ref args2, lane: ref lane2 }) => {
opcode1 == opcode2
&& lane1 == lane2
&& args1 == args2
}
(&InstructionData::ExtractLane { opcode: ref opcode1, arg: ref arg1, lane: ref lane1 }, &InstructionData::ExtractLane { opcode: ref opcode2, arg: ref arg2, lane: ref lane2 }) => {
opcode1 == opcode2
&& lane1 == lane2
&& arg1 == arg2
}
(&InstructionData::IntCompare { opcode: ref opcode1, args: ref args1, cond: ref cond1 }, &InstructionData::IntCompare { opcode: ref opcode2, args: ref args2, cond: ref cond2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& args1 == args2
}
(&InstructionData::IntCompareImm { opcode: ref opcode1, arg: ref arg1, cond: ref cond1, imm: ref imm1 }, &InstructionData::IntCompareImm { opcode: ref opcode2, arg: ref arg2, cond: ref cond2, imm: ref imm2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& imm1 == imm2
&& arg1 == arg2
}
(&InstructionData::IntCond { opcode: ref opcode1, arg: ref arg1, cond: ref cond1 }, &InstructionData::IntCond { opcode: ref opcode2, arg: ref arg2, cond: ref cond2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& arg1 == arg2
}
(&InstructionData::FloatCompare { opcode: ref opcode1, args: ref args1, cond: ref cond1 }, &InstructionData::FloatCompare { opcode: ref opcode2, args: ref args2, cond: ref cond2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& args1 == args2
}
(&InstructionData::FloatCond { opcode: ref opcode1, arg: ref arg1, cond: ref cond1 }, &InstructionData::FloatCond { opcode: ref opcode2, arg: ref arg2, cond: ref cond2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& arg1 == arg2
}
(&InstructionData::IntSelect { opcode: ref opcode1, args: ref args1, cond: ref cond1 }, &InstructionData::IntSelect { opcode: ref opcode2, args: ref args2, cond: ref cond2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& args1 == args2
}
(&InstructionData::Jump { opcode: ref opcode1, args: ref args1, destination: ref destination1 }, &InstructionData::Jump { opcode: ref opcode2, args: ref args2, destination: ref destination2 }) => {
opcode1 == opcode2
&& destination1 == destination2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::Branch { opcode: ref opcode1, args: ref args1, destination: ref destination1 }, &InstructionData::Branch { opcode: ref opcode2, args: ref args2, destination: ref destination2 }) => {
opcode1 == opcode2
&& destination1 == destination2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::BranchInt { opcode: ref opcode1, args: ref args1, cond: ref cond1, destination: ref destination1 }, &InstructionData::BranchInt { opcode: ref opcode2, args: ref args2, cond: ref cond2, destination: ref destination2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& destination1 == destination2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::BranchFloat { opcode: ref opcode1, args: ref args1, cond: ref cond1, destination: ref destination1 }, &InstructionData::BranchFloat { opcode: ref opcode2, args: ref args2, cond: ref cond2, destination: ref destination2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& destination1 == destination2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::BranchIcmp { opcode: ref opcode1, args: ref args1, cond: ref cond1, destination: ref destination1 }, &InstructionData::BranchIcmp { opcode: ref opcode2, args: ref args2, cond: ref cond2, destination: ref destination2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& destination1 == destination2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::BranchTable { opcode: ref opcode1, arg: ref arg1, destination: ref destination1, table: ref table1 }, &InstructionData::BranchTable { opcode: ref opcode2, arg: ref arg2, destination: ref destination2, table: ref table2 }) => {
opcode1 == opcode2
&& destination1 == destination2
&& table1 == table2
&& arg1 == arg2
}
(&InstructionData::BranchTableEntry { opcode: ref opcode1, args: ref args1, imm: ref imm1, table: ref table1 }, &InstructionData::BranchTableEntry { opcode: ref opcode2, args: ref args2, imm: ref imm2, table: ref table2 }) => {
opcode1 == opcode2
&& imm1 == imm2
&& table1 == table2
&& args1 == args2
}
(&InstructionData::BranchTableBase { opcode: ref opcode1, table: ref table1 }, &InstructionData::BranchTableBase { opcode: ref opcode2, table: ref table2 }) => {
opcode1 == opcode2
&& table1 == table2
}
(&InstructionData::IndirectJump { opcode: ref opcode1, arg: ref arg1, table: ref table1 }, &InstructionData::IndirectJump { opcode: ref opcode2, arg: ref arg2, table: ref table2 }) => {
opcode1 == opcode2
&& table1 == table2
&& arg1 == arg2
}
(&InstructionData::Call { opcode: ref opcode1, args: ref args1, func_ref: ref func_ref1 }, &InstructionData::Call { opcode: ref opcode2, args: ref args2, func_ref: ref func_ref2 }) => {
opcode1 == opcode2
&& func_ref1 == func_ref2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::CallIndirect { opcode: ref opcode1, args: ref args1, sig_ref: ref sig_ref1 }, &InstructionData::CallIndirect { opcode: ref opcode2, args: ref args2, sig_ref: ref sig_ref2 }) => {
opcode1 == opcode2
&& sig_ref1 == sig_ref2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::FuncAddr { opcode: ref opcode1, func_ref: ref func_ref1 }, &InstructionData::FuncAddr { opcode: ref opcode2, func_ref: ref func_ref2 }) => {
opcode1 == opcode2
&& func_ref1 == func_ref2
}
(&InstructionData::Load { opcode: ref opcode1, arg: ref arg1, flags: ref flags1, offset: ref offset1 }, &InstructionData::Load { opcode: ref opcode2, arg: ref arg2, flags: ref flags2, offset: ref offset2 }) => {
opcode1 == opcode2
&& flags1 == flags2
&& offset1 == offset2
&& arg1 == arg2
}
(&InstructionData::LoadComplex { opcode: ref opcode1, args: ref args1, flags: ref flags1, offset: ref offset1 }, &InstructionData::LoadComplex { opcode: ref opcode2, args: ref args2, flags: ref flags2, offset: ref offset2 }) => {
opcode1 == opcode2
&& flags1 == flags2
&& offset1 == offset2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::Store { opcode: ref opcode1, args: ref args1, flags: ref flags1, offset: ref offset1 }, &InstructionData::Store { opcode: ref opcode2, args: ref args2, flags: ref flags2, offset: ref offset2 }) => {
opcode1 == opcode2
&& flags1 == flags2
&& offset1 == offset2
&& args1 == args2
}
(&InstructionData::StoreComplex { opcode: ref opcode1, args: ref args1, flags: ref flags1, offset: ref offset1 }, &InstructionData::StoreComplex { opcode: ref opcode2, args: ref args2, flags: ref flags2, offset: ref offset2 }) => {
opcode1 == opcode2
&& flags1 == flags2
&& offset1 == offset2
&& args1.as_slice(pool) == args2.as_slice(pool)
}
(&InstructionData::StackLoad { opcode: ref opcode1, stack_slot: ref stack_slot1, offset: ref offset1 }, &InstructionData::StackLoad { opcode: ref opcode2, stack_slot: ref stack_slot2, offset: ref offset2 }) => {
opcode1 == opcode2
&& stack_slot1 == stack_slot2
&& offset1 == offset2
}
(&InstructionData::StackStore { opcode: ref opcode1, arg: ref arg1, stack_slot: ref stack_slot1, offset: ref offset1 }, &InstructionData::StackStore { opcode: ref opcode2, arg: ref arg2, stack_slot: ref stack_slot2, offset: ref offset2 }) => {
opcode1 == opcode2
&& stack_slot1 == stack_slot2
&& offset1 == offset2
&& arg1 == arg2
}
(&InstructionData::HeapAddr { opcode: ref opcode1, arg: ref arg1, heap: ref heap1, imm: ref imm1 }, &InstructionData::HeapAddr { opcode: ref opcode2, arg: ref arg2, heap: ref heap2, imm: ref imm2 }) => {
opcode1 == opcode2
&& heap1 == heap2
&& imm1 == imm2
&& arg1 == arg2
}
(&InstructionData::TableAddr { opcode: ref opcode1, arg: ref arg1, table: ref table1, offset: ref offset1 }, &InstructionData::TableAddr { opcode: ref opcode2, arg: ref arg2, table: ref table2, offset: ref offset2 }) => {
opcode1 == opcode2
&& table1 == table2
&& offset1 == offset2
&& arg1 == arg2
}
(&InstructionData::RegMove { opcode: ref opcode1, arg: ref arg1, src: ref src1, dst: ref dst1 }, &InstructionData::RegMove { opcode: ref opcode2, arg: ref arg2, src: ref src2, dst: ref dst2 }) => {
opcode1 == opcode2
&& src1 == src2
&& dst1 == dst2
&& arg1 == arg2
}
(&InstructionData::CopySpecial { opcode: ref opcode1, src: ref src1, dst: ref dst1 }, &InstructionData::CopySpecial { opcode: ref opcode2, src: ref src2, dst: ref dst2 }) => {
opcode1 == opcode2
&& src1 == src2
&& dst1 == dst2
}
(&InstructionData::RegSpill { opcode: ref opcode1, arg: ref arg1, src: ref src1, dst: ref dst1 }, &InstructionData::RegSpill { opcode: ref opcode2, arg: ref arg2, src: ref src2, dst: ref dst2 }) => {
opcode1 == opcode2
&& src1 == src2
&& dst1 == dst2
&& arg1 == arg2
}
(&InstructionData::RegFill { opcode: ref opcode1, arg: ref arg1, src: ref src1, dst: ref dst1 }, &InstructionData::RegFill { opcode: ref opcode2, arg: ref arg2, src: ref src2, dst: ref dst2 }) => {
opcode1 == opcode2
&& src1 == src2
&& dst1 == dst2
&& arg1 == arg2
}
(&InstructionData::Trap { opcode: ref opcode1, code: ref code1 }, &InstructionData::Trap { opcode: ref opcode2, code: ref code2 }) => {
opcode1 == opcode2
&& code1 == code2
}
(&InstructionData::CondTrap { opcode: ref opcode1, arg: ref arg1, code: ref code1 }, &InstructionData::CondTrap { opcode: ref opcode2, arg: ref arg2, code: ref code2 }) => {
opcode1 == opcode2
&& code1 == code2
&& arg1 == arg2
}
(&InstructionData::IntCondTrap { opcode: ref opcode1, arg: ref arg1, cond: ref cond1, code: ref code1 }, &InstructionData::IntCondTrap { opcode: ref opcode2, arg: ref arg2, cond: ref cond2, code: ref code2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& code1 == code2
&& arg1 == arg2
}
(&InstructionData::FloatCondTrap { opcode: ref opcode1, arg: ref arg1, cond: ref cond1, code: ref code1 }, &InstructionData::FloatCondTrap { opcode: ref opcode2, arg: ref arg2, cond: ref cond2, code: ref code2 }) => {
opcode1 == opcode2
&& cond1 == cond2
&& code1 == code2
&& arg1 == arg2
}
_ => unreachable!()
}
}
pub fn hash<H: ::core::hash::Hasher>(&self, state: &mut H, pool: &ir::ValueListPool) {
match *self {
InstructionData::Unary{opcode, ref arg} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::UnaryImm{opcode, imm} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::UnaryIeee32{opcode, imm} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::UnaryIeee64{opcode, imm} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::UnaryBool{opcode, imm} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::UnaryGlobalValue{opcode, global_value} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&global_value, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::Binary{opcode, ref args} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::BinaryImm{opcode, ref arg, imm} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::Ternary{opcode, ref args} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::MultiAry{opcode, ref args} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::NullAry{opcode} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::InsertLane{opcode, ref args, lane} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&lane, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::ExtractLane{opcode, ref arg, lane} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&lane, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::IntCompare{opcode, ref args, cond} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::IntCompareImm{opcode, ref arg, cond, imm} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::IntCond{opcode, ref arg, cond} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::FloatCompare{opcode, ref args, cond} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::FloatCond{opcode, ref arg, cond} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::IntSelect{opcode, ref args, cond} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::Jump{opcode, ref args, destination} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&destination, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::Branch{opcode, ref args, destination} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&destination, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::BranchInt{opcode, ref args, cond, destination} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(&destination, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::BranchFloat{opcode, ref args, cond, destination} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(&destination, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::BranchIcmp{opcode, ref args, cond, destination} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(&destination, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::BranchTable{opcode, ref arg, destination, table} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&destination, state);
::core::hash::Hash::hash(&table, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::BranchTableEntry{opcode, ref args, imm, table} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(&table, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::BranchTableBase{opcode, table} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&table, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::IndirectJump{opcode, ref arg, table} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&table, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::Call{opcode, ref args, func_ref} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&func_ref, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::CallIndirect{opcode, ref args, sig_ref} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&sig_ref, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::FuncAddr{opcode, func_ref} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&func_ref, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::Load{opcode, ref arg, flags, offset} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&flags, state);
::core::hash::Hash::hash(&offset, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::LoadComplex{opcode, ref args, flags, offset} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&flags, state);
::core::hash::Hash::hash(&offset, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::Store{opcode, ref args, flags, offset} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&flags, state);
::core::hash::Hash::hash(&offset, state);
::core::hash::Hash::hash(args, state);
}
InstructionData::StoreComplex{opcode, ref args, flags, offset} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&flags, state);
::core::hash::Hash::hash(&offset, state);
::core::hash::Hash::hash(args.as_slice(pool), state);
}
InstructionData::StackLoad{opcode, stack_slot, offset} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&stack_slot, state);
::core::hash::Hash::hash(&offset, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::StackStore{opcode, ref arg, stack_slot, offset} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&stack_slot, state);
::core::hash::Hash::hash(&offset, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::HeapAddr{opcode, ref arg, heap, imm} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&heap, state);
::core::hash::Hash::hash(&imm, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::TableAddr{opcode, ref arg, table, offset} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&table, state);
::core::hash::Hash::hash(&offset, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::RegMove{opcode, ref arg, src, dst} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&src, state);
::core::hash::Hash::hash(&dst, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::CopySpecial{opcode, src, dst} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&src, state);
::core::hash::Hash::hash(&dst, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::RegSpill{opcode, ref arg, src, dst} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&src, state);
::core::hash::Hash::hash(&dst, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::RegFill{opcode, ref arg, src, dst} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&src, state);
::core::hash::Hash::hash(&dst, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::Trap{opcode, code} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&code, state);
::core::hash::Hash::hash(&(), state);
}
InstructionData::CondTrap{opcode, ref arg, code} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&code, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::IntCondTrap{opcode, ref arg, cond, code} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(&code, state);
::core::hash::Hash::hash(arg, state);
}
InstructionData::FloatCondTrap{opcode, ref arg, cond, code} => {
::core::hash::Hash::hash( &::core::mem::discriminant(self), state);
::core::hash::Hash::hash(&opcode, state);
::core::hash::Hash::hash(&cond, state);
::core::hash::Hash::hash(&code, state);
::core::hash::Hash::hash(arg, state);
}
}
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub enum Opcode {
Jump = 1,
Fallthrough,
Brz,
Brnz,
BrIcmp,
Brif,
Brff,
BrTable,
JumpTableEntry,
JumpTableBase,
IndirectJumpTableBr,
Debugtrap,
Trap,
Trapz,
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,
TableAddr,
Iconst,
F32const,
F64const,
Bconst,
Nop,
Select,
Selectif,
Copy,
Spill,
Fill,
Regmove,
CopySpecial,
CopyNop,
AdjustSpDown,
AdjustSpUpImm,
AdjustSpDownImm,
IfcmpSp,
Regspill,
Regfill,
Vsplit,
Vconcat,
Vselect,
Splat,
Insertlane,
Extractlane,
Icmp,
IcmpImm,
Ifcmp,
IfcmpImm,
Iadd,
Isub,
Imul,
Umulhi,
Smulhi,
Udiv,
Sdiv,
Urem,
Srem,
IaddImm,
ImulImm,
UdivImm,
SdivImm,
UremImm,
SremImm,
IrsubImm,
IaddCin,
IaddCout,
IaddCarry,
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,
Popcnt,
Fcmp,
Ffcmp,
Fadd,
Fsub,
Fmul,
Fdiv,
Sqrt,
Fma,
Fneg,
Fabs,
Fcopysign,
Fmin,
Fmax,
Ceil,
Floor,
Trunc,
Nearest,
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,
}
impl Opcode {
pub fn is_terminator(self) -> bool {
match self {
Opcode::BrTable |
Opcode::Fallthrough |
Opcode::FallthroughReturn |
Opcode::IndirectJumpTableBr |
Opcode::Jump |
Opcode::Return |
Opcode::Trap => {
true
}
_ => {
false
}
}
}
pub fn is_branch(self) -> bool {
match self {
Opcode::BrIcmp |
Opcode::BrTable |
Opcode::Brff |
Opcode::Brif |
Opcode::Brnz |
Opcode::Brz |
Opcode::Fallthrough |
Opcode::IndirectJumpTableBr |
Opcode::Jump => {
true
}
_ => {
false
}
}
}
pub fn is_indirect_branch(self) -> bool {
match self {
Opcode::IndirectJumpTableBr => {
true
}
_ => {
false
}
}
}
pub fn is_call(self) -> bool {
match self {
Opcode::Call |
Opcode::CallIndirect => {
true
}
_ => {
false
}
}
}
pub fn is_return(self) -> bool {
match self {
Opcode::FallthroughReturn |
Opcode::Return => {
true
}
_ => {
false
}
}
}
pub fn is_ghost(self) -> bool {
match self {
Opcode::Iconcat |
Opcode::Isplit |
Opcode::Vconcat |
Opcode::Vsplit => {
true
}
_ => {
false
}
}
}
pub fn can_load(self) -> bool {
match self {
Opcode::Debugtrap |
Opcode::Fill |
Opcode::JumpTableEntry |
Opcode::Load |
Opcode::LoadComplex |
Opcode::Sload16 |
Opcode::Sload16Complex |
Opcode::Sload32 |
Opcode::Sload32Complex |
Opcode::Sload8 |
Opcode::Sload8Complex |
Opcode::StackLoad |
Opcode::Uload16 |
Opcode::Uload16Complex |
Opcode::Uload32 |
Opcode::Uload32Complex |
Opcode::Uload8 |
Opcode::Uload8Complex |
Opcode::X86Pop => {
true
}
_ => {
false
}
}
}
pub fn can_store(self) -> bool {
match self {
Opcode::Debugtrap |
Opcode::Istore16 |
Opcode::Istore16Complex |
Opcode::Istore32 |
Opcode::Istore32Complex |
Opcode::Istore8 |
Opcode::Istore8Complex |
Opcode::Spill |
Opcode::StackStore |
Opcode::Store |
Opcode::StoreComplex |
Opcode::X86Push => {
true
}
_ => {
false
}
}
}
pub fn can_trap(self) -> bool {
match self {
Opcode::FcvtToSint |
Opcode::FcvtToUint |
Opcode::Sdiv |
Opcode::Srem |
Opcode::Trap |
Opcode::Trapff |
Opcode::Trapif |
Opcode::Trapnz |
Opcode::Trapz |
Opcode::Udiv |
Opcode::Urem |
Opcode::X86Sdivmodx |
Opcode::X86Udivmodx => {
true
}
_ => {
false
}
}
}
pub fn other_side_effects(self) -> bool {
match self {
Opcode::AdjustSpDown |
Opcode::AdjustSpDownImm |
Opcode::AdjustSpUpImm |
Opcode::CopySpecial |
Opcode::Debugtrap |
Opcode::Regfill |
Opcode::Regmove |
Opcode::Regspill |
Opcode::X86Pop |
Opcode::X86Push => {
true
}
_ => {
false
}
}
}
pub fn writes_cpu_flags(self) -> bool {
match self {
Opcode::Ffcmp |
Opcode::Ifcmp |
Opcode::IfcmpImm |
Opcode::IfcmpSp |
Opcode::X86Bsf |
Opcode::X86Bsr => {
true
}
_ => {
false
}
}
}
}
const OPCODE_FORMAT: [InstructionFormat; 179] = [
InstructionFormat::Jump,
InstructionFormat::Jump,
InstructionFormat::Branch,
InstructionFormat::Branch,
InstructionFormat::BranchIcmp,
InstructionFormat::BranchInt,
InstructionFormat::BranchFloat,
InstructionFormat::BranchTable,
InstructionFormat::BranchTableEntry,
InstructionFormat::BranchTableBase,
InstructionFormat::IndirectJump,
InstructionFormat::NullAry,
InstructionFormat::Trap,
InstructionFormat::CondTrap,
InstructionFormat::CondTrap,
InstructionFormat::IntCondTrap,
InstructionFormat::FloatCondTrap,
InstructionFormat::MultiAry,
InstructionFormat::MultiAry,
InstructionFormat::Call,
InstructionFormat::CallIndirect,
InstructionFormat::FuncAddr,
InstructionFormat::Load,
InstructionFormat::LoadComplex,
InstructionFormat::Store,
InstructionFormat::StoreComplex,
InstructionFormat::Load,
InstructionFormat::LoadComplex,
InstructionFormat::Load,
InstructionFormat::LoadComplex,
InstructionFormat::Store,
InstructionFormat::StoreComplex,
InstructionFormat::Load,
InstructionFormat::LoadComplex,
InstructionFormat::Load,
InstructionFormat::LoadComplex,
InstructionFormat::Store,
InstructionFormat::StoreComplex,
InstructionFormat::Load,
InstructionFormat::LoadComplex,
InstructionFormat::Load,
InstructionFormat::LoadComplex,
InstructionFormat::Store,
InstructionFormat::StoreComplex,
InstructionFormat::StackLoad,
InstructionFormat::StackStore,
InstructionFormat::StackLoad,
InstructionFormat::UnaryGlobalValue,
InstructionFormat::UnaryGlobalValue,
InstructionFormat::HeapAddr,
InstructionFormat::TableAddr,
InstructionFormat::UnaryImm,
InstructionFormat::UnaryIeee32,
InstructionFormat::UnaryIeee64,
InstructionFormat::UnaryBool,
InstructionFormat::NullAry,
InstructionFormat::Ternary,
InstructionFormat::IntSelect,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::RegMove,
InstructionFormat::CopySpecial,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::UnaryImm,
InstructionFormat::UnaryImm,
InstructionFormat::Unary,
InstructionFormat::RegSpill,
InstructionFormat::RegFill,
InstructionFormat::Unary,
InstructionFormat::Binary,
InstructionFormat::Ternary,
InstructionFormat::Unary,
InstructionFormat::InsertLane,
InstructionFormat::ExtractLane,
InstructionFormat::IntCompare,
InstructionFormat::IntCompareImm,
InstructionFormat::Binary,
InstructionFormat::BinaryImm,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::Ternary,
InstructionFormat::Binary,
InstructionFormat::Ternary,
InstructionFormat::Ternary,
InstructionFormat::Binary,
InstructionFormat::Ternary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Unary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::BinaryImm,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::FloatCompare,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Unary,
InstructionFormat::Ternary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::IntCond,
InstructionFormat::FloatCond,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::Binary,
InstructionFormat::Ternary,
InstructionFormat::Ternary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Unary,
InstructionFormat::Binary,
InstructionFormat::Binary,
InstructionFormat::Unary,
InstructionFormat::NullAry,
InstructionFormat::Unary,
InstructionFormat::Unary,
InstructionFormat::ExtractLane,
InstructionFormat::Binary,
];
fn opcode_name(opc: Opcode) -> &'static str {
match opc {
Opcode::AdjustSpDown => {
"adjust_sp_down"
}
Opcode::AdjustSpDownImm => {
"adjust_sp_down_imm"
}
Opcode::AdjustSpUpImm => {
"adjust_sp_up_imm"
}
Opcode::Band => {
"band"
}
Opcode::BandImm => {
"band_imm"
}
Opcode::BandNot => {
"band_not"
}
Opcode::Bconst => {
"bconst"
}
Opcode::Bextend => {
"bextend"
}
Opcode::Bint => {
"bint"
}
Opcode::Bitcast => {
"bitcast"
}
Opcode::Bitrev => {
"bitrev"
}
Opcode::Bmask => {
"bmask"
}
Opcode::Bnot => {
"bnot"
}
Opcode::Bor => {
"bor"
}
Opcode::BorImm => {
"bor_imm"
}
Opcode::BorNot => {
"bor_not"
}
Opcode::BrIcmp => {
"br_icmp"
}
Opcode::BrTable => {
"br_table"
}
Opcode::Breduce => {
"breduce"
}
Opcode::Brff => {
"brff"
}
Opcode::Brif => {
"brif"
}
Opcode::Brnz => {
"brnz"
}
Opcode::Brz => {
"brz"
}
Opcode::Bxor => {
"bxor"
}
Opcode::BxorImm => {
"bxor_imm"
}
Opcode::BxorNot => {
"bxor_not"
}
Opcode::Call => {
"call"
}
Opcode::CallIndirect => {
"call_indirect"
}
Opcode::Ceil => {
"ceil"
}
Opcode::Cls => {
"cls"
}
Opcode::Clz => {
"clz"
}
Opcode::Copy => {
"copy"
}
Opcode::CopyNop => {
"copy_nop"
}
Opcode::CopySpecial => {
"copy_special"
}
Opcode::Ctz => {
"ctz"
}
Opcode::Debugtrap => {
"debugtrap"
}
Opcode::Extractlane => {
"extractlane"
}
Opcode::F32const => {
"f32const"
}
Opcode::F64const => {
"f64const"
}
Opcode::Fabs => {
"fabs"
}
Opcode::Fadd => {
"fadd"
}
Opcode::Fallthrough => {
"fallthrough"
}
Opcode::FallthroughReturn => {
"fallthrough_return"
}
Opcode::Fcmp => {
"fcmp"
}
Opcode::Fcopysign => {
"fcopysign"
}
Opcode::FcvtFromSint => {
"fcvt_from_sint"
}
Opcode::FcvtFromUint => {
"fcvt_from_uint"
}
Opcode::FcvtToSint => {
"fcvt_to_sint"
}
Opcode::FcvtToSintSat => {
"fcvt_to_sint_sat"
}
Opcode::FcvtToUint => {
"fcvt_to_uint"
}
Opcode::FcvtToUintSat => {
"fcvt_to_uint_sat"
}
Opcode::Fdemote => {
"fdemote"
}
Opcode::Fdiv => {
"fdiv"
}
Opcode::Ffcmp => {
"ffcmp"
}
Opcode::Fill => {
"fill"
}
Opcode::Floor => {
"floor"
}
Opcode::Fma => {
"fma"
}
Opcode::Fmax => {
"fmax"
}
Opcode::Fmin => {
"fmin"
}
Opcode::Fmul => {
"fmul"
}
Opcode::Fneg => {
"fneg"
}
Opcode::Fpromote => {
"fpromote"
}
Opcode::Fsub => {
"fsub"
}
Opcode::FuncAddr => {
"func_addr"
}
Opcode::GlobalValue => {
"global_value"
}
Opcode::HeapAddr => {
"heap_addr"
}
Opcode::Iadd => {
"iadd"
}
Opcode::IaddCarry => {
"iadd_carry"
}
Opcode::IaddCin => {
"iadd_cin"
}
Opcode::IaddCout => {
"iadd_cout"
}
Opcode::IaddImm => {
"iadd_imm"
}
Opcode::Icmp => {
"icmp"
}
Opcode::IcmpImm => {
"icmp_imm"
}
Opcode::Iconcat => {
"iconcat"
}
Opcode::Iconst => {
"iconst"
}
Opcode::Ifcmp => {
"ifcmp"
}
Opcode::IfcmpImm => {
"ifcmp_imm"
}
Opcode::IfcmpSp => {
"ifcmp_sp"
}
Opcode::Imul => {
"imul"
}
Opcode::ImulImm => {
"imul_imm"
}
Opcode::IndirectJumpTableBr => {
"indirect_jump_table_br"
}
Opcode::Insertlane => {
"insertlane"
}
Opcode::Ireduce => {
"ireduce"
}
Opcode::IrsubImm => {
"irsub_imm"
}
Opcode::Ishl => {
"ishl"
}
Opcode::IshlImm => {
"ishl_imm"
}
Opcode::Isplit => {
"isplit"
}
Opcode::Istore16 => {
"istore16"
}
Opcode::Istore16Complex => {
"istore16_complex"
}
Opcode::Istore32 => {
"istore32"
}
Opcode::Istore32Complex => {
"istore32_complex"
}
Opcode::Istore8 => {
"istore8"
}
Opcode::Istore8Complex => {
"istore8_complex"
}
Opcode::Isub => {
"isub"
}
Opcode::IsubBin => {
"isub_bin"
}
Opcode::IsubBorrow => {
"isub_borrow"
}
Opcode::IsubBout => {
"isub_bout"
}
Opcode::Jump => {
"jump"
}
Opcode::JumpTableBase => {
"jump_table_base"
}
Opcode::JumpTableEntry => {
"jump_table_entry"
}
Opcode::Load => {
"load"
}
Opcode::LoadComplex => {
"load_complex"
}
Opcode::Nearest => {
"nearest"
}
Opcode::Nop => {
"nop"
}
Opcode::Popcnt => {
"popcnt"
}
Opcode::RawBitcast => {
"raw_bitcast"
}
Opcode::Regfill => {
"regfill"
}
Opcode::Regmove => {
"regmove"
}
Opcode::Regspill => {
"regspill"
}
Opcode::Return => {
"return"
}
Opcode::Rotl => {
"rotl"
}
Opcode::RotlImm => {
"rotl_imm"
}
Opcode::Rotr => {
"rotr"
}
Opcode::RotrImm => {
"rotr_imm"
}
Opcode::ScalarToVector => {
"scalar_to_vector"
}
Opcode::Sdiv => {
"sdiv"
}
Opcode::SdivImm => {
"sdiv_imm"
}
Opcode::Select => {
"select"
}
Opcode::Selectif => {
"selectif"
}
Opcode::Sextend => {
"sextend"
}
Opcode::Sload16 => {
"sload16"
}
Opcode::Sload16Complex => {
"sload16_complex"
}
Opcode::Sload32 => {
"sload32"
}
Opcode::Sload32Complex => {
"sload32_complex"
}
Opcode::Sload8 => {
"sload8"
}
Opcode::Sload8Complex => {
"sload8_complex"
}
Opcode::Smulhi => {
"smulhi"
}
Opcode::Spill => {
"spill"
}
Opcode::Splat => {
"splat"
}
Opcode::Sqrt => {
"sqrt"
}
Opcode::Srem => {
"srem"
}
Opcode::SremImm => {
"srem_imm"
}
Opcode::Sshr => {
"sshr"
}
Opcode::SshrImm => {
"sshr_imm"
}
Opcode::StackAddr => {
"stack_addr"
}
Opcode::StackLoad => {
"stack_load"
}
Opcode::StackStore => {
"stack_store"
}
Opcode::Store => {
"store"
}
Opcode::StoreComplex => {
"store_complex"
}
Opcode::SymbolValue => {
"symbol_value"
}
Opcode::TableAddr => {
"table_addr"
}
Opcode::Trap => {
"trap"
}
Opcode::Trapff => {
"trapff"
}
Opcode::Trapif => {
"trapif"
}
Opcode::Trapnz => {
"trapnz"
}
Opcode::Trapz => {
"trapz"
}
Opcode::Trueff => {
"trueff"
}
Opcode::Trueif => {
"trueif"
}
Opcode::Trunc => {
"trunc"
}
Opcode::Udiv => {
"udiv"
}
Opcode::UdivImm => {
"udiv_imm"
}
Opcode::Uextend => {
"uextend"
}
Opcode::Uload16 => {
"uload16"
}
Opcode::Uload16Complex => {
"uload16_complex"
}
Opcode::Uload32 => {
"uload32"
}
Opcode::Uload32Complex => {
"uload32_complex"
}
Opcode::Uload8 => {
"uload8"
}
Opcode::Uload8Complex => {
"uload8_complex"
}
Opcode::Umulhi => {
"umulhi"
}
Opcode::Urem => {
"urem"
}
Opcode::UremImm => {
"urem_imm"
}
Opcode::Ushr => {
"ushr"
}
Opcode::UshrImm => {
"ushr_imm"
}
Opcode::Vconcat => {
"vconcat"
}
Opcode::Vselect => {
"vselect"
}
Opcode::Vsplit => {
"vsplit"
}
Opcode::X86Bsf => {
"x86_bsf"
}
Opcode::X86Bsr => {
"x86_bsr"
}
Opcode::X86Cvtt2si => {
"x86_cvtt2si"
}
Opcode::X86Fmax => {
"x86_fmax"
}
Opcode::X86Fmin => {
"x86_fmin"
}
Opcode::X86Pop => {
"x86_pop"
}
Opcode::X86Pshufb => {
"x86_pshufb"
}
Opcode::X86Pshufd => {
"x86_pshufd"
}
Opcode::X86Push => {
"x86_push"
}
Opcode::X86Sdivmodx => {
"x86_sdivmodx"
}
Opcode::X86Smulx => {
"x86_smulx"
}
Opcode::X86Udivmodx => {
"x86_udivmodx"
}
Opcode::X86Umulx => {
"x86_umulx"
}
}
}
const OPCODE_HASH_TABLE: [Option<Opcode>; 256] = [
Some(Opcode::Regfill),
Some(Opcode::Imul),
None,
Some(Opcode::Brif),
Some(Opcode::HeapAddr),
Some(Opcode::FcvtToSintSat),
Some(Opcode::Fsub),
Some(Opcode::Rotr),
Some(Opcode::TableAddr),
Some(Opcode::Iconst),
Some(Opcode::Uload32Complex),
Some(Opcode::Ifcmp),
None,
Some(Opcode::Store),
Some(Opcode::Brnz),
Some(Opcode::Fallthrough),
Some(Opcode::Isub),
Some(Opcode::UshrImm),
Some(Opcode::Brff),
Some(Opcode::Trap),
Some(Opcode::Srem),
Some(Opcode::SshrImm),
Some(Opcode::Uload16Complex),
Some(Opcode::Sdiv),
Some(Opcode::JumpTableEntry),
None,
Some(Opcode::Bxor),
Some(Opcode::FcvtFromUint),
Some(Opcode::SremImm),
Some(Opcode::Insertlane),
Some(Opcode::BxorNot),
Some(Opcode::Load),
Some(Opcode::Fneg),
Some(Opcode::Fadd),
Some(Opcode::Jump),
Some(Opcode::BxorImm),
Some(Opcode::Copy),
None,
Some(Opcode::Umulhi),
Some(Opcode::Ushr),
None,
Some(Opcode::Sqrt),
None,
Some(Opcode::Fmax),
Some(Opcode::Urem),
Some(Opcode::Band),
Some(Opcode::CopyNop),
Some(Opcode::Fabs),
Some(Opcode::Ishl),
Some(Opcode::X86Cvtt2si),
Some(Opcode::Ceil),
Some(Opcode::Call),
None,
Some(Opcode::FcvtFromSint),
Some(Opcode::Fill),
None,
None,
Some(Opcode::Fmin),
Some(Opcode::FuncAddr),
Some(Opcode::Popcnt),
Some(Opcode::Sextend),
Some(Opcode::X86Bsr),
Some(Opcode::FcvtToUint),
None,
None,
Some(Opcode::GlobalValue),
Some(Opcode::Bnot),
Some(Opcode::Isplit),
Some(Opcode::Trueff),
Some(Opcode::Trapff),
Some(Opcode::Trunc),
Some(Opcode::Bint),
Some(Opcode::RotlImm),
Some(Opcode::Fcmp),
Some(Opcode::FcvtToSint),
Some(Opcode::Fmul),
Some(Opcode::X86Fmax),
Some(Opcode::AdjustSpDownImm),
Some(Opcode::IsubBin),
None,
Some(Opcode::Trapif),
Some(Opcode::Nearest),
Some(Opcode::Fdiv),
Some(Opcode::X86Fmin),
Some(Opcode::BrIcmp),
None,
Some(Opcode::UremImm),
Some(Opcode::Trueif),
Some(Opcode::LoadComplex),
Some(Opcode::Trapnz),
Some(Opcode::Uload16),
Some(Opcode::IaddImm),
Some(Opcode::Uload32),
Some(Opcode::IaddCarry),
Some(Opcode::Bitrev),
Some(Opcode::X86Pop),
Some(Opcode::Smulhi),
None,
Some(Opcode::Vsplit),
None,
Some(Opcode::RawBitcast),
Some(Opcode::X86Udivmodx),
Some(Opcode::X86Bsf),
Some(Opcode::IfcmpSp),
Some(Opcode::BorNot),
None,
Some(Opcode::AdjustSpUpImm),
None,
Some(Opcode::Istore8Complex),
None,
None,
None,
None,
None,
None,
None,
None,
Some(Opcode::ImulImm),
Some(Opcode::Ireduce),
None,
Some(Opcode::RotrImm),
Some(Opcode::Fdemote),
Some(Opcode::StackStore),
None,
Some(Opcode::Select),
Some(Opcode::IaddCin),
Some(Opcode::Istore32),
Some(Opcode::Selectif),
Some(Opcode::Istore16),
Some(Opcode::Bconst),
None,
Some(Opcode::BorImm),
Some(Opcode::Uload8Complex),
Some(Opcode::IcmpImm),
None,
None,
Some(Opcode::Sload16),
Some(Opcode::Fcopysign),
None,
Some(Opcode::SdivImm),
Some(Opcode::Breduce),
Some(Opcode::X86Sdivmodx),
Some(Opcode::Sload32),
None,
Some(Opcode::X86Pshufb),
Some(Opcode::Extractlane),
Some(Opcode::StackAddr),
Some(Opcode::X86Pshufd),
Some(Opcode::BandImm),
Some(Opcode::IsubBorrow),
Some(Opcode::Return),
None,
None,
None,
None,
Some(Opcode::X86Umulx),
Some(Opcode::Sload8Complex),
None,
Some(Opcode::JumpTableBase),
Some(Opcode::Sload16Complex),
None,
Some(Opcode::Sload32Complex),
Some(Opcode::X86Push),
Some(Opcode::Iconcat),
None,
None,
Some(Opcode::Regspill),
None,
None,
Some(Opcode::Fma),
None,
Some(Opcode::Istore8),
Some(Opcode::BrTable),
Some(Opcode::F64const),
Some(Opcode::Nop),
Some(Opcode::StackLoad),
Some(Opcode::IrsubImm),
Some(Opcode::Bor),
Some(Opcode::StoreComplex),
Some(Opcode::IsubBout),
Some(Opcode::Debugtrap),
Some(Opcode::BandNot),
Some(Opcode::Ctz),
Some(Opcode::IshlImm),
Some(Opcode::Clz),
Some(Opcode::Bitcast),
Some(Opcode::AdjustSpDown),
Some(Opcode::Ffcmp),
Some(Opcode::Uextend),
Some(Opcode::Brz),
Some(Opcode::Bextend),
Some(Opcode::X86Smulx),
Some(Opcode::Floor),
Some(Opcode::Cls),
None,
None,
Some(Opcode::IndirectJumpTableBr),
None,
Some(Opcode::Fpromote),
None,
None,
None,
Some(Opcode::SymbolValue),
Some(Opcode::Bmask),
Some(Opcode::FcvtToUintSat),
None,
None,
Some(Opcode::Vselect),
None,
Some(Opcode::ScalarToVector),
None,
None,
Some(Opcode::Uload8),
Some(Opcode::FallthroughReturn),
None,
None,
Some(Opcode::Trapz),
None,
Some(Opcode::Udiv),
None,
None,
None,
None,
None,
None,
Some(Opcode::CopySpecial),
Some(Opcode::Rotl),
None,
Some(Opcode::Regmove),
None,
None,
None,
Some(Opcode::F32const),
Some(Opcode::UdivImm),
None,
Some(Opcode::Spill),
Some(Opcode::Splat),
None,
Some(Opcode::CallIndirect),
Some(Opcode::Sload8),
None,
Some(Opcode::Istore16Complex),
None,
None,
Some(Opcode::IfcmpImm),
Some(Opcode::Icmp),
None,
None,
Some(Opcode::Iadd),
None,
Some(Opcode::IaddCout),
Some(Opcode::Vconcat),
None,
Some(Opcode::Sshr),
None,
Some(Opcode::Istore32Complex),
];
const OPCODE_CONSTRAINTS: [OpcodeConstraints; 179] = [
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 0,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 0,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x58,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x20,
typeset_offset: 255,
constraint_offset: 3,
},
OpcodeConstraints {
flags: 0x20,
typeset_offset: 255,
constraint_offset: 4,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x41,
typeset_offset: 1,
constraint_offset: 5,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 0,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 0,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x20,
typeset_offset: 255,
constraint_offset: 3,
},
OpcodeConstraints {
flags: 0x20,
typeset_offset: 255,
constraint_offset: 4,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 3,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 3,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x58,
typeset_offset: 3,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 3,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 4,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 4,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 4,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 4,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x58,
typeset_offset: 4,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 4,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 2,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 2,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x58,
typeset_offset: 2,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x39,
typeset_offset: 2,
constraint_offset: 10,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 255,
constraint_offset: 10,
},
OpcodeConstraints {
flags: 0x39,
typeset_offset: 2,
constraint_offset: 10,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 255,
constraint_offset: 10,
},
OpcodeConstraints {
flags: 0x58,
typeset_offset: 5,
constraint_offset: 12,
},
OpcodeConstraints {
flags: 0x20,
typeset_offset: 255,
constraint_offset: 10,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 3,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 3,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 3,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 3,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 2,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 2,
constraint_offset: 8,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 255,
constraint_offset: 14,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 255,
constraint_offset: 15,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 7,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x69,
typeset_offset: 8,
constraint_offset: 16,
},
OpcodeConstraints {
flags: 0x61,
typeset_offset: 8,
constraint_offset: 19,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x00,
typeset_offset: 255,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x39,
typeset_offset: 2,
constraint_offset: 20,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x3a,
typeset_offset: 9,
constraint_offset: 23,
},
OpcodeConstraints {
flags: 0x59,
typeset_offset: 10,
constraint_offset: 26,
},
OpcodeConstraints {
flags: 0x69,
typeset_offset: 9,
constraint_offset: 28,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 9,
constraint_offset: 31,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 9,
constraint_offset: 30,
},
OpcodeConstraints {
flags: 0x39,
typeset_offset: 9,
constraint_offset: 32,
},
OpcodeConstraints {
flags: 0x59,
typeset_offset: 6,
constraint_offset: 29,
},
OpcodeConstraints {
flags: 0x39,
typeset_offset: 1,
constraint_offset: 34,
},
OpcodeConstraints {
flags: 0x59,
typeset_offset: 1,
constraint_offset: 20,
},
OpcodeConstraints {
flags: 0x39,
typeset_offset: 1,
constraint_offset: 20,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x69,
typeset_offset: 1,
constraint_offset: 35,
},
OpcodeConstraints {
flags: 0x4a,
typeset_offset: 1,
constraint_offset: 33,
},
OpcodeConstraints {
flags: 0x6a,
typeset_offset: 1,
constraint_offset: 37,
},
OpcodeConstraints {
flags: 0x69,
typeset_offset: 1,
constraint_offset: 35,
},
OpcodeConstraints {
flags: 0x4a,
typeset_offset: 1,
constraint_offset: 33,
},
OpcodeConstraints {
flags: 0x6a,
typeset_offset: 1,
constraint_offset: 37,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 8,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 42,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 42,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 42,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 42,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 6,
constraint_offset: 42,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 6,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 1,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x59,
typeset_offset: 11,
constraint_offset: 29,
},
OpcodeConstraints {
flags: 0x59,
typeset_offset: 11,
constraint_offset: 45,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x69,
typeset_offset: 11,
constraint_offset: 46,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 255,
constraint_offset: 50,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 255,
constraint_offset: 52,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 3,
constraint_offset: 54,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 8,
constraint_offset: 56,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 9,
constraint_offset: 58,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 7,
constraint_offset: 60,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 7,
constraint_offset: 60,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 60,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 60,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 62,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 62,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 62,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 11,
constraint_offset: 64,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 11,
constraint_offset: 64,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 64,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 64,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 64,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 6,
constraint_offset: 64,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 11,
constraint_offset: 62,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 11,
constraint_offset: 62,
},
OpcodeConstraints {
flags: 0x3a,
typeset_offset: 13,
constraint_offset: 66,
},
OpcodeConstraints {
flags: 0x59,
typeset_offset: 14,
constraint_offset: 69,
},
OpcodeConstraints {
flags: 0x6a,
typeset_offset: 2,
constraint_offset: 70,
},
OpcodeConstraints {
flags: 0x6a,
typeset_offset: 2,
constraint_offset: 70,
},
OpcodeConstraints {
flags: 0x4a,
typeset_offset: 2,
constraint_offset: 46,
},
OpcodeConstraints {
flags: 0x4a,
typeset_offset: 2,
constraint_offset: 46,
},
OpcodeConstraints {
flags: 0x21,
typeset_offset: 15,
constraint_offset: 64,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 11,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x38,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x01,
typeset_offset: 2,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x2a,
typeset_offset: 2,
constraint_offset: 19,
},
OpcodeConstraints {
flags: 0x2a,
typeset_offset: 2,
constraint_offset: 19,
},
OpcodeConstraints {
flags: 0x29,
typeset_offset: 9,
constraint_offset: 0,
},
OpcodeConstraints {
flags: 0x49,
typeset_offset: 9,
constraint_offset: 0,
},
];
const TYPE_SETS: [ir::instructions::ValueTypeSet; 16] = [
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(1),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(121),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(1),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(1),
ints: BitSet::<u8>(96),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(96),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(1),
ints: BitSet::<u8>(112),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(1),
ints: BitSet::<u8>(64),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(0),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(121),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(96),
bools: BitSet::<u8>(121),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(510),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(96),
bools: BitSet::<u8>(121),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(255),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(96),
bools: BitSet::<u8>(121),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(0),
floats: BitSet::<u8>(96),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(1),
ints: BitSet::<u8>(120),
floats: BitSet::<u8>(96),
bools: BitSet::<u8>(121),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(112),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(56),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
ir::instructions::ValueTypeSet {
lanes: BitSet::<u16>(511),
ints: BitSet::<u8>(96),
floats: BitSet::<u8>(0),
bools: BitSet::<u8>(0),
},
];
const OPERAND_CONSTRAINTS: [OperandConstraint; 75] = [
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Concrete(ir::types::IFLAGS),
OperandConstraint::Concrete(ir::types::FFLAGS),
OperandConstraint::Same,
OperandConstraint::Free(1),
OperandConstraint::Free(2),
OperandConstraint::Same,
OperandConstraint::Free(2),
OperandConstraint::Concrete(ir::types::I64),
OperandConstraint::Same,
OperandConstraint::Concrete(ir::types::I64),
OperandConstraint::Free(2),
OperandConstraint::Concrete(ir::types::F32),
OperandConstraint::Concrete(ir::types::F64),
OperandConstraint::Same,
OperandConstraint::Free(0),
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Concrete(ir::types::IFLAGS),
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::HalfVector,
OperandConstraint::HalfVector,
OperandConstraint::Same,
OperandConstraint::DoubleVector,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::AsBool,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::LaneOf,
OperandConstraint::Same,
OperandConstraint::Concrete(ir::types::B1),
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Concrete(ir::types::B1),
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Concrete(ir::types::B1),
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Free(1),
OperandConstraint::Concrete(ir::types::FFLAGS),
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Concrete(ir::types::B1),
OperandConstraint::Concrete(ir::types::IFLAGS),
OperandConstraint::Concrete(ir::types::B1),
OperandConstraint::Concrete(ir::types::FFLAGS),
OperandConstraint::Same,
OperandConstraint::Free(3),
OperandConstraint::Same,
OperandConstraint::Free(8),
OperandConstraint::Same,
OperandConstraint::Free(12),
OperandConstraint::Same,
OperandConstraint::Free(7),
OperandConstraint::Same,
OperandConstraint::Free(6),
OperandConstraint::Same,
OperandConstraint::Free(11),
OperandConstraint::HalfWidth,
OperandConstraint::HalfWidth,
OperandConstraint::Same,
OperandConstraint::DoubleWidth,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Same,
OperandConstraint::Same,
];