summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/APFloatTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix APFloat::convert so that it handles narrowing conversions correctly; itEli Friedman2011-11-261-0/+24
| | | | | | | | 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. llvm-svn: 145141
* Attempt to fix MSVC build.Eli Friedman2011-10-121-2/+2
| | | | llvm-svn: 141831
* Fix APFloat::getLargest so that it actually returns the correct value. ↵Eli Friedman2011-10-121-0/+5
| | | | | | Found by accident while reviewing a patch to nearby code. llvm-svn: 141816
* Fix a test that wasn't testing the right thing.Matt Beaumont-Gay2011-08-291-4/+6
| | | | | | | | The APFloat "Zero" test was actually calling the APFloat(const fltSemantics &, integerPart) constructor, and EXPECT_EQ was treating 0 and -0 as equal. llvm-svn: 138745
* Add an APFloat::convertToInt(APSInt) function that automatically manages theJeffrey Yasskin2011-07-151-0/+49
| | | | | | memory for the result. llvm-svn: 135259
* Avoid turning a floating point division with a constant power of two into a ↵Benjamin Kramer2011-03-301-4/+2
| | | | | | | | | denormal multiplication. Some platforms may treat denormals as zero, on other platforms multiplication with a subnormal is slower than dividing by a normal. llvm-svn: 128555
* Add APFloat::getExactInverse.Benjamin Kramer2011-03-301-0/+23
| | | | | | | | | | | | | | 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. llvm-svn: 128545
* Fix death tests in -Asserts builds.Jeffrey Yasskin2010-03-171-0/+2
| | | | llvm-svn: 98701
* Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-widthJohn McCall2010-02-281-0/+29
| | | | | | | | payloads. APFloat's internal folding routines always make QNaNs now, instead of sometimes making QNaNs and sometimes SNaNs depending on the type. llvm-svn: 97364
* Make APFloat's string-parsing routines a bit safer against very large exponents.John McCall2010-02-261-0/+7
| | | | llvm-svn: 97278
* Make APInt::countLeadingZerosSlowCase() treat the contents of padding bitsJohn McCall2010-02-031-0/+2
| | | | | | as undefined. Fixes an assertion in APFloat::toString noticed by Dale. llvm-svn: 95196
* Implement support for converting to string at "natural precision", and fix someJohn McCall2009-12-241-1/+3
| | | | | | major bugs in long-precision conversion. llvm-svn: 92150
* Add accessors for the largest-magnitude, smallest-magnitude, andJohn McCall2009-12-241-0/+20
| | | | | | | | 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. llvm-svn: 92126
* Add test for PR4873, which works for me.Daniel Dunbar2009-09-031-0/+8
| | | | llvm-svn: 80965
* Add support for including '+' in APFloat strings, more asserts,Erick Tryzelaar2009-08-201-51/+450
| | | | | | and many new unit tests. llvm-svn: 79574
* Fix two APFloat bugs in converting hexadecimal constants.Daniel Dunbar2009-08-201-0/+2
| | | | llvm-svn: 79540
* Wrap unit test death tests in GTEST_HAS_DEATH_TESTErick Tryzelaar2009-08-171-5/+7
| | | | llvm-svn: 79218
* Change APFloatTest from using ASSERTs to EXPECTsErick Tryzelaar2009-08-171-67/+67
| | | | llvm-svn: 79216
* Modify APFloat to take a StringRef instead of a c string.Erick Tryzelaar2009-08-161-0/+106
This also adds unit tests to APFloat that mainly tests the string handling of APFloat, but not much else of it's api. llvm-svn: 79210
OpenPOWER on IntegriCloud