aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-30 18:19:03 +0000
committerDale Johannesen <dalej@apple.com>2007-09-30 18:19:03 +0000
commit87fa68f68eb00accc7cd87ef0e8df0a53f3d6ee9 (patch)
treedb3b24ea0faceec5eb021615d89bf25953be1076 /lib/ExecutionEngine
parente96fcea579a91a8b06fce5bd9be3054830dc5be5 (diff)
downloadexternal_llvm-87fa68f68eb00accc7cd87ef0e8df0a53f3d6ee9.zip
external_llvm-87fa68f68eb00accc7cd87ef0e8df0a53f3d6ee9.tar.gz
external_llvm-87fa68f68eb00accc7cd87ef0e8df0a53f3d6ee9.tar.bz2
Constant fold int-to-long-double conversions;
use APFloat for int-to-float/double; use round-to-nearest for these (implementation-defined, seems to match gcc). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index c72663e..61be350 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -398,7 +398,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
APFloat apf = APFloat(APInt(80, 2, zero));
(void)apf.convertFromInteger(GV.IntVal.getRawData(),
GV.IntVal.getBitWidth(), false,
- APFloat::rmTowardZero);
+ APFloat::rmNearestTiesToEven);
GV.IntVal = apf.convertToAPInt();
}
return GV;
@@ -414,7 +414,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
APFloat apf = APFloat(APInt(80, 2, zero));
(void)apf.convertFromInteger(GV.IntVal.getRawData(),
GV.IntVal.getBitWidth(), true,
- APFloat::rmTowardZero);
+ APFloat::rmNearestTiesToEven);
GV.IntVal = apf.convertToAPInt();
}
return GV;