APInt-ify this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2008-03-10 23:38:17 +00:00
parent e1ff8ec36f
commit f25275cb3c

View File

@ -106,9 +106,10 @@ void DAGTypeLegalizer::ExpandResult_UNDEF(SDNode *N,
void DAGTypeLegalizer::ExpandResult_Constant(SDNode *N, void DAGTypeLegalizer::ExpandResult_Constant(SDNode *N,
SDOperand &Lo, SDOperand &Hi) { SDOperand &Lo, SDOperand &Hi) {
MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0)); MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
uint64_t Cst = cast<ConstantSDNode>(N)->getValue(); unsigned NBitWidth = MVT::getSizeInBits(NVT);
Lo = DAG.getConstant(Cst, NVT); const APInt &Cst = cast<ConstantSDNode>(N)->getAPIntValue();
Hi = DAG.getConstant(Cst >> MVT::getSizeInBits(NVT), NVT); Lo = DAG.getConstant(APInt(Cst).trunc(NBitWidth), NVT);
Hi = DAG.getConstant(Cst.lshr(NBitWidth).trunc(NBitWidth), NVT);
} }
void DAGTypeLegalizer::ExpandResult_BUILD_PAIR(SDNode *N, void DAGTypeLegalizer::ExpandResult_BUILD_PAIR(SDNode *N,