mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
abi: s/VectorKind/SimdVectorKind
Renaming to remove any ambiguity as to what "vector" refers to in this context.
This commit is contained in:
@@ -210,7 +210,7 @@ pub fn scalable_vector_type<FieldIdx, VariantIdx, F>(
|
||||
VariantIdx: Idx,
|
||||
F: AsRef<LayoutData<FieldIdx, VariantIdx>> + fmt::Debug,
|
||||
{
|
||||
vector_type_layout(VectorKind::Scalable, self.cx.data_layout(), element, count)
|
||||
vector_type_layout(SimdVectorKind::Scalable, self.cx.data_layout(), element, count)
|
||||
}
|
||||
|
||||
pub fn simd_type<FieldIdx, VariantIdx, F>(
|
||||
@@ -224,7 +224,7 @@ pub fn simd_type<FieldIdx, VariantIdx, F>(
|
||||
VariantIdx: Idx,
|
||||
F: AsRef<LayoutData<FieldIdx, VariantIdx>> + fmt::Debug,
|
||||
{
|
||||
let kind = if repr_packed { VectorKind::PackedFixed } else { VectorKind::Fixed };
|
||||
let kind = if repr_packed { SimdVectorKind::PackedFixed } else { SimdVectorKind::Fixed };
|
||||
vector_type_layout(kind, self.cx.data_layout(), element, count)
|
||||
}
|
||||
|
||||
@@ -1524,7 +1524,7 @@ fn format_field_niches<
|
||||
}
|
||||
}
|
||||
|
||||
enum VectorKind {
|
||||
enum SimdVectorKind {
|
||||
/// `#[rustc_scalable_vector]`
|
||||
Scalable,
|
||||
/// `#[repr(simd, packed)]`
|
||||
@@ -1534,7 +1534,7 @@ enum VectorKind {
|
||||
}
|
||||
|
||||
fn vector_type_layout<FieldIdx, VariantIdx, F>(
|
||||
kind: VectorKind,
|
||||
kind: SimdVectorKind,
|
||||
dl: &TargetDataLayout,
|
||||
element: F,
|
||||
count: u64,
|
||||
@@ -1559,16 +1559,16 @@ fn vector_type_layout<FieldIdx, VariantIdx, F>(
|
||||
let size =
|
||||
elt.size.checked_mul(count, dl).ok_or_else(|| LayoutCalculatorError::SizeOverflow)?;
|
||||
let (repr, align) = match kind {
|
||||
VectorKind::Scalable => {
|
||||
SimdVectorKind::Scalable => {
|
||||
(BackendRepr::SimdScalableVector { element, count }, dl.llvmlike_vector_align(size))
|
||||
}
|
||||
// Non-power-of-two vectors have padding up to the next power-of-two.
|
||||
// If we're a packed repr, remove the padding while keeping the alignment as close
|
||||
// to a vector as possible.
|
||||
VectorKind::PackedFixed if !count.is_power_of_two() => {
|
||||
SimdVectorKind::PackedFixed if !count.is_power_of_two() => {
|
||||
(BackendRepr::Memory { sized: true }, Align::max_aligned_factor(size))
|
||||
}
|
||||
VectorKind::PackedFixed | VectorKind::Fixed => {
|
||||
SimdVectorKind::PackedFixed | SimdVectorKind::Fixed => {
|
||||
(BackendRepr::SimdVector { element, count }, dl.llvmlike_vector_align(size))
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user