Remove the vconst instruction and the UnaryImmVector format.
No instruction sets actually have single instructions for materializing vector constants. You always need to use a constant pool. Cretonne doesn't have constant pools yet, but it will in the future, and that is how vector constants should be represented.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
use ir::{types, instructions};
|
||||
use ir::{InstructionData, DataFlowGraph, Cursor};
|
||||
use ir::{Opcode, Type, Inst, Value, Ebb, JumpTable, SigRef, FuncRef, ValueList};
|
||||
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, ImmVector};
|
||||
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64};
|
||||
use ir::condcodes::{IntCC, FloatCC};
|
||||
|
||||
/// Base trait for instruction builders.
|
||||
|
||||
@@ -434,12 +434,6 @@ impl FromStr for Ieee64 {
|
||||
}
|
||||
}
|
||||
|
||||
/// Arbitrary vector immediate.
|
||||
///
|
||||
/// This kind of immediate can represent any kind of SIMD vector constant.
|
||||
/// The representation is simply the sequence of bytes that would be used to store the vector.
|
||||
pub type ImmVector = Vec<u8>;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::str::FromStr;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef};
|
||||
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, ImmVector};
|
||||
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64};
|
||||
use ir::condcodes::*;
|
||||
use ir::types;
|
||||
use ir::DataFlowGraph;
|
||||
@@ -123,11 +123,6 @@ pub enum InstructionData {
|
||||
ty: Type,
|
||||
imm: Ieee64,
|
||||
},
|
||||
UnaryImmVector {
|
||||
opcode: Opcode,
|
||||
ty: Type,
|
||||
data: Box<UnaryImmVectorData>,
|
||||
},
|
||||
UnarySplit {
|
||||
opcode: Opcode,
|
||||
ty: Type,
|
||||
@@ -294,23 +289,6 @@ impl Default for VariableArgs {
|
||||
}
|
||||
}
|
||||
|
||||
/// Payload data for `vconst`.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct UnaryImmVectorData {
|
||||
/// Raw vector data.
|
||||
pub imm: ImmVector,
|
||||
}
|
||||
|
||||
impl Display for UnaryImmVectorData {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
write!(f, "#")?;
|
||||
for b in &self.imm {
|
||||
write!(f, "{:02x}", b)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Payload data for ternary instructions with multiple results, such as `iadd_carry`.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct TernaryOverflowData {
|
||||
|
||||
@@ -233,7 +233,6 @@ fn write_instruction(w: &mut Write,
|
||||
UnaryImm { imm, .. } => writeln!(w, " {}", imm),
|
||||
UnaryIeee32 { imm, .. } => writeln!(w, " {}", imm),
|
||||
UnaryIeee64 { imm, .. } => writeln!(w, " {}", imm),
|
||||
UnaryImmVector { ref data, .. } => writeln!(w, " {}", data),
|
||||
UnarySplit { arg, .. } => writeln!(w, " {}", arg),
|
||||
Binary { args, .. } => writeln!(w, " {}, {}", args[0], args[1]),
|
||||
BinaryImm { arg, imm, .. } => writeln!(w, " {}, {}", arg, imm),
|
||||
|
||||
Reference in New Issue
Block a user