summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-02-29 01:44:25 +0000
committerDan Gohman <gohman@apple.com>2008-02-29 01:44:25 +0000
commit837a6dccd7796b0b039e2990eb5eca66e6bf891b (patch)
tree4404b67b42d8773584b1f1f41ef81c5da4d8f30d /llvm/lib
parent06c45d516d5079e3fc989efda70ff3ead70a54c7 (diff)
downloadbcm5719-llvm-837a6dccd7796b0b039e2990eb5eca66e6bf891b.tar.gz
bcm5719-llvm-837a6dccd7796b0b039e2990eb5eca66e6bf891b.zip
Use the new convertFromAPInt instead of convertFromZeroExtendedInteger,
which allows more of the surrounding arithmetic to be done with APInt instead of uint64_t. llvm-svn: 47745
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 37dab7d7c16..2acb1e36684 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3754,12 +3754,10 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
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 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
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 {
OpenPOWER on IntegriCloud