mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 17:29:19 +00:00
Fix a bug in vpermilps mask checking. Fix PR10560
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e1686b08e4
commit
155a92a491
@ -3509,9 +3509,12 @@ static bool isVPERMILPSMask(const SmallVectorImpl<int> &Mask, EVT VT,
|
||||
int LaneSize = NumElts/NumLanes;
|
||||
for (int i = 0; i < LaneSize; ++i) {
|
||||
int HighElt = i+LaneSize;
|
||||
if (Mask[i] < 0 && (isUndefOrInRange(Mask[HighElt], LaneSize, NumElts)))
|
||||
continue;
|
||||
if (Mask[HighElt] < 0 && (isUndefOrInRange(Mask[i], 0, LaneSize)))
|
||||
bool HighValid = isUndefOrInRange(Mask[HighElt], LaneSize, NumElts);
|
||||
bool LowValid = isUndefOrInRange(Mask[i], 0, LaneSize);
|
||||
|
||||
if (!HighValid || !LowValid)
|
||||
return false;
|
||||
if (Mask[i] < 0 || Mask[HighElt] < 0)
|
||||
continue;
|
||||
if (Mask[HighElt]-Mask[i] != LaneSize)
|
||||
return false;
|
||||
|
@ -37,3 +37,9 @@ entry:
|
||||
ret <8 x float> %shuffle
|
||||
}
|
||||
|
||||
; CHECK-NOT: vpermilps
|
||||
define <8 x float> @funcF(<8 x float> %a) nounwind uwtable readnone ssp {
|
||||
entry:
|
||||
%shuffle = shufflevector <8 x float> %a, <8 x float> zeroinitializer, <8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9>
|
||||
ret <8 x float> %shuffle
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user