convertFromInteger, as originally written, expected sign-extended
[oota-llvm.git] / lib / ExecutionEngine / ExecutionEngine.cpp
index 61be35097b9a995e6974b7dfdba59c8c016aeb2b..96604f10bcccdefc675a39de000f4eff157f72e1 100644 (file)
@@ -396,7 +396,7 @@ 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(), 
+        (void)apf.convertFromZeroExtendedInteger(GV.IntVal.getRawData(), 
                                GV.IntVal.getBitWidth(), false,
                                APFloat::rmNearestTiesToEven);
         GV.IntVal = apf.convertToAPInt();
@@ -412,7 +412,7 @@ 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(), 
+        (void)apf.convertFromZeroExtendedInteger(GV.IntVal.getRawData(), 
                                GV.IntVal.getBitWidth(), true,
                                APFloat::rmNearestTiesToEven);
         GV.IntVal = apf.convertToAPInt();