Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix a crash in APInt::lshr when shiftAmt > BitWidth. | Chad Rosier | 2012-06-08 | 1 | -1/+1 |
| | | | | | | Patch by James Benton <jbenton@vmware.com>. llvm-svn: 158213 | ||||
* | Move APInt::operator[] inline. | Benjamin Kramer | 2012-03-14 | 1 | -6/+0 |
| | | | | llvm-svn: 152692 | ||||
* | Move APInt::operator! inline, it's small and fuses well with surrounding ↵ | Benjamin Kramer | 2012-03-14 | 1 | -10/+0 |
| | | | | | | code when inlined. llvm-svn: 152688 | ||||
* | Inline a trivial helper function. | Benjamin Kramer | 2012-03-12 | 1 | -7/+3 |
| | | | | llvm-svn: 152577 | ||||
* | Replace a hand-coded leading one counting loop with the magic from MathExtras.h. | Benjamin Kramer | 2012-03-11 | 1 | -8/+1 |
| | | | | llvm-svn: 152545 | ||||
* | Replace the hashing functions on APInt and APFloat with overloads of the | Chandler Carruth | 2012-03-04 | 1 | -87/+6 |
| | | | | | | | | | | | | | | new hash_value infrastructure, and replace their implementations using hash_combine. This removes a complete copy of Jenkin's lookup3 hash function (which is both significantly slower and lower quality than the one implemented in hash_combine) along with a somewhat scary xor-only hash function. Now that APInt and APFloat can be passed directly to hash_combine, simplify the rest of the LLVMContextImpl hashing to use the new infrastructure. llvm-svn: 152004 | ||||
* | Fix undefined behavior. | Ahmed Charles | 2012-02-24 | 1 | -1/+1 |
| | | | | llvm-svn: 151385 | ||||
* | Add r149110 back with a fix for when the vector and the int have the same | Rafael Espindola | 2012-01-27 | 1 | -0/+12 |
| | | | | | | width. llvm-svn: 149151 | ||||
* | Fix APInt::rotl and APInt::rotr so that they work correctly. Found while ↵ | Eli Friedman | 2011-12-22 | 1 | -12/+4 |
| | | | | | | writing some code that tried to use them. llvm-svn: 147134 | ||||
* | APInt: update asserts for base-36 | Dylan Noblesmith | 2011-12-16 | 1 | -1/+5 |
| | | | | | | | | Hexatridecimal was added in r139695. And fix the unittest that now triggers the assert. llvm-svn: 146754 | ||||
* | Fix unreachable return & simplify some branches. | David Blaikie | 2011-12-01 | 1 | -9/+5 |
| | | | | llvm-svn: 145627 | ||||
* | Correctly byte-swap APInts with bit-widths greater than 64. | Richard Smith | 2011-11-23 | 1 | -17/+26 |
| | | | | llvm-svn: 145111 | ||||
* | Fix APInt::operator*= so that it computes the correct result for large ↵ | Eli Friedman | 2011-10-07 | 1 | -1/+2 |
| | | | | | | 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 | ||||
* | U is good enough | Douglas Gregor | 2011-09-20 | 1 | -2/+2 |
| | | | | llvm-svn: 140166 | ||||
* | Eliminate sign-comparison warnings in APInt | Douglas Gregor | 2011-09-20 | 1 | -2/+4 |
| | | | | llvm-svn: 140158 | ||||
* | Silence -Wsign-compare warnings from GCC. | Benjamin Kramer | 2011-09-19 | 1 | -2/+2 |
| | | | | llvm-svn: 140043 | ||||
* | Add APInt support for converting to/from hexatridecimal strings | Douglas Gregor | 2011-09-14 | 1 | -12/+19 |
| | | | | llvm-svn: 139695 | ||||
* | Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ↵ | Jeffrey Yasskin | 2011-07-18 | 1 | -6/+14 |
| | | | | | | | | | ambiguity errors like the one corrected by r135261. Migrate all LLVM callers of the old constructor to the new one. llvm-svn: 135431 | ||||
* | add option for literal formatting to APInt::toString() | Ted Kremenek | 2011-06-15 | 1 | -3/+34 |
| | | | | | | | | | | | | | | | toString() now takes an optional bool argument that, depending on the radix, adds the appropriate prefix to the integer's string representation that makes it into a meaningful C literal, e.g.: hexademical: '-f' becomes '-0xf' octal: '77' becomes '077' binary: '110' becomes '0b110' Patch by nobled@dreamwidth.org! llvm-svn: 133032 | ||||
* | fix a bug for hosts without round, PR8893. | Chris Lattner | 2011-05-22 | 1 | -1/+1 |
| | | | | llvm-svn: 131842 | ||||
* | Fix a ton of comment typos found by codespell. Patch by | Chris Lattner | 2011-04-15 | 1 | -1/+1 |
| | | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558 | ||||
* | Constant folding support for calls to umul.with.overflow(), basically ↵ | Frits van Bommel | 2011-03-27 | 1 | -0/+10 |
| | | | | | | identical to the smul.with.overflow() code. llvm-svn: 128379 | ||||
* | Add an argument to APInt's magic udiv calculation to specify the number of ↵ | Benjamin Kramer | 2011-03-17 | 1 | -2/+4 |
| | | | | | | | | 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 | -1/+1 |
| | | | | | | | | | | | | | 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: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and | Jay Foad | 2010-12-07 | 1 | -74/+68 |
| | | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121120 | ||||
* | APInt: microoptimize a few methods. | Benjamin Kramer | 2010-12-04 | 1 | -4/+0 |
| | | | | llvm-svn: 120912 | ||||
* | PR5207: Rename overloaded APInt methods set(), clear(), flip() to | Jay Foad | 2010-12-01 | 1 | -13/+13 |
| | | | | | | setAllBits(), setBit(unsigned), etc. llvm-svn: 120564 | ||||
* | PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void. | Jay Foad | 2010-11-30 | 1 | -6/+3 |
| | | | | llvm-svn: 120413 | ||||
* | Bounds-check APInt's operator[]. | Dan Gohman | 2010-11-18 | 1 | -0/+1 |
| | | | | llvm-svn: 119708 | ||||
* | fix a bug I introduced, no idea how this didn't repro right. | Chris Lattner | 2010-10-14 | 1 | -2/+2 |
| | | | | llvm-svn: 116462 | ||||
* | add uadd_ov/usub_ov to apint, consolidate constant folding | Chris Lattner | 2010-10-14 | 1 | -0/+12 |
| | | | | | | | | | logic to use the new APInt methods. Among other things this implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold which comes from "clang -ftrapv", originally brought to my attention from PR8221. llvm-svn: 116457 | ||||
* | constify these methods. | Chris Lattner | 2010-10-13 | 1 | -5/+5 |
| | | | | llvm-svn: 116455 | ||||
* | add a few operations for signed operations that also | Chris Lattner | 2010-10-13 | 1 | -0/+46 |
| | | | | | | return an overflow flag. llvm-svn: 116452 | ||||
* | stomp some more undefined behavior, PR7775. | Chris Lattner | 2010-08-18 | 1 | -6/+7 |
| | | | | llvm-svn: 111337 | ||||
* | Don't pass StringRef by reference. | Benjamin Kramer | 2010-07-14 | 1 | -3/+3 |
| | | | | llvm-svn: 108366 | ||||
* | improve portability to systems that don't have round, patch by | Chris Lattner | 2010-05-15 | 1 | -4/+3 |
| | | | | | | Evzen Muller! llvm-svn: 103877 | ||||
* | improve portability to minix, patch by | Chris Lattner | 2010-03-26 | 1 | -2/+2 |
| | | | | | | Kees van Reeuwijk for PR6704 llvm-svn: 99677 | ||||
* | Fix minor style issues. | Dan Gohman | 2010-03-24 | 1 | -38/+37 |
| | | | | llvm-svn: 99414 | ||||
* | Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-width | John McCall | 2010-02-28 | 1 | -1/+9 |
| | | | | | | | | 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 | ||||
* | Fix "the the" and similar typos. | Dan Gohman | 2010-02-10 | 1 | -2/+2 |
| | | | | llvm-svn: 95781 | ||||
* | Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits | John McCall | 2010-02-03 | 1 | -6/+18 |
| | | | | | | as undefined. Fixes an assertion in APFloat::toString noticed by Dale. llvm-svn: 95196 | ||||
* | Change errs() to dbgs(). | David Greene | 2010-01-05 | 1 | -34/+34 |
| | | | | llvm-svn: 92643 | ||||
* | Set Remainder before Quotient in case Quotient and LHS alias. The new | John McCall | 2009-12-24 | 1 | -1/+1 |
| | | | | | | order should be immune to such problems. llvm-svn: 92124 | ||||
* | Tabs -> spaces, and remove trailing whitespace. | Daniel Dunbar | 2009-09-20 | 1 | -1/+1 |
| | | | | llvm-svn: 82355 | ||||
* | Remove some unused variables and methods warned about by | Duncan Sands | 2009-09-06 | 1 | -2/+0 |
| | | | | | | icc (#177, partial). Patch by Erick Tryzelaar. llvm-svn: 81106 | ||||
* | remove the dead std::ostream APInt inserter | Chris Lattner | 2009-08-23 | 1 | -8/+2 |
| | | | | llvm-svn: 79875 | ||||
* | Clean up the APInt function getDigit. | Erick Tryzelaar | 2009-08-21 | 1 | -21/+19 |
| | | | | llvm-svn: 79602 | ||||
* | Update error messages for '+'. Fix grammar and make the two | Eric Christopher | 2009-08-21 | 1 | -4/+5 |
| | | | | | | negative checks resemble each other. llvm-svn: 79595 | ||||
* | Fix trailing whitespace and 80-col violation. | Eric Christopher | 2009-08-21 | 1 | -120/+121 |
| | | | | llvm-svn: 79594 | ||||
* | Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9. | Erick Tryzelaar | 2009-08-21 | 1 | -30/+42 |
| | | | | llvm-svn: 79593 |