diff options
author | Dale Johannesen <dalej@apple.com> | 2008-10-07 00:40:01 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-10-07 00:40:01 +0000 |
commit | 7221af384d9d05e213fd35c4e2485580e4415dc6 (patch) | |
tree | e18dabab1ea57c5d7d52509946367bf365811c6e /llvm/lib/Support/APFloat.cpp | |
parent | bef9b0bef08a325088ca798831ccb9f7b9107033 (diff) | |
download | bcm5719-llvm-7221af384d9d05e213fd35c4e2485580e4415dc6.tar.gz bcm5719-llvm-7221af384d9d05e213fd35c4e2485580e4415dc6.zip |
Mark negative-zero-to-int conversion as Inexact,
since -0.0 can't be represented as an int.
This prevents llvm from reducing -0.0 to a
load-and-convert of int 0. Fixes
ieee.exp/mzero[2356].c in gcc testsuite.
llvm-svn: 57224
Diffstat (limited to 'llvm/lib/Support/APFloat.cpp')
-rw-r--r-- | llvm/lib/Support/APFloat.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index b93f1d109a0..df309d49c66 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -1784,7 +1784,8 @@ APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width, if(category == fcZero) { APInt::tcSet(parts, 0, dstPartsCount); - return opOK; + // Negative zero can't be represented as an int. + return sign ? opInexact : opOK; } src = significandParts(); |