mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-09 05:11:39 +00:00
Use MOVHLPS node instead of matching using movhlps and movhlps_undef pattern fragments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b5d84d13bc
commit
7ff30bb1a5
@ -2585,6 +2585,7 @@ static bool isTargetShuffle(unsigned Opcode) {
|
||||
case X86ISD::SHUFPD:
|
||||
case X86ISD::SHUFPS:
|
||||
case X86ISD::MOVLHPS:
|
||||
case X86ISD::MOVHLPS:
|
||||
case X86ISD::MOVSS:
|
||||
case X86ISD::MOVSD:
|
||||
case X86ISD::PUNPCKLDQ:
|
||||
@ -2624,6 +2625,7 @@ static SDValue getTargetShuffleNode(unsigned Opc, DebugLoc dl, EVT VT,
|
||||
default: llvm_unreachable("Unknown x86 shuffle node");
|
||||
case X86ISD::MOVLHPS:
|
||||
case X86ISD::MOVLHPD:
|
||||
case X86ISD::MOVHLPS:
|
||||
case X86ISD::MOVSS:
|
||||
case X86ISD::MOVSD:
|
||||
case X86ISD::PUNPCKLDQ:
|
||||
@ -5021,6 +5023,22 @@ SDValue getMOVLowToHigh(SDValue &Op, DebugLoc &dl, SelectionDAG &DAG,
|
||||
return getTargetShuffleNode(X86ISD::MOVLHPS, dl, VT, V1, V2, DAG);
|
||||
}
|
||||
|
||||
static
|
||||
SDValue getMOVHighToLow(SDValue &Op, DebugLoc &dl, SelectionDAG &DAG) {
|
||||
SDValue V1 = Op.getOperand(0);
|
||||
SDValue V2 = Op.getOperand(1);
|
||||
EVT VT = Op.getValueType();
|
||||
|
||||
assert((VT == MVT::v4i32 || VT == MVT::v4f32) &&
|
||||
"unsupported shuffle type");
|
||||
|
||||
if (V2.getOpcode() == ISD::UNDEF)
|
||||
V2 = V1;
|
||||
|
||||
// v4i32 or v4f32
|
||||
return getTargetShuffleNode(X86ISD::MOVHLPS, dl, VT, V1, V2, DAG);
|
||||
}
|
||||
|
||||
SDValue
|
||||
X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const {
|
||||
ShuffleVectorSDNode *SVOp = cast<ShuffleVectorSDNode>(Op);
|
||||
@ -5131,6 +5149,9 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const {
|
||||
if (X86::isMOVLHPSMask(SVOp) && !X86::isUNPCKLMask(SVOp))
|
||||
return getMOVLowToHigh(Op, dl, DAG, HasSSE2);
|
||||
|
||||
if (X86::isMOVHLPSMask(SVOp))
|
||||
return getMOVHighToLow(Op, dl, DAG);
|
||||
|
||||
if (X86::isMOVSHDUPMask(SVOp) ||
|
||||
X86::isMOVSLDUPMask(SVOp) ||
|
||||
X86::isMOVHLPSMask(SVOp) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user