forked from OSchip/llvm-project
parent
36dd7c98d1
commit
5421206c4b
|
@ -3015,8 +3015,20 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
|||
N2 = DAG.getConstant(cast<ConstantSDNode>(N2)->getValue(), MVT::i32);
|
||||
return DAG.getNode(X86ISD::PINSRW, VT, N0, N1, N2);
|
||||
} else if (MVT::getSizeInBits(BaseVT) == 32) {
|
||||
// Use two pinsrw instructions to insert a 32 bit value.
|
||||
unsigned Idx = cast<ConstantSDNode>(N2)->getValue();
|
||||
if (Idx == 0) {
|
||||
// Use a movss.
|
||||
N1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, VT, N1);
|
||||
MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(4);
|
||||
MVT::ValueType BaseVT = MVT::getVectorBaseType(MaskVT);
|
||||
std::vector<SDOperand> MaskVec;
|
||||
MaskVec.push_back(DAG.getConstant(4, BaseVT));
|
||||
for (unsigned i = 1; i <= 3; ++i)
|
||||
MaskVec.push_back(DAG.getConstant(i, BaseVT));
|
||||
return DAG.getNode(ISD::VECTOR_SHUFFLE, VT, N0, N1,
|
||||
DAG.getNode(ISD::BUILD_VECTOR, MaskVT, MaskVec));
|
||||
} else {
|
||||
// Use two pinsrw instructions to insert a 32 bit value.
|
||||
Idx <<= 1;
|
||||
if (MVT::isFloatingPoint(N1.getValueType())) {
|
||||
if (N1.getOpcode() == ISD::LOAD) {
|
||||
|
@ -3038,6 +3050,7 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
|
|||
DAG.getConstant(Idx+1, MVT::i32));
|
||||
return DAG.getNode(ISD::BIT_CONVERT, VT, N0);
|
||||
}
|
||||
}
|
||||
|
||||
return SDOperand();
|
||||
}
|
||||
|
|
|
@ -2414,6 +2414,11 @@ def : Pat<(v4i32 (vector_shuffle (bc_v4i32 (loadv2i64 addr:$src)), (undef),
|
|||
MOVSLDUP_shuffle_mask)),
|
||||
(MOVSLDUPrm addr:$src)>, Requires<[HasSSE3]>;
|
||||
|
||||
// vector_shuffle v1, v2 <4, 1, 2, 3>
|
||||
def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2,
|
||||
MOVS_shuffle_mask)),
|
||||
(MOVLPSrr VR128:$src1, VR128:$src2)>;
|
||||
|
||||
// 128-bit logical shifts
|
||||
def : Pat<(int_x86_sse2_psll_dq VR128:$src1, imm:$src2),
|
||||
(v2i64 (PSLLDQri VR128:$src1, (PSxLDQ_imm imm:$src2)))>,
|
||||
|
|
Loading…
Reference in New Issue