Change APFloat::convertFromInteger to take the incoming
[oota-llvm.git] / lib / ExecutionEngine / ExecutionEngine.cpp
index afff142f9f5b6d27c072c243c426e4d508366fa8..c72663e0d4d436414bfbc9aff8dd12ed22a5865f 100644 (file)
@@ -393,10 +393,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
         GV.FloatVal = float(GV.IntVal.roundToDouble());
       else if (CE->getType() == Type::DoubleTy)
         GV.DoubleVal = GV.IntVal.roundToDouble();
-       else if (CE->getType() == Type::X86_FP80Ty) {
+      else if (CE->getType() == Type::X86_FP80Ty) {
         const uint64_t zero[] = {0, 0};
         APFloat apf = APFloat(APInt(80, 2, zero));
-        (void)apf.convertFromInteger(GV.IntVal.getRawData(), 2, false, 
+        (void)apf.convertFromInteger(GV.IntVal.getRawData(), 
+                               GV.IntVal.getBitWidth(), false,
                                APFloat::rmTowardZero);
         GV.IntVal = apf.convertToAPInt();
       }
@@ -411,7 +412,8 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
       else if (CE->getType() == Type::X86_FP80Ty) {
         const uint64_t zero[] = { 0, 0};
         APFloat apf = APFloat(APInt(80, 2, zero));
-        (void)apf.convertFromInteger(GV.IntVal.getRawData(), 2, true,
+        (void)apf.convertFromInteger(GV.IntVal.getRawData(), 
+                               GV.IntVal.getBitWidth(), true,
                                APFloat::rmTowardZero);
         GV.IntVal = apf.convertToAPInt();
       }