Remove imm_with_name
It is only used once to rename an imm field to mask
This commit is contained in:
@@ -122,15 +122,6 @@ impl InstructionFormatBuilder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn imm_with_name(mut self, member: &'static str, operand_kind: &OperandKind) -> Self {
|
|
||||||
let field = FormatField {
|
|
||||||
kind: operand_kind.clone(),
|
|
||||||
member,
|
|
||||||
};
|
|
||||||
self.imm_fields.push(field);
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn typevar_operand(mut self, operand_index: usize) -> Self {
|
pub fn typevar_operand(mut self, operand_index: usize) -> Self {
|
||||||
assert!(self.typevar_operand.is_none());
|
assert!(self.typevar_operand.is_none());
|
||||||
assert!(operand_index < self.num_value_operands);
|
assert!(operand_index < self.num_value_operands);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ impl Formats {
|
|||||||
shuffle: Builder::new("Shuffle")
|
shuffle: Builder::new("Shuffle")
|
||||||
.value()
|
.value()
|
||||||
.value()
|
.value()
|
||||||
.imm_with_name("mask", &imm.uimm128)
|
.imm(&imm.uimm128)
|
||||||
.build(),
|
.build(),
|
||||||
|
|
||||||
int_compare: Builder::new("IntCompare")
|
int_compare: Builder::new("IntCompare")
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ impl InstructionData {
|
|||||||
// included in the `InstructionData` for memory-size reasons. This case, returning
|
// included in the `InstructionData` for memory-size reasons. This case, returning
|
||||||
// `None`, is left here to alert users of this method that they should retrieve the
|
// `None`, is left here to alert users of this method that they should retrieve the
|
||||||
// value using the `DataFlowGraph`.
|
// value using the `DataFlowGraph`.
|
||||||
&InstructionData::Shuffle { mask: _, .. } => None,
|
&InstructionData::Shuffle { imm: _, .. } => None,
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1264,8 +1264,8 @@ impl<'func, I: VCodeInst> LowerCtx for Lower<'func, I> {
|
|||||||
fn get_immediate(&self, ir_inst: Inst) -> Option<DataValue> {
|
fn get_immediate(&self, ir_inst: Inst) -> Option<DataValue> {
|
||||||
let inst_data = self.data(ir_inst);
|
let inst_data = self.data(ir_inst);
|
||||||
match inst_data {
|
match inst_data {
|
||||||
InstructionData::Shuffle { mask, .. } => {
|
InstructionData::Shuffle { imm, .. } => {
|
||||||
let buffer = self.f.dfg.immediates.get(mask.clone()).unwrap().as_slice();
|
let buffer = self.f.dfg.immediates.get(imm.clone()).unwrap().as_slice();
|
||||||
let value = DataValue::V128(buffer.try_into().expect("a 16-byte data buffer"));
|
let value = DataValue::V128(buffer.try_into().expect("a 16-byte data buffer"));
|
||||||
Some(value)
|
Some(value)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -395,8 +395,8 @@ pub fn write_operands(w: &mut dyn Write, dfg: &DataFlowGraph, inst: Inst) -> fmt
|
|||||||
}
|
}
|
||||||
NullAry { .. } => write!(w, " "),
|
NullAry { .. } => write!(w, " "),
|
||||||
TernaryImm8 { imm, args, .. } => write!(w, " {}, {}, {}", args[0], args[1], imm),
|
TernaryImm8 { imm, args, .. } => write!(w, " {}, {}, {}", args[0], args[1], imm),
|
||||||
Shuffle { mask, args, .. } => {
|
Shuffle { imm, args, .. } => {
|
||||||
let data = dfg.immediates.get(mask).expect(
|
let data = dfg.immediates.get(imm).expect(
|
||||||
"Expected the shuffle mask to already be inserted into the immediates table",
|
"Expected the shuffle mask to already be inserted into the immediates table",
|
||||||
);
|
);
|
||||||
write!(w, " {}, {}, {}", args[0], args[1], data)
|
write!(w, " {}, {}, {}", args[0], args[1], data)
|
||||||
|
|||||||
Reference in New Issue
Block a user