aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-03-10 23:38:17 +0000
committerDan Gohman <gohman@apple.com>2008-03-10 23:38:17 +0000
commitf25275cb3c930b579707e33c22c1e1c5682b89d3 (patch)
treee6b58bda18001347060a482874833210fecbf49d /lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
parente1ff8ec36f1d99bbe110d3ef8888809c91ec9c00 (diff)
APInt-ify this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48194 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
index 61ab510323..9b22800688 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
@@ -106,9 +106,10 @@ void DAGTypeLegalizer::ExpandResult_UNDEF(SDNode *N,
void DAGTypeLegalizer::ExpandResult_Constant(SDNode *N,
SDOperand &Lo, SDOperand &Hi) {
MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
- uint64_t Cst = cast<ConstantSDNode>(N)->getValue();
- Lo = DAG.getConstant(Cst, NVT);
- Hi = DAG.getConstant(Cst >> MVT::getSizeInBits(NVT), NVT);
+ unsigned NBitWidth = MVT::getSizeInBits(NVT);
+ const APInt &Cst = cast<ConstantSDNode>(N)->getAPIntValue();
+ Lo = DAG.getConstant(APInt(Cst).trunc(NBitWidth), NVT);
+ Hi = DAG.getConstant(Cst.lshr(NBitWidth).trunc(NBitWidth), NVT);
}
void DAGTypeLegalizer::ExpandResult_BUILD_PAIR(SDNode *N,