From 9150652b21ac0b4fe9dc836c1fb14026a217da13 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Sun, 30 Sep 2007 18:19:03 +0000 Subject: 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 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp') 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; -- cgit v1.2.3