Change APFloat::convertFromInteger to take the incoming
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAG.cpp
index 92c0f2445bcb2c5bd55cec05f892573301671df8..042868d7bb1ff8390112bb2056b3fd4e8a365415 100644 (file)
@@ -1595,8 +1595,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
     case ISD::SINT_TO_FP: {
       const uint64_t zero[] = {0, 0};
       APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero));
-      (void)apf.convertFromInteger(&Val, 1, Opcode==ISD::SINT_TO_FP,
-                                  APFloat::rmTowardZero);
+      (void)apf.convertFromInteger(&Val, 
+                               MVT::getSizeInBits(Operand.getValueType()), 
+                               Opcode==ISD::SINT_TO_FP,
+                               APFloat::rmTowardZero);
       return getConstantFP(apf, VT);
     }
     case ISD::BIT_CONVERT: