case X86::MOVSHDUPrm:
case X86::VMOVSHDUPrm:
DestName = getRegName(MI->getOperand(0).getReg());
- DecodeMOVSHDUPMask(MVT::v4f32, ShuffleMask);
- break;
-
- case X86::PSLLDQri:
- case X86::VPSLLDQri:
- Src1Name = getRegName(MI->getOperand(1).getReg());
+ DecodeMOVSHDUPMask(MVT::v4f32, ShuffleMask);\r
+ break;\r
+\r
+ case X86::VMOVDDUPYrr:\r
+ Src1Name = getRegName(MI->getOperand(1).getReg());\r
+ // FALL THROUGH.\r
+ case X86::VMOVDDUPYrm:\r
+ DestName = getRegName(MI->getOperand(0).getReg());\r
+ DecodeMOVDDUPMask(MVT::v4f64, ShuffleMask);\r
+ break;\r
+\r
+ case X86::MOVDDUPrr:\r
+ case X86::VMOVDDUPrr:\r
+ Src1Name = getRegName(MI->getOperand(1).getReg());\r
+ // FALL THROUGH.\r
+ case X86::MOVDDUPrm:\r
+ case X86::VMOVDDUPrm:\r
+ DestName = getRegName(MI->getOperand(0).getReg());\r
+ DecodeMOVDDUPMask(MVT::v2f64, ShuffleMask);\r
+ break;\r
+\r
+ case X86::PSLLDQri:\r
+ case X86::VPSLLDQri:\r
+ Src1Name = getRegName(MI->getOperand(1).getReg());\r
DestName = getRegName(MI->getOperand(0).getReg());
if(MI->getOperand(MI->getNumOperands()-1).isImm())
DecodePSLLDQMask(MVT::v16i8,
for (int i = 0, e = NumElts / 2; i < e; ++i) {
ShuffleMask.push_back(2 * i + 1);
ShuffleMask.push_back(2 * i + 1);
- }
-}
-
-void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
- unsigned VectorSizeInBits = VT.getSizeInBits();
- unsigned NumElts = VectorSizeInBits / 8;
+ }\r
+}\r
+\r
+void DecodeMOVDDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {\r
+ unsigned VectorSizeInBits = VT.getSizeInBits();\r
+ unsigned ScalarSizeInBits = VT.getScalarSizeInBits();\r
+ unsigned NumElts = VT.getVectorNumElements();\r
+ unsigned NumLanes = VectorSizeInBits / 128;\r
+ unsigned NumLaneElts = NumElts / NumLanes;\r
+ unsigned NumLaneSubElts = 64 / ScalarSizeInBits;\r
+\r
+ for (unsigned l = 0; l < NumElts; l += NumLaneElts)\r
+ for (unsigned i = 0; i < NumLaneElts; i += NumLaneSubElts)\r
+ for (unsigned s = 0; s != NumLaneSubElts; s++)\r
+ ShuffleMask.push_back(l + s);\r
+}\r
+\r
+void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {\r
+ unsigned VectorSizeInBits = VT.getSizeInBits();\r
+ unsigned NumElts = VectorSizeInBits / 8;\r
unsigned NumLanes = VectorSizeInBits / 128;
unsigned NumLaneElts = NumElts / NumLanes;
void DecodeMOVLHPSMask(unsigned NElts, SmallVectorImpl<int> &ShuffleMask);
void DecodeMOVSLDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);
-
-void DecodeMOVSHDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);
-
-void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);
-
-void DecodePSRLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);
+\r
+void DecodeMOVSHDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);\r
+\r
+void DecodeMOVDDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);\r
+\r
+void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);\r
+\r
+void DecodePSRLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);\r
void DecodePALIGNRMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);