mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 17:39:16 +00:00
[X86][SSE] movddup shuffle mask decodes
Patch to provide shuffle decodes and asm comments for the SSE3/AVX1 movddup double duplication instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226705 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bc1819e62e
commit
a7a4b836a3
@ -200,12 +200,30 @@ bool llvm::EmitAnyX86InstComments(const MCInst *MI, raw_ostream &OS,
|
||||
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);
|
||||
break;
|
||||
|
||||
case X86::VMOVDDUPYrr:
|
||||
Src1Name = getRegName(MI->getOperand(1).getReg());
|
||||
// FALL THROUGH.
|
||||
case X86::VMOVDDUPYrm:
|
||||
DestName = getRegName(MI->getOperand(0).getReg());
|
||||
DecodeMOVDDUPMask(MVT::v4f64, ShuffleMask);
|
||||
break;
|
||||
|
||||
case X86::MOVDDUPrr:
|
||||
case X86::VMOVDDUPrr:
|
||||
Src1Name = getRegName(MI->getOperand(1).getReg());
|
||||
// FALL THROUGH.
|
||||
case X86::MOVDDUPrm:
|
||||
case X86::VMOVDDUPrm:
|
||||
DestName = getRegName(MI->getOperand(0).getReg());
|
||||
DecodeMOVDDUPMask(MVT::v2f64, ShuffleMask);
|
||||
break;
|
||||
|
||||
case X86::PSLLDQri:
|
||||
case X86::VPSLLDQri:
|
||||
Src1Name = getRegName(MI->getOperand(1).getReg());
|
||||
DestName = getRegName(MI->getOperand(0).getReg());
|
||||
if(MI->getOperand(MI->getNumOperands()-1).isImm())
|
||||
DecodePSLLDQMask(MVT::v16i8,
|
||||
|
@ -76,12 +76,26 @@ void DecodeMOVSHDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void DecodeMOVDDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask) {
|
||||
unsigned VectorSizeInBits = VT.getSizeInBits();
|
||||
unsigned ScalarSizeInBits = VT.getScalarSizeInBits();
|
||||
unsigned NumElts = VT.getVectorNumElements();
|
||||
unsigned NumLanes = VectorSizeInBits / 128;
|
||||
unsigned NumLaneElts = NumElts / NumLanes;
|
||||
unsigned NumLaneSubElts = 64 / ScalarSizeInBits;
|
||||
|
||||
for (unsigned l = 0; l < NumElts; l += NumLaneElts)
|
||||
for (unsigned i = 0; i < NumLaneElts; i += NumLaneSubElts)
|
||||
for (unsigned s = 0; s != NumLaneSubElts; s++)
|
||||
ShuffleMask.push_back(l + s);
|
||||
}
|
||||
|
||||
void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask) {
|
||||
unsigned VectorSizeInBits = VT.getSizeInBits();
|
||||
unsigned NumElts = VectorSizeInBits / 8;
|
||||
unsigned NumLanes = VectorSizeInBits / 128;
|
||||
unsigned NumLaneElts = NumElts / NumLanes;
|
||||
|
||||
|
@ -37,12 +37,14 @@ void DecodeMOVHLPSMask(unsigned NElts, SmallVectorImpl<int> &ShuffleMask);
|
||||
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);
|
||||
|
||||
void DecodeMOVSHDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);
|
||||
|
||||
void DecodeMOVDDUPMask(MVT VT, SmallVectorImpl<int> &ShuffleMask);
|
||||
|
||||
void DecodePSLLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);
|
||||
|
||||
void DecodePSRLDQMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);
|
||||
|
||||
void DecodePALIGNRMask(MVT VT, unsigned Imm, SmallVectorImpl<int> &ShuffleMask);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user