From 6b6aeb3806a877fb2a290450fe4761e2eeab50e2 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 22 Oct 2008 11:24:12 +0000 Subject: [PATCH] Get this working with LegalizeTypes: (1) don't assume that i64 has been turned into a BUILD_PAIR node (when called from LegalizeTypes this hasn't happened yet) and don't use a vector shuffle mask with an illegal element type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57972 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 4ab5fe7dab2..6007f9d1ad2 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -4760,15 +4760,19 @@ SDValue X86TargetLowering::LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) { SDValue UnpcklMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, &MaskVec[0], MaskVec.size()); SmallVector MaskVec2; - MaskVec2.push_back(DAG.getConstant(1, MVT::i64)); - MaskVec2.push_back(DAG.getConstant(0, MVT::i64)); - SDValue ShufMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i64, &MaskVec2[0], + MaskVec2.push_back(DAG.getConstant(1, MVT::i32)); + MaskVec2.push_back(DAG.getConstant(0, MVT::i32)); + SDValue ShufMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i32, &MaskVec2[0], MaskVec2.size()); SDValue XR1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v4i32, - Op.getOperand(0).getOperand(1)); + DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, + Op.getOperand(0), + DAG.getIntPtrConstant(1))); SDValue XR2 = DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v4i32, - Op.getOperand(0).getOperand(0)); + DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, + Op.getOperand(0), + DAG.getIntPtrConstant(0))); SDValue Unpck1 = DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v4i32, XR1, XR2, UnpcklMask); SDValue CLod0 = DAG.getLoad(MVT::v4i32, DAG.getEntryNode(), CPIdx0, -- 2.34.1