convertFromInteger, as originally written, expected sign-extended
input.  APInt unfortunately zero-extends signed integers, so Dale
modified the function to expect zero-extended input.  Make this
assumption explicit in the function name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index a928968..09f45d2 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3234,8 +3234,8 @@
           const uint64_t zero[] = {0, 0};
           APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero));
           uint64_t x = 1ULL << ShiftAmt;
-          (void)apf.convertFromInteger(&x, MVT::getSizeInBits(NVT), false, 
-                                       APFloat::rmNearestTiesToEven);
+          (void)apf.convertFromZeroExtendedInteger
+            (&x, MVT::getSizeInBits(NVT), false, APFloat::rmNearestTiesToEven);
           Tmp2 = DAG.getConstantFP(apf, VT);
           Tmp3 = DAG.getSetCC(TLI.getSetCCResultTy(),
                             Node->getOperand(0), Tmp2, ISD::SETLT);
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 1e76435..6a9b149 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1595,7 +1595,7 @@
     case ISD::SINT_TO_FP: {
       const uint64_t zero[] = {0, 0};
       APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero));
-      (void)apf.convertFromInteger(&Val, 
+      (void)apf.convertFromZeroExtendedInteger(&Val, 
                                MVT::getSizeInBits(Operand.getValueType()), 
                                Opcode==ISD::SINT_TO_FP,
                                APFloat::rmNearestTiesToEven);