[X86][XOP] Tidied up DecodeVPERMIL2PMask to more closely match DecodeVPERMILPMask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Pilgrim 2016-06-05 14:33:43 +00:00
parent 3789c0fe24
commit b8b77a8df5

View File

@ -212,9 +212,11 @@ void DecodeVPERMIL2PMask(const Constant *C, unsigned M2Z, unsigned ElSize,
continue;
}
int Index = Selector & 0x3;
Index >>= (ElSize == 64 ? 1 : 0);
Index += (i / NumElementsPerLane) * NumElementsPerLane;
int Index = i & ~(NumElementsPerLane - 1);
if (ElSize == 64)
Index += (Selector >> 1) & 0x1;
else
Index += Selector & 0x3;
int Src = (Selector >> 2) & 0x1;
Index += Src * NumElements;