@@ -229,11 +229,11 @@ static MVT scaleVectorType(MVT VT) {
229
229
VT.getVectorNumElements () / 2 );
230
230
}
231
231
232
- static uint32_t Concat[] = {
233
- 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ,
234
- 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 ,
235
- 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 ,
236
- 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 , 63 };
232
+ static constexpr int Concat[] = {
233
+ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 ,
234
+ 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 ,
235
+ 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 ,
236
+ 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 , 63 };
237
237
238
238
// genShuffleBland - Creates shuffle according to two vectors.This function is
239
239
// only works on instructions with lane inside 256 registers. According to
@@ -251,9 +251,9 @@ static uint32_t Concat[] = {
251
251
// By computing the shuffle on a sequence of 16 elements(one lane) and add the
252
252
// correct offset. We are creating a vpsuffed + blend sequence between two
253
253
// shuffles.
254
- static void genShuffleBland (MVT VT, ArrayRef<uint32_t > Mask,
255
- SmallVectorImpl<uint32_t > &Out, int LowOffset,
256
- int HighOffset) {
254
+ static void genShuffleBland (MVT VT, ArrayRef<int > Mask,
255
+ SmallVectorImpl<int > &Out, int LowOffset,
256
+ int HighOffset) {
257
257
assert (VT.getSizeInBits () >= 256 &&
258
258
" This function doesn't accept width smaller then 256" );
259
259
unsigned NumOfElm = VT.getVectorNumElements ();
@@ -282,9 +282,9 @@ static void genShuffleBland(MVT VT, ArrayRef<uint32_t> Mask,
282
282
// Invec[2] - |2|5|8|11| TransposedMatrix[2] - |8|9|10|11|
283
283
284
284
static void reorderSubVector (MVT VT, SmallVectorImpl<Value *> &TransposedMatrix,
285
- ArrayRef<Value *> Vec, ArrayRef<uint32_t > VPShuf,
286
- unsigned VecElems, unsigned Stride,
287
- IRBuilder<> &Builder) {
285
+ ArrayRef<Value *> Vec, ArrayRef<int > VPShuf,
286
+ unsigned VecElems, unsigned Stride,
287
+ IRBuilder<> &Builder) {
288
288
289
289
if (VecElems == 16 ) {
290
290
for (unsigned i = 0 ; i < Stride; i++)
@@ -293,7 +293,7 @@ static void reorderSubVector(MVT VT, SmallVectorImpl<Value *> &TransposedMatrix,
293
293
return ;
294
294
}
295
295
296
- SmallVector<uint32_t , 32 > OptimizeShuf;
296
+ SmallVector<int , 32 > OptimizeShuf;
297
297
Value *Temp[8 ];
298
298
299
299
for (unsigned i = 0 ; i < (VecElems / 16 ) * Stride; i += 2 ) {
@@ -433,7 +433,7 @@ void X86InterleavedAccessGroup::interleave8bitStride4(
433
433
// For example shuffle pattern for VF 16 register size 256 -> lanes = 2
434
434
// {<[0|3|6|1|4|7|2|5]-[8|11|14|9|12|15|10|13]>}
435
435
static void createShuffleStride (MVT VT, int Stride,
436
- SmallVectorImpl<uint32_t > &Mask) {
436
+ SmallVectorImpl<int > &Mask) {
437
437
int VectorSize = VT.getSizeInBits ();
438
438
int VF = VT.getVectorNumElements ();
439
439
int LaneCount = std::max (VectorSize / 128 , 1 );
@@ -446,7 +446,7 @@ static void createShuffleStride(MVT VT, int Stride,
446
446
// inside mask a shuffleMask. A mask contains exactly 3 groups, where
447
447
// each group is a monotonically increasing sequence with stride 3.
448
448
// For example shuffleMask {0,3,6,1,4,7,2,5} => {3,3,2}
449
- static void setGroupSize (MVT VT, SmallVectorImpl<uint32_t > &SizeInfo) {
449
+ static void setGroupSize (MVT VT, SmallVectorImpl<int > &SizeInfo) {
450
450
int VectorSize = VT.getSizeInBits ();
451
451
int VF = VT.getVectorNumElements () / std::max (VectorSize / 128 , 1 );
452
452
for (int i = 0 , FirstGroupElement = 0 ; i < 3 ; i++) {
@@ -470,7 +470,7 @@ static void setGroupSize(MVT VT, SmallVectorImpl<uint32_t> &SizeInfo) {
470
470
// direction of the alignment. (false - align to the "right" side while true -
471
471
// align to the "left" side)
472
472
static void DecodePALIGNRMask (MVT VT, unsigned Imm,
473
- SmallVectorImpl<uint32_t > &ShuffleMask,
473
+ SmallVectorImpl<int > &ShuffleMask,
474
474
bool AlignDirection = true , bool Unary = false ) {
475
475
unsigned NumElts = VT.getVectorNumElements ();
476
476
unsigned NumLanes = std::max ((int )VT.getSizeInBits () / 128 , 1 );
@@ -547,11 +547,11 @@ void X86InterleavedAccessGroup::deinterleave8bitStride3(
547
547
// Matrix[2]= b5 c5 a6 b6 c6 a7 b7 c7
548
548
549
549
TransposedMatrix.resize (3 );
550
- SmallVector<uint32_t , 32 > VPShuf;
551
- SmallVector<uint32_t , 32 > VPAlign[2 ];
552
- SmallVector<uint32_t , 32 > VPAlign2;
553
- SmallVector<uint32_t , 32 > VPAlign3;
554
- SmallVector<uint32_t , 3 > GroupSize;
550
+ SmallVector<int , 32 > VPShuf;
551
+ SmallVector<int , 32 > VPAlign[2 ];
552
+ SmallVector<int , 32 > VPAlign2;
553
+ SmallVector<int , 32 > VPAlign3;
554
+ SmallVector<int , 3 > GroupSize;
555
555
Value *Vec[6 ], *TempVector[3 ];
556
556
557
557
MVT VT = MVT::getVT (Shuffles[0 ]->getType ());
@@ -605,8 +605,8 @@ void X86InterleavedAccessGroup::deinterleave8bitStride3(
605
605
// group2Shuffle reorder the shuffle stride back into continuous order.
606
606
// For example For VF16 with Mask1 = {0,3,6,9,12,15,2,5,8,11,14,1,4,7,10,13} =>
607
607
// MaskResult = {0,11,6,1,12,7,2,13,8,3,14,9,4,15,10,5}.
608
- static void group2Shuffle (MVT VT, SmallVectorImpl<uint32_t > &Mask,
609
- SmallVectorImpl<uint32_t > &Output) {
608
+ static void group2Shuffle (MVT VT, SmallVectorImpl<int > &Mask,
609
+ SmallVectorImpl<int > &Output) {
610
610
int IndexGroup[3 ] = {0 , 0 , 0 };
611
611
int Index = 0 ;
612
612
int VectorWidth = VT.getSizeInBits ();
@@ -633,11 +633,11 @@ void X86InterleavedAccessGroup::interleave8bitStride3(
633
633
// Matrix[2]= c0 c1 c2 c3 c3 a7 b7 c7
634
634
635
635
TransposedMatrix.resize (3 );
636
- SmallVector<uint32_t , 3 > GroupSize;
637
- SmallVector<uint32_t , 32 > VPShuf;
638
- SmallVector<uint32_t , 32 > VPAlign[3 ];
639
- SmallVector<uint32_t , 32 > VPAlign2;
640
- SmallVector<uint32_t , 32 > VPAlign3;
636
+ SmallVector<int , 3 > GroupSize;
637
+ SmallVector<int , 32 > VPShuf;
638
+ SmallVector<int , 32 > VPAlign[3 ];
639
+ SmallVector<int , 32 > VPAlign2;
640
+ SmallVector<int , 32 > VPAlign3;
641
641
642
642
Value *Vec[3 ], *TempVector[3 ];
643
643
MVT VT = MVT::getVectorVT (MVT::i8, VecElems);
@@ -692,25 +692,25 @@ void X86InterleavedAccessGroup::transpose_4x4(
692
692
TransposedMatrix.resize (4 );
693
693
694
694
// dst = src1[0,1],src2[0,1]
695
- uint32_t IntMask1[] = {0 , 1 , 4 , 5 };
696
- ArrayRef<uint32_t > Mask = makeArrayRef (IntMask1, 4 );
695
+ static constexpr int IntMask1[] = {0 , 1 , 4 , 5 };
696
+ ArrayRef<int > Mask = makeArrayRef (IntMask1, 4 );
697
697
Value *IntrVec1 = Builder.CreateShuffleVector (Matrix[0 ], Matrix[2 ], Mask);
698
698
Value *IntrVec2 = Builder.CreateShuffleVector (Matrix[1 ], Matrix[3 ], Mask);
699
699
700
700
// dst = src1[2,3],src2[2,3]
701
- uint32_t IntMask2[] = {2 , 3 , 6 , 7 };
701
+ static constexpr int IntMask2[] = {2 , 3 , 6 , 7 };
702
702
Mask = makeArrayRef (IntMask2, 4 );
703
703
Value *IntrVec3 = Builder.CreateShuffleVector (Matrix[0 ], Matrix[2 ], Mask);
704
704
Value *IntrVec4 = Builder.CreateShuffleVector (Matrix[1 ], Matrix[3 ], Mask);
705
705
706
706
// dst = src1[0],src2[0],src1[2],src2[2]
707
- uint32_t IntMask3[] = {0 , 4 , 2 , 6 };
707
+ static constexpr int IntMask3[] = {0 , 4 , 2 , 6 };
708
708
Mask = makeArrayRef (IntMask3, 4 );
709
709
TransposedMatrix[0 ] = Builder.CreateShuffleVector (IntrVec1, IntrVec2, Mask);
710
710
TransposedMatrix[2 ] = Builder.CreateShuffleVector (IntrVec3, IntrVec4, Mask);
711
711
712
712
// dst = src1[1],src2[1],src1[3],src2[3]
713
- uint32_t IntMask4[] = {1 , 5 , 3 , 7 };
713
+ static constexpr int IntMask4[] = {1 , 5 , 3 , 7 };
714
714
Mask = makeArrayRef (IntMask4, 4 );
715
715
TransposedMatrix[1 ] = Builder.CreateShuffleVector (IntrVec1, IntrVec2, Mask);
716
716
TransposedMatrix[3 ] = Builder.CreateShuffleVector (IntrVec3, IntrVec4, Mask);
0 commit comments