diff --git a/cranelift/codegen/meta/src/cdsl/formats.rs b/cranelift/codegen/meta/src/cdsl/formats.rs index 6cd20ecae6..299294f508 100644 --- a/cranelift/codegen/meta/src/cdsl/formats.rs +++ b/cranelift/codegen/meta/src/cdsl/formats.rs @@ -122,15 +122,6 @@ impl InstructionFormatBuilder { 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 { assert!(self.typevar_operand.is_none()); assert!(operand_index < self.num_value_operands); diff --git a/cranelift/codegen/meta/src/shared/formats.rs b/cranelift/codegen/meta/src/shared/formats.rs index d1fe6adaac..61f19e4d44 100644 --- a/cranelift/codegen/meta/src/shared/formats.rs +++ b/cranelift/codegen/meta/src/shared/formats.rs @@ -101,7 +101,7 @@ impl Formats { shuffle: Builder::new("Shuffle") .value() .value() - .imm_with_name("mask", &imm.uimm128) + .imm(&imm.uimm128) .build(), int_compare: Builder::new("IntCompare") diff --git a/cranelift/codegen/src/ir/instructions.rs b/cranelift/codegen/src/ir/instructions.rs index 92f7c34bec..63a17bf9ba 100644 --- a/cranelift/codegen/src/ir/instructions.rs +++ b/cranelift/codegen/src/ir/instructions.rs @@ -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, } } diff --git a/cranelift/codegen/src/machinst/lower.rs b/cranelift/codegen/src/machinst/lower.rs index 6cd6d970be..0a35ad3ae6 100644 --- a/cranelift/codegen/src/machinst/lower.rs +++ b/cranelift/codegen/src/machinst/lower.rs @@ -1264,8 +1264,8 @@ impl<'func, I: VCodeInst> LowerCtx for Lower<'func, I> { fn get_immediate(&self, ir_inst: Inst) -> Option { 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) } diff --git a/cranelift/codegen/src/write.rs b/cranelift/codegen/src/write.rs index 1883251b90..72496a3192 100644 --- a/cranelift/codegen/src/write.rs +++ b/cranelift/codegen/src/write.rs @@ -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)