summaryrefslogtreecommitdiff
path: root/unittests/ADT/APFloatTest.cpp
Commit message (Collapse)AuthorAge
* Attempt to fix MSVC build.Eli Friedman2011-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141831 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix APFloat::getLargest so that it actually returns the correct value. ↵Eli Friedman2011-10-12
| | | | | | 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
* Fix a test that wasn't testing the right thing.Matt Beaumont-Gay2011-08-29
| | | | | | | | 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
* Add an APFloat::convertToInt(APSInt) function that automatically manages theJeffrey Yasskin2011-07-15
| | | | | | memory for the result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135259 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid turning a floating point division with a constant power of two into a ↵Benjamin Kramer2011-03-30
| | | | | | | | | 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
* Add APFloat::getExactInverse.Benjamin Kramer2011-03-30
| | | | | | | | | | | | | | 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
* Fix death tests in -Asserts builds.Jeffrey Yasskin2010-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98701 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-widthJohn McCall2010-02-28
| | | | | | | | | | 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
* Make APFloat's string-parsing routines a bit safer against very large exponents.John McCall2010-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97278 91177308-0d34-0410-b5e6-96231b3b80d8
* Make APInt::countLeadingZerosSlowCase() treat the contents of padding bitsJohn McCall2010-02-03
| | | | | | | | 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
* Implement support for converting to string at "natural precision", and fix someJohn McCall2009-12-24
| | | | | | | | major bugs in long-precision conversion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92150 91177308-0d34-0410-b5e6-96231b3b80d8
* Add accessors for the largest-magnitude, smallest-magnitude, andJohn McCall2009-12-24
| | | | | | | | | | 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
* Add test for PR4873, which works for me.Daniel Dunbar2009-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80965 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for including '+' in APFloat strings, more asserts,Erick Tryzelaar2009-08-20
| | | | | | and many new unit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79574 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix two APFloat bugs in converting hexadecimal constants.Daniel Dunbar2009-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79540 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap unit test death tests in GTEST_HAS_DEATH_TESTErick Tryzelaar2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79218 91177308-0d34-0410-b5e6-96231b3b80d8
* Change APFloatTest from using ASSERTs to EXPECTsErick Tryzelaar2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79216 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify APFloat to take a StringRef instead of a c string.Erick Tryzelaar2009-08-16
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