More APInt-ification.
authorDan Gohman <gohman@apple.com>
Mon, 3 Mar 2008 22:20:46 +0000 (22:20 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 3 Mar 2008 22:20:46 +0000 (22:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47864 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index c28c2f9236da06f313f15b939b41241a48e7ff81..0dc4447343f4e1350cbd1e467181713914154d33 100644 (file)
@@ -5760,9 +5760,10 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
     Hi = DAG.getNode(ISD::UNDEF, NVT);
     break;
   case ISD::Constant: {
-    uint64_t Cst = cast<ConstantSDNode>(Node)->getValue();
-    Lo = DAG.getConstant(Cst, NVT);
-    Hi = DAG.getConstant(Cst >> MVT::getSizeInBits(NVT), NVT);
+    unsigned NVTBits = MVT::getSizeInBits(NVT);
+    const APInt &Cst = cast<ConstantSDNode>(Node)->getAPIntValue();
+    Lo = DAG.getConstant(APInt(Cst).trunc(NVTBits), NVT);
+    Hi = DAG.getConstant(Cst.lshr(NVTBits).trunc(NVTBits), NVT);
     break;
   }
   case ISD::ConstantFP: {