[PATCH] SSE pslldq/psrldq shuffle mask decodes

Chandler Carruth chandlerc at gmail.com
Sun Oct 12 18:24:57 PDT 2014


================
Comment at: lib/Target/X86/InstPrinter/X86InstComments.cpp:207
@@ +206,3 @@
+    if(MI->getOperand(MI->getNumOperands()-1).isImm())
+      DecodePSLLDQMask(MVT(MVT::v16i8).getSizeInBits(),
+                       MI->getOperand(MI->getNumOperands()-1).getImm(),
----------------
This code doesn't really make sense. If you know the exact type you know the exact size, just pass 128.

But what I meant with my comment was still to pass the MVT down, but to do the getSizeInBits query inside the decode routine.

================
Comment at: lib/Target/X86/Utils/X86ShuffleDecode.cpp:87
@@ +86,3 @@
+
+  for (unsigned l = 0; l != NumElts; l += NumLaneElts) {
+    for (unsigned i = 0; i != NumLaneElts; ++i) {
----------------
No need for braces aroun the outer loop.

The above loop also uses int and < which is my personal preference for these loops.

================
Comment at: test/CodeGen/X86/vector-shuffle-128-v8.ll:1403
@@ -1402,3 +1402,3 @@
 ; SSE-NEXT:    movd %eax, %xmm0
-; SSE-NEXT:    pslldq $2, %xmm0
+; SSE-NEXT:    pslldq $2, %xmm0 {{.*#+}} xmm0 = zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
 ; SSE-NEXT:    retq
----------------
No need to give the operands here when checking the comment. It looks like all of the new comments in this file need the same treatment.

http://reviews.llvm.org/D5598






More information about the llvm-commits mailing list