History log of /external/llvm/unittests/ADT/APFloatTest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ca4d2e60ea36bd4f532ab5d52f5b4394a33be819 27-Jul-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Make all arithmetic operations with NaN produce positive NaNs.

IEEE-754R 1.4 Exclusions states that IEEE-754R does not specify the
interpretation of the sign of NaNs. In order to remove an irrelevant
variable that most floating point implementations do not use,
standardize add, sub, mul, div, mod so that operating anything with
NaN always yields a positive NaN.

In a later commit I am going to update the APIs for creating NaNs so
that one can not even create a negative NaN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
763c066dca324ac4b86e7f014fe580ae5ba29fa0 18-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Handle '.' correctly in hex float literal parsing.

There were a couple of different loops that were not handling
'.' correctly in APFloat::convertFromHexadecimalString; these mistakes
could lead to assertion failures and incorrect rounding for overlong
hex float literals.

Fixes PR16643.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
b57770387ab262a0a23e77f094f599b6c955ba14 02-Jul-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Ensure that we can properly parse strings that do not have null terminators.

rdar://14323230

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
fb76ffd10b1e68ed157a4b0d2156a5e67a748b83 27-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Added unittest for APFloat.divide that checks special cases, result categories, and result statuses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
bb7759376560710002473e72d71f46f42a263016 27-Jun-2013 Michael Gottesman <mgottesman@apple.com> Removed two logging printf statements from the APFloat tests... = /.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
2eda897c3c41d4307ff51e19b7f759a51112c4d5 27-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Added unittest for APFloat.multiply that checks special cases, result categories, and result status.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
d7d88d969e7a97c6f543413d02c3c72921f9120e 27-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Added unittest for APFloat.subtract that checks special cases, result categories, and result status.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
a8f936446134c9cdcf06f74b861112a62fe66d71 26-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Removed debugging cruft that snuck in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
567a1126fb1fecba50872ef24e76ee163c9a6b08 24-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Removed trailing whitespace from unittests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
683069ffba26f9db487807b1f6278e839a0d4d24 24-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Added a large unittest for APFloat.add that checks that special values are computed correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
a1694e578492c90c246e59ec861c1a34f8ad7b4d 20-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Rename isIEEENormal => isNormal and remove old isNormal method.

The old isNormal is already functionally replaced by the method isFiniteNonZero
in r184350 and all references to said method were replaced in LLVM/clang in
r184356/134366.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
3781fbc29a8d808dcb8f2f11da0bbce635629308 20-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Fix typo in test so we actually test if we handle denormals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
4f71c1b2b9b1195d6f5107c433e06dedc0a61d14 19-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Changed APFloat::isNormal => APFloat::isFiniteNonZero for all tests in unittests.

I forgot to to do this in r184356. The only references were in APFloatTest.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
7032c883cdf8da579fbf9bf499d36a711eef676f 19-Jun-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Added isFiniteNonZero predicate.

This is the first patch in a series of patches to rename isNormal =>
isFiniteNonZero and isIEEENormal => isNormal. In order to prevent careless
errors on my part the overall plan is:

1. Add the isFiniteNonZero predicate with tests. I can do this in a method
independent of isNormal. (This step is this patch).
2. Convert all references to isNormal with isFiniteNonZero. My plan is to
comment out isNormal locally and continually convert isNormal references =>
isFiniteNonZero until llvm/clang compiles.
3. Remove old isNormal and rename isIEEENormal to isNormal.
4. Look through all of said references from patch 2 and see if we can simplify
them by using the new isNormal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
b30718af1ada4b68c7c44e3dcbf4891efd5e3ba1 04-Jun-2013 Michael Gottesman <mgottesman@apple.com> IEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).

Specifically the following work was done:

1. If the operation was not implemented, I implemented it.

2. If the operation was already implemented, I just moved its location
in the APFloat header into the IEEE-754R 5.7.2 section. If the name was
incorrect, I put in a comment giving the true IEEE-754R name.

