Remove vconcat and vsplit clif instructions (#5465)

Fixes #5463.

* remove vsplit instruction

* remove vconcat instruction

* remove unsused half/double vector helper functions

* remove unused operand constraints

* delete + inline Type::half_vector method
This commit is contained in:
Ayomide Bamidele
2022-12-20 00:41:55 +00:00
committed by GitHub
parent 307945877e
commit b47e644c3d
6 changed files with 7 additions and 148 deletions

View File

@@ -174,18 +174,6 @@ impl TypeVar {
"can't double all float types"
);
}
DerivedFunc::HalfVector => {
assert!(
*ts.lanes.iter().min().unwrap() > 1,
"can't halve a scalar type"
);
}
DerivedFunc::DoubleVector => {
assert!(
*ts.lanes.iter().max().unwrap() < MAX_LANES,
"can't double 256 lanes"
);
}
DerivedFunc::SplitLanes => {
assert!(
ts.ints.is_empty() || *ts.ints.iter().min().unwrap() > 8,
@@ -244,12 +232,6 @@ impl TypeVar {
pub fn double_width(&self) -> TypeVar {
self.derived(DerivedFunc::DoubleWidth)
}
pub fn half_vector(&self) -> TypeVar {
self.derived(DerivedFunc::HalfVector)
}
pub fn double_vector(&self) -> TypeVar {
self.derived(DerivedFunc::DoubleVector)
}
pub fn split_lanes(&self) -> TypeVar {
self.derived(DerivedFunc::SplitLanes)
}
@@ -317,8 +299,6 @@ pub(crate) enum DerivedFunc {
AsBool,
HalfWidth,
DoubleWidth,
HalfVector,
DoubleVector,
SplitLanes,
MergeLanes,
DynamicToVector,
@@ -331,8 +311,6 @@ impl DerivedFunc {
DerivedFunc::AsBool => "as_bool",
DerivedFunc::HalfWidth => "half_width",
DerivedFunc::DoubleWidth => "double_width",
DerivedFunc::HalfVector => "half_vector",
DerivedFunc::DoubleVector => "double_vector",
DerivedFunc::SplitLanes => "split_lanes",
DerivedFunc::MergeLanes => "merge_lanes",
DerivedFunc::DynamicToVector => "dynamic_to_vector",
@@ -410,8 +388,6 @@ impl TypeSet {
DerivedFunc::AsBool => self.as_bool(),
DerivedFunc::HalfWidth => self.half_width(),
DerivedFunc::DoubleWidth => self.double_width(),
DerivedFunc::HalfVector => self.half_vector(),
DerivedFunc::DoubleVector => self.double_vector(),
DerivedFunc::SplitLanes => self.half_width().double_vector(),
DerivedFunc::MergeLanes => self.double_width().half_vector(),
DerivedFunc::DynamicToVector => self.dynamic_to_vector(),

View File

@@ -1409,60 +1409,6 @@ pub(crate) fn define(
.operands_out(vec![a]),
);
let x = &Operand::new("x", TxN).with_doc("Vector to split");
let lo = &Operand::new("lo", &TxN.half_vector()).with_doc("Low-numbered lanes of `x`");
let hi = &Operand::new("hi", &TxN.half_vector()).with_doc("High-numbered lanes of `x`");
ig.push(
Inst::new(
"vsplit",
r#"
Split a vector into two halves.
Split the vector `x` into two separate values, each containing half of
the lanes from ``x``. The result may be two scalars if ``x`` only had
two lanes.
"#,
&formats.unary,
)
.operands_in(vec![x])
.operands_out(vec![lo, hi]),
);
let Any128 = &TypeVar::new(
"Any128",
"Any scalar or vector type with as most 128 lanes",
TypeSetBuilder::new()
.ints(Interval::All)
.floats(Interval::All)
.simd_lanes(1..128)
.includes_scalars(true)
.build(),
);
let x = &Operand::new("x", Any128).with_doc("Low-numbered lanes");
let y = &Operand::new("y", Any128).with_doc("High-numbered lanes");
let a = &Operand::new("a", &Any128.double_vector()).with_doc("Concatenation of `x` and `y`");
ig.push(
Inst::new(
"vconcat",
r#"
Vector concatenation.
Return a vector formed by concatenating ``x`` and ``y``. The resulting
vector type has twice as many lanes as each of the inputs. The lanes of
``x`` appear as the low-numbered lanes, and the lanes of ``y`` become
the high-numbered lanes of ``a``.
It is possible to form a vector by concatenating two scalars.
"#,
&formats.binary,
)
.operands_in(vec![x, y])
.operands_out(vec![a]),
);
let c = &Operand::new("c", &TxN.as_bool()).with_doc("Controlling vector");
let x = &Operand::new("x", TxN).with_doc("Value to use where `c` is true");
let y = &Operand::new("y", TxN).with_doc("Value to use where `c` is false");