summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit9150652b21ac0b4fe9dc836c1fb14026a217da13 (patch)
tree7c9dc75817f5efc356ea7919c64d6b264b39c7bb /llvm/lib/ExecutionEngine
parent28a2c4a9c4ccfe872e450d7dd99255336e73ee30 (diff)
downloadbcm5719-llvm-9150652b21ac0b4fe9dc836c1fb14026a217da13.tar.gz
bcm5719-llvm-9150652b21ac0b4fe9dc836c1fb14026a217da13.zip
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). llvm-svn: 42484
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index c72663e0d4d..61be35097b9 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud