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 | e4a424590675cf32b729420665626774b01b114d (patch) | |
tree | 5627bd144f1706ff2b9890435a148a21dacdf8ee /lib/Support/APFloat.cpp | |
parent | b5cc34d098149a9606dacb6d421471d787253907 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APFloat.cpp')
-rw-r--r-- | lib/Support/APFloat.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index b93f1d109a..df309d49c6 100644 --- a/lib/Support/APFloat.cpp +++ b/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(); |