Merge pull request #3497 from bjorn3/misc_meta_simplifications

Misc meta crate cleanups
This commit is contained in:
Chris Fallin
2021-11-01 11:24:44 -07:00
committed by GitHub
13 changed files with 148 additions and 132 deletions

View File

@@ -319,7 +319,7 @@ impl InstructionData {
// 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
// value using the `DataFlowGraph`.
&InstructionData::Shuffle { mask: _, .. } => None,
&InstructionData::Shuffle { imm: _, .. } => None,
_ => None,
}
}

View File

@@ -1264,8 +1264,8 @@ impl<'func, I: VCodeInst> LowerCtx for Lower<'func, I> {
fn get_immediate(&self, ir_inst: Inst) -> Option<DataValue> {
let inst_data = self.data(ir_inst);
match inst_data {
InstructionData::Shuffle { mask, .. } => {
let buffer = self.f.dfg.immediates.get(mask.clone()).unwrap().as_slice();
InstructionData::Shuffle { imm, .. } => {
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"));
Some(value)
}

View File

@@ -395,8 +395,8 @@ pub fn write_operands(w: &mut dyn Write, dfg: &DataFlowGraph, inst: Inst) -> fmt
}
NullAry { .. } => write!(w, " "),
TernaryImm8 { imm, args, .. } => write!(w, " {}, {}, {}", args[0], args[1], imm),
Shuffle { mask, args, .. } => {
let data = dfg.immediates.get(mask).expect(
Shuffle { imm, args, .. } => {
let data = dfg.immediates.get(imm).expect(
"Expected the shuffle mask to already be inserted into the immediates table",
);
write!(w, " {}, {}, {}", args[0], args[1], data)