Add ir::Types::lane_of as an alias of lane_type to be used in typevar constraints;
This commit is contained in:
@@ -498,7 +498,7 @@ enum OperandConstraint {
|
|||||||
/// This operand is the same type as the controlling type variable.
|
/// This operand is the same type as the controlling type variable.
|
||||||
Same,
|
Same,
|
||||||
|
|
||||||
/// This operand is `ctrlType.lane_type()`.
|
/// This operand is `ctrlType.lane_of()`.
|
||||||
LaneOf,
|
LaneOf,
|
||||||
|
|
||||||
/// This operand is `ctrlType.as_bool()`.
|
/// This operand is `ctrlType.as_bool()`.
|
||||||
@@ -527,7 +527,7 @@ impl OperandConstraint {
|
|||||||
Concrete(t) => Bound(t),
|
Concrete(t) => Bound(t),
|
||||||
Free(vts) => ResolvedConstraint::Free(TYPE_SETS[vts as usize]),
|
Free(vts) => ResolvedConstraint::Free(TYPE_SETS[vts as usize]),
|
||||||
Same => Bound(ctrl_type),
|
Same => Bound(ctrl_type),
|
||||||
LaneOf => Bound(ctrl_type.lane_type()),
|
LaneOf => Bound(ctrl_type.lane_of()),
|
||||||
AsBool => Bound(ctrl_type.as_bool()),
|
AsBool => Bound(ctrl_type.as_bool()),
|
||||||
HalfWidth => Bound(ctrl_type.half_width().expect("invalid type for half_width")),
|
HalfWidth => Bound(ctrl_type.half_width().expect("invalid type for half_width")),
|
||||||
DoubleWidth => Bound(
|
DoubleWidth => Bound(
|
||||||
|
|||||||
@@ -44,10 +44,17 @@ impl Type {
|
|||||||
if self.0 < VECTOR_BASE {
|
if self.0 < VECTOR_BASE {
|
||||||
self
|
self
|
||||||
} else {
|
} else {
|
||||||
Type(LANE_BASE | (self.0 & 0x0f))
|
Self(LANE_BASE | (self.0 & 0x0f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The type transformation that returns the lane type of a type variable; it is just a
|
||||||
|
/// renaming of lane_type() to be used in context where we think in terms of type variable
|
||||||
|
/// transformations.
|
||||||
|
pub fn lane_of(self) -> Self {
|
||||||
|
self.lane_type()
|
||||||
|
}
|
||||||
|
|
||||||
/// Get log_2 of the number of bits in a lane.
|
/// Get log_2 of the number of bits in a lane.
|
||||||
pub fn log2_lane_bits(self) -> u8 {
|
pub fn log2_lane_bits(self) -> u8 {
|
||||||
match self.lane_type() {
|
match self.lane_type() {
|
||||||
|
|||||||
Reference in New Issue
Block a user