[llvm] r271830 - [X86][XOP] Tidied up DecodeVPERMIL2PMask to more closely match DecodeVPERMILPMask.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 5 07:33:43 PDT 2016
Author: rksimon
Date: Sun Jun 5 09:33:43 2016
New Revision: 271830
URL: http://llvm.org/viewvc/llvm-project?rev=271830&view=rev
Log:
[X86][XOP] Tidied up DecodeVPERMIL2PMask to more closely match DecodeVPERMILPMask.
Modified:
llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
Modified: llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp?rev=271830&r1=271829&r2=271830&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp Sun Jun 5 09:33:43 2016
@@ -212,9 +212,11 @@ void DecodeVPERMIL2PMask(const Constant
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;
More information about the llvm-commits
mailing list