[PATCH] SSE pslldq/psrldq shuffle mask decodes

Simon Pilgrim llvm-dev at redking.me.uk
Mon Oct 6 03:25:45 PDT 2014


================
Comment at: lib/Target/X86/Utils/X86ShuffleDecode.cpp:83-84
@@ +82,4 @@
+void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
+  unsigned NumElts = VT.getVectorNumElements();
+  unsigned Offset = Imm * (VT.getVectorElementType().getSizeInBits() / 8);
+
----------------
chandlerc wrote:
> I wouldn't decode this in terms of the vector element type. The mask should be a byte-vector mask in all cases, and VT should just provide the size of the vector (128-bit, 256-bit, 512-bit, whatever).
Yes I'd be happy to do that - I just followed the pattern from palignr. This does mean that the computed ShuffleMask count might not match the number of elements in the MVT. Would it be better to change the MVT VT argument to unsigned VectorSizeInBytes to make that clear?

http://reviews.llvm.org/D5598






More information about the llvm-commits mailing list