Also unittests have been added for all of the functions which did not
already have a unittest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
44dbb749f0917d69e9dfaf6e39224349b680dfc2 02-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Try to avoid "integer literal too big" warnings from older GCCs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
504e2da08c2d8e98ca85271ba4637ea140baee37 31-May-2013 Michael Gottesman <mgottesman@apple.com> [APFloat] Added a unittest for APFloat::getZero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
964722ca40f48c65605e459e3a732bb8783b92f6 30-May-2013 Michael Gottesman <mgottesman@apple.com> Implement IEEE-754R 2008 nextUp/nextDown functions in the guise of the function APFloat::next(bool nextDown).

rdar://13852078

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
999c693694f43b80b38b4827893d54e58cc3e0c6 30-May-2013 Michael Gottesman <mgottesman@apple.com> Added a unittest for APFloat::getSmallestNormalized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
7d13d525bc9894a3be8e698002a01ce8ba5fc45d 30-May-2013 Michael Gottesman <mgottesman@apple.com> Added code to the unittest for APFloat::getSmallest to double check that we consider the result to be denormal.

I additionally changed certain checks to use EXPECT_FALSE instead of a boolean
complement with EXPECT_TRUE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
3e8d356b8103e1e3ddeb9b44d19f3a51af873261 30-May-2013 Michael Gottesman <mgottesman@apple.com> Add a unittest for APFloat::getSmallest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
4b6b53b0cec4fcf4d570daed3be41d6147d05224 13-May-2013 Shuxin Yang <shuxin.llvm@gmail.com> Fix a bug that APFloat::fusedMultiplyAdd() mistakenly evaluate "14.5f * -14.5f + 225.0f" to 225.0f.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
bd7561ea29649625775ef814dded2856d91c4dcf 25-Jan-2013 Benjamin Kramer <benny.kra@googlemail.com> APFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller type.

Fixes PR15054.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
7aa1c321f00d29fdc84e9a03080853aa25dd06fc 07-Jan-2013 Shuxin Yang <shuxin.llvm@gmail.com> Implement APFloat::isDenormal()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
5a88dda4be791426ab4d20a6a6c9c65d66614a27 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort the #include lines for unittest/...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
6b370e615ca5b3ef17ed4fe4fa891fab1e2bdd9a 08-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> Drop the limitation to IEEE floating point types from the fdiv of pow2 -> fmul transform.

This is safe for x87 long doubles and ppc double doubles too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
69c9c8c4cf57d49a0c64507082617f433372831d 29-Oct-2012 Ulrich Weigand <ulrich.weigand@de.ibm.com> Implement arithmetic on APFloat with PPCDoubleDouble semantics by
treating it as if it were an IEEE floating-point type with 106-bit
mantissa.

This makes compile-time arithmetic on "long double" for PowerPC
in clang (in particular parsing of floating point constants)
work, and fixes all "long double" related failures in the test
suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
3e7735fe1c9e8f1cbad1bac02fbb998017fd0cbb 26-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> APFloat::roundToIntegral: Special values don't keep the exponent value up to date, don't rely on it.

Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
c82cc587a468d44e5cfabfa8f8a639667127845d 15-Aug-2012 Owen Anderson <resistor@mac.com> Fix another roundToIntegral bug where very large values could become infinity. Problem and solution identified by Steve Canon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
f7a5dfcb3b68b782543d25ba3151893111ff008f 15-Aug-2012 Owen Anderson <resistor@mac.com> Fix a problem with APFloat::roundToIntegral where it would return incorrect results for negative inputs to trunc. Add unit tests to verify this behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
4455142a95bb3d0f6e6cbb336d6558919cb59bb8 26-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix APFloat::convert so that it handles narrowing conversions correctly; it
was returning incorrect values in rare cases, and incorrectly marking
exact conversions as inexact in some more common cases. Fixes PR11406, and a
missed optimization in test/CodeGen/X86/fp-stack-O0.ll.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
a3a1635d04667a7674d754ce13bc44d43d4b26e9 13-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Attempt to fix MSVC build.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
7247a5f20e1997e38cdfe3558afe8f10d547f2eb 12-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Fix APFloat::getLargest so that it actually returns the correct value. Found by accident while reviewing a patch to nearby code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
9d74909378eb084ab55f407d134fb68f25c803a0 29-Aug-2011 Matt Beaumont-Gay <matthewbg@google.com> Fix a test that wasn't testing the right thing.

