[x86] Teach my pshufb comment printer to handle VPSHUFB forms as well as
authorChandler Carruth <chandlerc@gmail.com>
Sat, 2 Aug 2014 10:08:17 +0000 (10:08 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 2 Aug 2014 10:08:17 +0000 (10:08 +0000)
PSHUFB forms. This will be important to update some AVX tests when I add
PSHUFB combining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214624 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86MCInstLower.cpp

index febf821e13d358c64079d15db3271bc0d4038be5..a2bee7a3235af71d317b89c0a445431f5ae760b5 100644 (file)
@@ -968,6 +968,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
     return;
 
   case X86::PSHUFBrm:
+  case X86::VPSHUFBrm:
     // Lower PSHUFB normally but add a comment if we can find a constant
     // shuffle mask. We won't be able to do this at the MC layer because the
     // mask isn't an immediate.
@@ -975,8 +976,8 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
     raw_string_ostream CS(Comment);
     SmallVector<int, 16> Mask;
 
-    assert(MI->getNumOperands() == 7 &&
-           "Wrong number of operansd for PSHUFBrm");
+    assert(MI->getNumOperands() >= 6 &&
+           "Wrong number of operansd for PSHUFBrm or VPSHUFBrm");
     const MachineOperand &DstOp = MI->getOperand(0);
     const MachineOperand &SrcOp = MI->getOperand(1);
     const MachineOperand &MaskOp = MI->getOperand(5);