@@ -6975,7 +6975,7 @@ static SDValue lowerVectorShuffleAsBlend(SDLoc DL, MVT VT, SDValue V1,
6975
6975
// FALLTHROUGH
6976
6976
case MVT::v16i8:
6977
6977
case MVT::v32i8: {
6978
- assert((VT.getSizeInBits() == 128 || Subtarget->hasAVX2()) &&
6978
+ assert((VT.is128BitVector() || Subtarget->hasAVX2()) &&
6979
6979
"256-bit byte-blends require AVX2 support!");
6980
6980
6981
6981
// Attempt to lower to a bitmask if we can. VPAND is faster than VPBLENDVB.
@@ -7202,7 +7202,7 @@ static SDValue lowerVectorShuffleAsByteRotate(SDLoc DL, MVT VT, SDValue V1,
7202
7202
DAG.getConstant(Rotation * Scale, DL, MVT::i8)));
7203
7203
}
7204
7204
7205
- assert(VT.getSizeInBits() == 128 &&
7205
+ assert(VT.is128BitVector() &&
7206
7206
"Rotate-based lowering only supports 128-bit lowering!");
7207
7207
assert(Mask.size() <= 16 &&
7208
7208
"Can shuffle at most 16 bytes in a 128-bit vector!");
@@ -7490,15 +7490,15 @@ static SDValue lowerVectorShuffleAsSpecificZeroOrAnyExtend(
7490
7490
if (Subtarget->hasSSE41()) {
7491
7491
// Not worth offseting 128-bit vectors if scale == 2, a pattern using
7492
7492
// PUNPCK will catch this in a later shuffle match.
7493
- if (Offset && Scale == 2 && VT.getSizeInBits() == 128 )
7493
+ if (Offset && Scale == 2 && VT.is128BitVector() )
7494
7494
return SDValue();
7495
7495
MVT ExtVT = MVT::getVectorVT(MVT::getIntegerVT(EltBits * Scale),
7496
7496
NumElements / Scale);
7497
7497
InputV = DAG.getNode(X86ISD::VZEXT, DL, ExtVT, ShuffleOffset(InputV));
7498
7498
return DAG.getBitcast(VT, InputV);
7499
7499
}
7500
7500
7501
- assert(VT.getSizeInBits() == 128 && "Only 128-bit vectors can be extended.");
7501
+ assert(VT.is128BitVector() && "Only 128-bit vectors can be extended.");
7502
7502
7503
7503
// For any extends we can cheat for larger element sizes and use shuffle
7504
7504
// instructions that can fold with a load and/or copy.
@@ -7528,7 +7528,7 @@ static SDValue lowerVectorShuffleAsSpecificZeroOrAnyExtend(
7528
7528
// to 64-bits.
7529
7529
if ((Scale * EltBits) == 64 && EltBits < 32 && Subtarget->hasSSE4A()) {
7530
7530
assert(NumElements == (int)Mask.size() && "Unexpected shuffle mask size!");
7531
- assert(VT.getSizeInBits() == 128 && "Unexpected vector width!");
7531
+ assert(VT.is128BitVector() && "Unexpected vector width!");
7532
7532
7533
7533
int LoIdx = Offset * EltBits;
7534
7534
SDValue Lo = DAG.getNode(ISD::BITCAST, DL, MVT::v2i64,
@@ -9917,7 +9917,7 @@ static SDValue lowerVectorShuffleAsLanePermuteAndBlend(SDLoc DL, MVT VT,
9917
9917
ArrayRef<int> Mask,
9918
9918
SelectionDAG &DAG) {
9919
9919
// FIXME: This should probably be generalized for 512-bit vectors as well.
9920
- assert(VT.getSizeInBits() == 256 && "Only for 256-bit vector shuffles!");
9920
+ assert(VT.is256BitVector() && "Only for 256-bit vector shuffles!");
9921
9921
int LaneSize = Mask.size() / 2;
9922
9922
9923
9923
// If there are only inputs from one 128-bit lane, splitting will in fact be
@@ -11120,13 +11120,13 @@ static SDValue lowerVectorShuffle(SDValue Op, const X86Subtarget *Subtarget,
11120
11120
}
11121
11121
11122
11122
// For each vector width, delegate to a specialized lowering routine.
11123
- if (VT.getSizeInBits() == 128 )
11123
+ if (VT.is128BitVector() )
11124
11124
return lower128BitVectorShuffle(Op, V1, V2, VT, Subtarget, DAG);
11125
11125
11126
- if (VT.getSizeInBits() == 256 )
11126
+ if (VT.is256BitVector() )
11127
11127
return lower256BitVectorShuffle(Op, V1, V2, VT, Subtarget, DAG);
11128
11128
11129
- if (VT.getSizeInBits() == 512 )
11129
+ if (VT.is512BitVector() )
11130
11130
return lower512BitVectorShuffle(Op, V1, V2, VT, Subtarget, DAG);
11131
11131
11132
11132
if (Is1BitVector)
@@ -18777,10 +18777,10 @@ static SDValue LowerRotate(SDValue Op, const X86Subtarget *Subtarget,
18777
18777
// +ve/-ve Amt = rotate left/right.
18778
18778
18779
18779
// Split 256-bit integers.
18780
- if (VT.getSizeInBits() == 256 )
18780
+ if (VT.is256BitVector() )
18781
18781
return Lower256IntArith(Op, DAG);
18782
18782
18783
- assert(VT.getSizeInBits() == 128 && "Only rotate 128-bit vectors!");
18783
+ assert(VT.is128BitVector() && "Only rotate 128-bit vectors!");
18784
18784
18785
18785
// Attempt to rotate by immediate.
18786
18786
if (auto *BVAmt = dyn_cast<BuildVectorSDNode>(Amt)) {
@@ -22234,7 +22234,7 @@ static bool combineX86ShuffleChain(SDValue Op, SDValue Root, ArrayRef<int> Mask,
22234
22234
// doesn't preclude something switching to the shorter encoding post-RA.
22235
22235
//
22236
22236
// FIXME: Should teach these routines about AVX vector widths.
22237
- if (FloatDomain && VT.getSizeInBits() == 128 ) {
22237
+ if (FloatDomain && VT.is128BitVector() ) {
22238
22238
if (Mask.equals({0, 0}) || Mask.equals({1, 1})) {
22239
22239
bool Lo = Mask.equals({0, 0});
22240
22240
unsigned Shuffle;
@@ -22298,7 +22298,7 @@ static bool combineX86ShuffleChain(SDValue Op, SDValue Root, ArrayRef<int> Mask,
22298
22298
// We always canonicalize the 8 x i16 and 16 x i8 shuffles into their UNPCK
22299
22299
// variants as none of these have single-instruction variants that are
22300
22300
// superior to the UNPCK formulation.
22301
- if (!FloatDomain && VT.getSizeInBits() == 128 &&
22301
+ if (!FloatDomain && VT.is128BitVector() &&
22302
22302
(Mask.equals({0, 0, 1, 1, 2, 2, 3, 3}) ||
22303
22303
Mask.equals({4, 4, 5, 5, 6, 6, 7, 7}) ||
22304
22304
Mask.equals({0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7}) ||
@@ -23819,11 +23819,10 @@ static SDValue PerformSELECTCombine(SDNode *N, SelectionDAG &DAG,
23819
23819
if (VT.getScalarType() == MVT::i16)
23820
23820
return SDValue();
23821
23821
// Dynamic blending was only available from SSE4.1 onward.
23822
- if (VT.getSizeInBits() == 128 && !Subtarget->hasSSE41())
23822
+ if (VT.is128BitVector() && !Subtarget->hasSSE41())
23823
23823
return SDValue();
23824
23824
// Byte blends are only available in AVX2
23825
- if (VT.getSizeInBits() == 256 && VT.getScalarType() == MVT::i8 &&
23826
- !Subtarget->hasAVX2())
23825
+ if (VT == MVT::v32i8 && !Subtarget->hasAVX2())
23827
23826
return SDValue();
23828
23827
23829
23828
assert(BitWidth >= 8 && BitWidth <= 64 && "Invalid mask size");
@@ -26024,7 +26023,7 @@ static SDValue PerformSExtCombine(SDNode *N, SelectionDAG &DAG,
26024
26023
}
26025
26024
}
26026
26025
26027
- if (Subtarget->hasAVX() && VT.isVector() && VT.getSizeInBits() == 256 )
26026
+ if (Subtarget->hasAVX() && VT.is256BitVector() )
26028
26027
if (SDValue R = WidenMaskArithmetic(N, DAG, DCI, Subtarget))
26029
26028
return R;
26030
26029
0 commit comments