diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-30 18:19:03 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-30 18:19:03 +0000 |
commit | 88216af3ea4bb1c68a8793ed1d3b30308b64ab0e (patch) | |
tree | db3b24ea0faceec5eb021615d89bf25953be1076 /lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | cce23a4c3585d9d7df538bbc71151624a18f40cd (diff) |
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/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index c72663e0d4..61be35097b 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; |