@@ -10,8 +10,8 @@ use tracing::{debug, trace};
1010
1111use crate :: {
1212 AbiAlign , Align , BackendRepr , FieldsShape , HasDataLayout , IndexSlice , IndexVec , Integer ,
13- LayoutData , Niche , NonZeroUsize , Primitive , ReprOptions , Scalar , Size , StructKind , TagEncoding ,
14- TargetDataLayout , Variants , WrappingRange ,
13+ LayoutData , Niche , NonZeroUsize , NumScalableVectors , Primitive , ReprOptions , Scalar , Size ,
14+ StructKind , TagEncoding , TargetDataLayout , Variants , WrappingRange ,
1515} ;
1616
1717mod coroutine;
@@ -204,13 +204,19 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
204204 & self ,
205205 element : F ,
206206 count : u64 ,
207+ number_of_vectors : NumScalableVectors ,
207208 ) -> LayoutCalculatorResult < FieldIdx , VariantIdx , F >
208209 where
209210 FieldIdx : Idx ,
210211 VariantIdx : Idx ,
211212 F : AsRef < LayoutData < FieldIdx , VariantIdx > > + fmt:: Debug ,
212213 {
213- vector_type_layout ( SimdVectorKind :: Scalable , self . cx . data_layout ( ) , element, count)
214+ vector_type_layout (
215+ SimdVectorKind :: Scalable ( number_of_vectors) ,
216+ self . cx . data_layout ( ) ,
217+ element,
218+ count,
219+ )
214220 }
215221
216222 pub fn simd_type < FieldIdx , VariantIdx , F > (
@@ -1526,7 +1532,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
15261532
15271533enum SimdVectorKind {
15281534 /// `#[rustc_scalable_vector]`
1529- Scalable ,
1535+ Scalable ( NumScalableVectors ) ,
15301536 /// `#[repr(simd, packed)]`
15311537 PackedFixed ,
15321538 /// `#[repr(simd)]`
@@ -1559,9 +1565,10 @@ where
15591565 let size =
15601566 elt. size . checked_mul ( count, dl) . ok_or_else ( || LayoutCalculatorError :: SizeOverflow ) ?;
15611567 let ( repr, align) = match kind {
1562- SimdVectorKind :: Scalable => {
1563- ( BackendRepr :: SimdScalableVector { element, count } , dl. llvmlike_vector_align ( size) )
1564- }
1568+ SimdVectorKind :: Scalable ( number_of_vectors) => (
1569+ BackendRepr :: SimdScalableVector { element, count, number_of_vectors } ,
1570+ dl. llvmlike_vector_align ( size) ,
1571+ ) ,
15651572 // Non-power-of-two vectors have padding up to the next power-of-two.
15661573 // If we're a packed repr, remove the padding while keeping the alignment as close
15671574 // to a vector as possible.
0 commit comments