mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
[X86][SSE] lowerVectorShuffleAsByteShift tidyup
Removed local isSequential predicate and use standard helper isSequentialOrUndefInRange instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7721,17 +7721,6 @@ static SDValue lowerVectorShuffleAsByteShift(SDLoc DL, MVT VT, SDValue V1,
|
|||||||
int Size = Mask.size();
|
int Size = Mask.size();
|
||||||
int Scale = 16 / Size;
|
int Scale = 16 / Size;
|
||||||
|
|
||||||
auto isSequential = [](int Base, int StartIndex, int EndIndex, int MaskOffset,
|
|
||||||
ArrayRef<int> Mask) {
|
|
||||||
for (int i = StartIndex; i < EndIndex; i++) {
|
|
||||||
if (Mask[i] < 0)
|
|
||||||
continue;
|
|
||||||
if (i + Base != Mask[i] - MaskOffset)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
for (int Shift = 1; Shift < Size; Shift++) {
|
for (int Shift = 1; Shift < Size; Shift++) {
|
||||||
int ByteShift = Shift * Scale;
|
int ByteShift = Shift * Scale;
|
||||||
|
|
||||||
@@ -7745,8 +7734,10 @@ static SDValue lowerVectorShuffleAsByteShift(SDLoc DL, MVT VT, SDValue V1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ZeroableRight) {
|
if (ZeroableRight) {
|
||||||
bool ValidShiftRight1 = isSequential(Shift, 0, Size - Shift, 0, Mask);
|
bool ValidShiftRight1 =
|
||||||
bool ValidShiftRight2 = isSequential(Shift, 0, Size - Shift, Size, Mask);
|
isSequentialOrUndefInRange(Mask, 0, Size - Shift, Shift);
|
||||||
|
bool ValidShiftRight2 =
|
||||||
|
isSequentialOrUndefInRange(Mask, 0, Size - Shift, Size + Shift);
|
||||||
|
|
||||||
if (ValidShiftRight1 || ValidShiftRight2) {
|
if (ValidShiftRight1 || ValidShiftRight2) {
|
||||||
// Cast the inputs to v2i64 to match PSRLDQ.
|
// Cast the inputs to v2i64 to match PSRLDQ.
|
||||||
@@ -7768,8 +7759,10 @@ static SDValue lowerVectorShuffleAsByteShift(SDLoc DL, MVT VT, SDValue V1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ZeroableLeft) {
|
if (ZeroableLeft) {
|
||||||
bool ValidShiftLeft1 = isSequential(-Shift, Shift, Size, 0, Mask);
|
bool ValidShiftLeft1 =
|
||||||
bool ValidShiftLeft2 = isSequential(-Shift, Shift, Size, Size, Mask);
|
isSequentialOrUndefInRange(Mask, Shift, Size - Shift, 0);
|
||||||
|
bool ValidShiftLeft2 =
|
||||||
|
isSequentialOrUndefInRange(Mask, Shift, Size - Shift, Size);
|
||||||
|
|
||||||
if (ValidShiftLeft1 || ValidShiftLeft2) {
|
if (ValidShiftLeft1 || ValidShiftLeft2) {
|
||||||
// Cast the inputs to v2i64 to match PSLLDQ.
|
// Cast the inputs to v2i64 to match PSLLDQ.
|
||||||
|
Reference in New Issue
Block a user