diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-24 21:06:09 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-24 21:06:09 +0000 |
commit | 6b92942c9c5c2cc94bffe0850b41afce3b3e991f (patch) | |
tree | bb052c32953b529ebd052d245474090e33bf8078 /lib/VMCore/ConstantFold.cpp | |
parent | 189f80dc253664627253b2d2cb07d0714feb12ba (diff) | |
download | external_llvm-6b92942c9c5c2cc94bffe0850b41afce3b3e991f.zip external_llvm-6b92942c9c5c2cc94bffe0850b41afce3b3e991f.tar.gz external_llvm-6b92942c9c5c2cc94bffe0850b41afce3b3e991f.tar.bz2 |
float->int conversion rounds toward 0. Duh.
Fixes PR1698.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 0c1d7f7..d8b8566 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -196,7 +196,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V, uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth(); APFloat::opStatus status = V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI, - APFloat::rmNearestTiesToEven); + APFloat::rmTowardZero); if (status!=APFloat::opOK && status!=APFloat::opInexact) return 0; // give up APInt Val(DestBitWidth, 2, x); |