Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Clean up whitespace | Duncan P. N. Exon Smith | 2014-01-31 | 1 | -2/+2 |
| | | | | llvm-svn: 200579 | ||||
* | [APInt] Fix nearestLogBase2 to return correct answers for very large APInt ↵ | Michael Gottesman | 2014-01-19 | 1 | -0/+11 |
| | | | | | | | | and APInt with a bitwidth of 1. I also improved the comments, added some more tests, etc. llvm-svn: 199610 | ||||
* | [APInt] Fixed bug where APInt(UINT32_MAX, 0) would blow up when being ↵ | Michael Gottesman | 2014-01-19 | 1 | -0/+8 |
| | | | | | | | | | | | | | | constructed. This was due to arithmetic overflow in the getNumBits() computation. Now we cast BitWidth to a uint64_t so that does not occur during the computation. After the computation is complete, the uint64_t is truncated when the function returns. I know that this is not something that is likely to happen, but it *IS* a valid input and we should not blow up. llvm-svn: 199609 | ||||
* | Remove APInt::extractBit since it is already implemented via operator[]. ↵ | Michael Gottesman | 2013-12-13 | 1 | -3/+3 |
| | | | | | | Change tests for extractBit to test operator[]. llvm-svn: 197277 | ||||
* | [block-freq] Add the method APInt::nearestLogBase2(). | Michael Gottesman | 2013-12-13 | 1 | -4/+40 |
| | | | | llvm-svn: 197272 | ||||
* | [block-freq] Add the APInt method extractBit. | Michael Gottesman | 2013-12-13 | 1 | -0/+26 |
| | | | | llvm-svn: 197271 | ||||
* | [APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for ↵ | Michael Gottesman | 2013-05-28 | 1 | -0/+65 |
| | | | | | | | | use in APFloat IEEE-754R 2008 nextUp/nextDown function. rdar://13852078 llvm-svn: 182801 | ||||
* | Move the SplatByte helper to APInt and generalize it a bit. | Benjamin Kramer | 2013-02-20 | 1 | -0/+10 |
| | | | | llvm-svn: 175621 | ||||
* | ADT: Correct APInt::getActiveWords for zero values | Meador Inge | 2013-02-07 | 1 | -0/+8 |
| | | | | | | | | | | PR15138 was opened because of a segfault in the Bitcode writer. The actual issue ended up being a bug in APInt where calls to APInt::getActiveWords returns a bogus value when the APInt value is 0. This patch fixes the problem by ensuring that getActiveWords returns 1 for 0 valued APInts. llvm-svn: 174641 | ||||
* | Sort the #include lines for unittest/... | Chandler Carruth | 2012-12-04 | 1 | -2/+2 |
| | | | | llvm-svn: 169250 | ||||
* | fix the quotient returned by sdivrem() for the case when LHS is negative and ↵ | Nuno Lopes | 2012-05-22 | 1 | -0/+28 |
| | | | | | | | | RHS is positive based on a patch by Preston Briggs, with some modifications llvm-svn: 157231 | ||||
* | Add a unittest for rotating a really big APInt. | Benjamin Kramer | 2012-02-07 | 1 | -0/+4 |
| | | | | | | Clang miscompiles it under certain circumstances, and it's a good exercise for APInt. llvm-svn: 149986 | ||||
* | Some unittests for APInt rotates; patch by Cameron McInally. | Eli Friedman | 2011-12-22 | 1 | -0/+32 |
| | | | | llvm-svn: 147186 | ||||
* | APInt: update asserts for base-36 | Dylan Noblesmith | 2011-12-16 | 1 | -3/+3 |
| | | | | | | | | Hexatridecimal was added in r139695. And fix the unittest that now triggers the assert. llvm-svn: 146754 | ||||
* | Fix APInt::operator*= so that it computes the correct result for large ↵ | Eli Friedman | 2011-10-07 | 1 | -0/+9 |
| | | | | | | integers where there is unsigned overflow. Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases). Fixes PR11086. llvm-svn: 141441 | ||||
* | Add APInt support for converting to/from hexatridecimal strings | Douglas Gregor | 2011-09-14 | 1 | -1/+24 |
| | | | | llvm-svn: 139695 | ||||
* | Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ↵ | Jeffrey Yasskin | 2011-07-18 | 1 | -0/+4 |
| | | | | | | | | | ambiguity errors like the one corrected by r135261. Migrate all LLVM callers of the old constructor to the new one. llvm-svn: 135431 | ||||
* | unittests: add test for APInt::toString() | Dylan Noblesmith | 2011-06-15 | 1 | -0/+46 |
| | | | | | | Follow up to r133032. llvm-svn: 133107 | ||||
* | Add an argument to APInt's magic udiv calculation to specify the number of ↵ | Benjamin Kramer | 2011-03-17 | 1 | -0/+2 |
| | | | | | | | | bits that are known zero in the divided number. This will come in handy soon. llvm-svn: 127828 | ||||
* | The signed version of our "magic number" computation for the integer ↵ | Cameron Zwarich | 2011-02-21 | 1 | -0/+18 |
| | | | | | | | | | | | | | approximation of a constant had a minor typo introduced when copying it from the book, which caused it to favor negative approximations over positive approximations in many cases. Positive approximations require fewer operations beyond the multiplication. In the case of division by 3, we still generate code that is a single instruction larger than GCC's code. llvm-svn: 126097 | ||||
* | PR5207: Rename overloaded APInt methods set(), clear(), flip() to | Jay Foad | 2010-12-01 | 1 | -1/+1 |
| | | | | | | setAllBits(), setBit(unsigned), etc. llvm-svn: 120564 | ||||
* | Attempt to unbreak the FreeBSD buildbot by XFAILing a unit test that seems to be | Jakob Stoklund Olesen | 2010-09-14 | 1 | -0/+5 |
| | | | | | | | | miscompiled by the system gcc-4.2.1 The test remains enabled for the second-stage test. llvm-svn: 113824 | ||||
* | Switch from EXPECT_EQ({true,false, ...) to the more canonical | Chandler Carruth | 2010-07-13 | 1 | -2/+2 |
| | | | | | | | EXPECT_{TRUE,FALSE}(...) macros. This also prevents suprious warnings about bool-to-pointer conversion that occurs withit EXPECT_EQ. llvm-svn: 108248 | ||||
* | Fix death tests in -Asserts builds. | Jeffrey Yasskin | 2010-03-17 | 1 | -0/+2 |
| | | | | llvm-svn: 98701 | ||||
* | Pacify the compiler (signed with unsigned comparison) by making | Duncan Sands | 2009-10-13 | 1 | -6/+6 |
| | | | | | | these constants unsigned. llvm-svn: 83962 | ||||
* | Add a ceilLogBase2 function to APInt. | Dan Gohman | 2009-10-13 | 1 | -0/+11 |
| | | | | llvm-svn: 83932 | ||||
* | Fix a few more conversion warnings on 4.0 | Daniel Dunbar | 2009-09-18 | 1 | -5/+5 |
| | | | | llvm-svn: 82232 | ||||
* | Another try at fixing compile warnings on 4.0 | Daniel Dunbar | 2009-09-17 | 1 | -18/+18 |
| | | | | llvm-svn: 82148 | ||||
* | Attempt to fix some 4.0.0 build warnings. | Daniel Dunbar | 2009-09-14 | 1 | -23/+23 |
| | | | | llvm-svn: 81752 | ||||
* | Simplify, now that gtest supports raw_ostream directly. | Daniel Dunbar | 2009-09-06 | 1 | -8/+0 |
| | | | | llvm-svn: 81102 | ||||
* | split raw_os_ostream out to its own header and implementation file. This | Chris Lattner | 2009-08-24 | 1 | -1/+1 |
| | | | | | | | means that raw_ostream no longer has to #include <iosfwd>. Nothing in llvm should use raw_os_ostream.h, but llvm-gcc and some unit tests do. llvm-svn: 79886 | ||||
* | Unbreak unit tests. | Daniel Dunbar | 2009-08-24 | 1 | -0/+7 |
| | | | | llvm-svn: 79879 | ||||
* | Correct for recent assert change. | Bill Wendling | 2009-08-21 | 1 | -1/+1 |
| | | | | llvm-svn: 79601 | ||||
* | Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9. | Erick Tryzelaar | 2009-08-21 | 1 | -0/+82 |
| | | | | llvm-svn: 79593 | ||||
* | Allow '+' to appear in APInt strings, and add more unit tests. | Erick Tryzelaar | 2009-08-21 | 1 | -8/+72 |
| | | | | llvm-svn: 79592 | ||||
* | Wrap unit test death tests in GTEST_HAS_DEATH_TEST | Erick Tryzelaar | 2009-08-17 | 1 | -0/+2 |
| | | | | llvm-svn: 79218 | ||||
* | Add failure tests to APInt unit test. | Erick Tryzelaar | 2009-08-16 | 1 | -0/+11 |
| | | | | llvm-svn: 79209 | ||||
* | Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef. | Daniel Dunbar | 2009-08-13 | 1 | -6/+6 |
| | | | | | | - Patch by Erick Tryzelaar, with some edits (and a bug fix) from me. llvm-svn: 78885 | ||||
* | Reapply 74494, this time removing the conflicting definition of operator<< | Dan Gohman | 2009-06-30 | 1 | -13/+0 |
| | | | | | | in APIntTest.cpp. llvm-svn: 74550 | ||||
* | Fix PR4040: APInt's string constructor is too strict | Chris Lattner | 2009-04-25 | 1 | -0/+9 |
| | | | | | | patch by Jeff Yasskin! llvm-svn: 70058 | ||||
* | * Fixed calls to APInt ctor to work for negative values on Darwin/x86 | Misha Brukman | 2009-04-08 | 1 | -6/+6 |
| | | | | | | * Converted C-style casts to C++-style casts llvm-svn: 68613 | ||||
* | Converted a1.ll to unittests. | Misha Brukman | 2009-03-24 | 1 | -4/+83 |
| | | | | llvm-svn: 67652 | ||||
* | Renamed unittest files to have a consistent {Tt}est suffix. | Misha Brukman | 2009-03-19 | 1 | -0/+100 |
llvm-svn: 67326 |