mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Use pshufhw and pshuflw in more cases and fix getTargetShuffleNode number of arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5e7044bd0e
commit
8878e21fe6
@ -2559,7 +2559,7 @@ X86TargetLowering::createFastISel(FunctionLoweringInfo &funcInfo) const {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static SDValue getTargetShuffleNode(unsigned Opc, DebugLoc dl, EVT VT,
|
||||
SDValue V1, SDValue V2, unsigned TargetMask, SelectionDAG &DAG) {
|
||||
SDValue V1, unsigned TargetMask, SelectionDAG &DAG) {
|
||||
|
||||
switch(Opc) {
|
||||
default: llvm_unreachable("Unknown x86 shuffle node");
|
||||
@ -4285,7 +4285,7 @@ X86TargetLowering::LowerVECTOR_SHUFFLEv8i16(SDValue Op,
|
||||
TargetMask = pshufhw ? X86::getShufflePSHUFHWImmediate(NewV.getNode()):
|
||||
X86::getShufflePSHUFLWImmediate(NewV.getNode());
|
||||
V1 = NewV.getOperand(0);
|
||||
return getTargetShuffleNode(Opc, dl, MVT::v8i16, V1, V1, TargetMask, DAG);
|
||||
return getTargetShuffleNode(Opc, dl, MVT::v8i16, V1, TargetMask, DAG);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4359,6 +4359,12 @@ X86TargetLowering::LowerVECTOR_SHUFFLEv8i16(SDValue Op,
|
||||
MaskV.push_back(i);
|
||||
NewV = DAG.getVectorShuffle(MVT::v8i16, dl, NewV, DAG.getUNDEF(MVT::v8i16),
|
||||
&MaskV[0]);
|
||||
|
||||
if (NewV.getOpcode() == ISD::VECTOR_SHUFFLE && Subtarget->hasSSSE3())
|
||||
NewV = getTargetShuffleNode(X86ISD::PSHUFLW, dl, MVT::v8i16,
|
||||
NewV.getOperand(0),
|
||||
X86::getShufflePSHUFLWImmediate(NewV.getNode()),
|
||||
DAG);
|
||||
}
|
||||
|
||||
// If BestHi >= 0, generate a pshufhw to put the high elements in order,
|
||||
@ -4381,6 +4387,12 @@ X86TargetLowering::LowerVECTOR_SHUFFLEv8i16(SDValue Op,
|
||||
}
|
||||
NewV = DAG.getVectorShuffle(MVT::v8i16, dl, NewV, DAG.getUNDEF(MVT::v8i16),
|
||||
&MaskV[0]);
|
||||
|
||||
if (NewV.getOpcode() == ISD::VECTOR_SHUFFLE && Subtarget->hasSSSE3())
|
||||
NewV = getTargetShuffleNode(X86ISD::PSHUFHW, dl, MVT::v8i16,
|
||||
NewV.getOperand(0),
|
||||
X86::getShufflePSHUFHWImmediate(NewV.getNode()),
|
||||
DAG);
|
||||
}
|
||||
|
||||
// In case BestHi & BestLo were both -1, which means each quadword has a word
|
||||
|
@ -5890,12 +5890,16 @@ def : Pat<(v8i16 (X86PShufhwLd addr:$src, (i8 imm:$imm))),
|
||||
(PSHUFHWmi addr:$src, imm:$imm)>;
|
||||
def : Pat<(v8i16 (X86PShufhw VR128:$src, (i8 imm:$imm))),
|
||||
(PSHUFHWri VR128:$src, imm:$imm)>;
|
||||
def : Pat<(v8i16 (X86PShufhw (bc_v8i16 (memopv2i64 addr:$src)), (i8 imm:$imm))),
|
||||
(PSHUFHWmi addr:$src, imm:$imm)>;
|
||||
|
||||
// Shuffle with PSHUFLW
|
||||
def : Pat<(v8i16 (X86PShuflwLd addr:$src, (i8 imm:$imm))),
|
||||
(PSHUFLWmi addr:$src, imm:$imm)>;
|
||||
def : Pat<(v8i16 (X86PShuflw VR128:$src, (i8 imm:$imm))),
|
||||
(PSHUFLWri VR128:$src, imm:$imm)>;
|
||||
def : Pat<(v8i16 (X86PShuflw (bc_v8i16 (memopv2i64 addr:$src)), (i8 imm:$imm))),
|
||||
(PSHUFLWmi addr:$src, imm:$imm)>;
|
||||
|
||||
// Shuffle with PALIGN
|
||||
def : Pat<(v1i64 (X86PAlign VR64:$src1, VR64:$src2, (i8 imm:$imm))),
|
||||
|
Loading…
Reference in New Issue
Block a user