Replace InsertLane format with TernaryImm8
The InsertLane format has an ordering (`value().imm().value()`) and immediate name (`"lane"`) that make it awkward to use for other instructions. This changes the ordering (`value().value().imm()`) and uses the default name (`"imm"`) throughout the codebase.
This commit is contained in:
@@ -41,6 +41,11 @@ pub enum SerInstData {
|
||||
opcode: String,
|
||||
args: [String; 3],
|
||||
},
|
||||
TernaryImm8 {
|
||||
opcode: String,
|
||||
args: [String; 2],
|
||||
imm: String,
|
||||
},
|
||||
MultiAry {
|
||||
opcode: String,
|
||||
args: Vec<String>,
|
||||
@@ -48,11 +53,6 @@ pub enum SerInstData {
|
||||
NullAry {
|
||||
opcode: String,
|
||||
},
|
||||
InsertLane {
|
||||
opcode: String,
|
||||
args: [String; 2],
|
||||
lane: String,
|
||||
},
|
||||
ExtractLane {
|
||||
opcode: String,
|
||||
arg: String,
|
||||
@@ -323,12 +323,12 @@ pub fn get_inst_data(inst_index: Inst, func: &Function) -> SerInstData {
|
||||
InstructionData::NullAry { opcode } => SerInstData::NullAry {
|
||||
opcode: opcode.to_string(),
|
||||
},
|
||||
InstructionData::InsertLane { opcode, args, lane } => {
|
||||
InstructionData::TernaryImm8 { opcode, args, imm } => {
|
||||
let hold_args = [args[0].to_string(), args[1].to_string()];
|
||||
SerInstData::InsertLane {
|
||||
SerInstData::TernaryImm8 {
|
||||
opcode: opcode.to_string(),
|
||||
args: hold_args,
|
||||
lane: lane.to_string(),
|
||||
imm: imm.to_string(),
|
||||
}
|
||||
}
|
||||
InstructionData::ExtractLane { opcode, arg, lane } => SerInstData::ExtractLane {
|
||||
|
||||
Reference in New Issue
Block a user