projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
189f80d
)
float->int conversion rounds toward 0. Duh.
author
Dale Johannesen
<dalej@apple.com>
Mon, 24 Sep 2007 21:06:09 +0000
(21:06 +0000)
committer
Dale Johannesen
<dalej@apple.com>
Mon, 24 Sep 2007 21:06:09 +0000
(21:06 +0000)
Fixes PR1698.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42273
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/ConstantFold.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/ConstantFold.cpp
b/lib/VMCore/ConstantFold.cpp
index 0c1d7f73ae1cec2b75f9470d9385f5f1d8002ae2..d8b8566193aedd95f6fe1d89844c8e443e1246fc 100644
(file)
--- 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::rm
NearestTiesToEven
);
+ APFloat::rm
TowardZero
);
if (status!=APFloat::opOK && status!=APFloat::opInexact)
return 0; // give up
APInt Val(DestBitWidth, 2, x);