[llvm-commits] [llvm] r47745 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Dan Gohman
gohman at apple.com
Thu Feb 28 17:44:25 PST 2008
Author: djg
Date: Thu Feb 28 19:44:25 2008
New Revision: 47745
URL: http://llvm.org/viewvc/llvm-project?rev=47745&view=rev
Log:
Use the new convertFromAPInt instead of convertFromZeroExtendedInteger,
which allows more of the surrounding arithmetic to be done with APInt
instead of uint64_t.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=47745&r1=47744&r2=47745&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Feb 28 19:44:25 2008
@@ -3754,12 +3754,10 @@
SDOperand True, False;
MVT::ValueType VT = Node->getOperand(0).getValueType();
MVT::ValueType NVT = Node->getValueType(0);
- unsigned ShiftAmt = MVT::getSizeInBits(NVT)-1;
const uint64_t zero[] = {0, 0};
APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero));
- uint64_t x = 1ULL << ShiftAmt;
- (void)apf.convertFromZeroExtendedInteger
- (&x, MVT::getSizeInBits(NVT), false, APFloat::rmNearestTiesToEven);
+ APInt x = APInt::getSignBit(MVT::getSizeInBits(NVT));
+ (void)apf.convertFromAPInt(x, false, APFloat::rmNearestTiesToEven);
Tmp2 = DAG.getConstantFP(apf, VT);
Tmp3 = DAG.getSetCC(TLI.getSetCCResultTy(),
Node->getOperand(0), Tmp2, ISD::SETLT);
@@ -3768,7 +3766,7 @@
DAG.getNode(ISD::FSUB, VT, Node->getOperand(0),
Tmp2));
False = DAG.getNode(ISD::XOR, NVT, False,
- DAG.getConstant(1ULL << ShiftAmt, NVT));
+ DAG.getConstant(x, NVT));
Result = DAG.getNode(ISD::SELECT, NVT, Tmp3, True, False);
break;
} else {
More information about the llvm-commits
mailing list