The APFloat "Zero" test was actually calling the
APFloat(const fltSemantics &, integerPart) constructor, and EXPECT_EQ was
treating 0 and -0 as equal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
3d42bfbbdd26ac56ccd706d4ebee984490c72ecc 15-Jul-2011 Jeffrey Yasskin <jyasskin@google.com> Add an APFloat::convertToInt(APSInt) function that automatically manages the
memory for the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
8398512f89623144c8bb45ce9deb4f74f76480fc 30-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Avoid turning a floating point division with a constant power of two into a denormal multiplication.

Some platforms may treat denormals as zero, on other platforms multiplication
with a subnormal is slower than dividing by a normal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
2746000f4fa54e6ad00cf96910ea5772803624ed 30-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Add APFloat::getExactInverse.

The idea is, that if an ieee 754 float is divided by a power of two, we can
turn the division into a cheaper multiplication. This function sees if we can
get an exact multiplicative inverse for a divisor and returns it if possible.

This is the hard part of PR9587.

I tested many inputs against llvm-gcc's frotend implementation of this
optimization and didn't find any difference. However, floating point is the
land of weird edge cases, so any review would be appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
b5f59f5cf07babed5b4ba872815238e29386b0c5 17-Mar-2010 Jeffrey Yasskin <jyasskin@google.com> Fix death tests in -Asserts builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
e12b73816b50bbe2cc54b8005d86c95413b4f465 28-Feb-2010 John McCall <rjmccall@apple.com> Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-width
payloads. APFloat's internal folding routines always make QNaNs now,
instead of sometimes making QNaNs and sometimes SNaNs depending on the
type.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
8b3f3307a26c5911eef034db565aec22ed74f13b 26-Feb-2010 John McCall <rjmccall@apple.com> Make APFloat's string-parsing routines a bit safer against very large exponents.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
281d051921be84e2f790dd567958cd200b28e2dd 03-Feb-2010 John McCall <rjmccall@apple.com> Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits
as undefined. Fixes an assertion in APFloat::toString noticed by Dale.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
6a09affdf62fccbd190ca6e9cac0cb065b5f2677 25-Dec-2009 John McCall <rjmccall@apple.com> Implement support for converting to string at "natural precision", and fix some
major bugs in long-precision conversion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
00e65de9d83f846af732e3ace3f48d43d67b13d1 24-Dec-2009 John McCall <rjmccall@apple.com> Add accessors for the largest-magnitude, smallest-magnitude, and
smallest-normalized-magnitude values in a given FP semantics.
Provide an APFloat-to-string conversion which I am quite ready to admit could
be much more efficient.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
83fecfa42ce0453a723d37fa46e23c391e4bd6a3 04-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add test for PR4873, which works for me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
c78b33bdc1953914b0bbbaa1a0475cc231b43991 21-Aug-2009 Erick Tryzelaar <idadesub@users.sourceforge.net> Add support for including '+' in APFloat strings, more asserts,
and many new unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
cdd93d8c35e1e983fd3a37f3de2ebc154731f20d 20-Aug-2009 Daniel Dunbar <daniel@zuster.org> Fix two APFloat bugs in converting hexadecimal constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
2ad40a3663cb06c5f6d89a22933e22dc8b985574 17-Aug-2009 Erick Tryzelaar <idadesub@users.sourceforge.net> Wrap unit test death tests in GTEST_HAS_DEATH_TEST

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
33d7dd6dc86704c749c0b95ac512962f54e9af5a 17-Aug-2009 Erick Tryzelaar <idadesub@users.sourceforge.net> Change APFloatTest from using ASSERTs to EXPECTs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp
a15d890c34b5e3a6373c410ebc58453f2d52f43b 17-Aug-2009 Erick Tryzelaar <idadesub@users.sourceforge.net> Modify APFloat to take a StringRef instead of a c string.

This also adds unit tests to APFloat that mainly tests the
string handling of APFloat, but not much else of it's api.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/ADT/APFloatTest.cpp