llvm.org GIT mirror llvm / 156f5bb
Add shuffle decode support for VPERMQ/VPERMPD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156265 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 8 years ago
3 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
504504 MI->getOperand(MI->getNumOperands()-1).getImm(),
505505 ShuffleMask);
506506 Src1Name = getRegName(MI->getOperand(1).getReg());
507 DestName = getRegName(MI->getOperand(0).getReg());
508 break;
509 case X86::VPERMQYri:
510 case X86::VPERMPDYri:
511 Src1Name = getRegName(MI->getOperand(1).getReg());
512 // FALL THROUGH.
513 case X86::VPERMQYmi:
514 case X86::VPERMPDYmi:
515 DecodeVPERMMask(MI->getOperand(MI->getNumOperands()-1).getImm(),
516 ShuffleMask);
507517 DestName = getRegName(MI->getOperand(0).getReg());
508518 break;
509519 }
191191 ShuffleMask.push_back(i);
192192 }
193193
194 /// DecodeVPERMMask - this decodes the shuffle masks for VPERMQ/VPERMPD.
195 /// No VT provided since it only works on 256-bit, 4 element vectors.
196 void DecodeVPERMMask(unsigned Imm, SmallVectorImpl &ShuffleMask) {
197 for (unsigned i = 0; i != 4; ++i) {
198 ShuffleMask.push_back((Imm >> (2*i)) & 3);
199 }
200 }
201
194202 } // llvm namespace
5959 void DecodeVPERM2X128Mask(EVT VT, unsigned Imm,
6060 SmallVectorImpl &ShuffleMask);
6161
62 /// DecodeVPERMMask - this decodes the shuffle masks for VPERMQ/VPERMPD.
63 /// No VT provided since it only works on 256-bit, 4 element vectors.
64 void DecodeVPERMMask(unsigned Imm, SmallVectorImpl &ShuffleMask);
65
6266 } // llvm namespace
6367
6468 #endif