Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | 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 | |||||
* | Allow '+' to appear in APInt strings, and add more unit tests. | Erick Tryzelaar | 2009-08-21 | 1 | -6/+11 | |
| | | | | llvm-svn: 79592 | |||||
* | Switch to SmallString::str from SmallString::c_str, and remove | Daniel Dunbar | 2009-08-19 | 1 | -3/+4 | |
| | | | | | | SmallString::c_str. llvm-svn: 79456 | |||||
* | Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef. | Daniel Dunbar | 2009-08-13 | 1 | -17/+22 | |
| | | | | | | - Patch by Erick Tryzelaar, with some edits (and a bug fix) from me. llvm-svn: 78885 | |||||
* | Add attempted idiotproofing comment per review. | Dale Johannesen | 2009-08-12 | 1 | -1/+2 | |
| | | | | llvm-svn: 78825 | |||||
* | Fix a nondeterministic bug in APInt::roundToDouble; | Dale Johannesen | 2009-08-12 | 1 | -2/+2 | |
| | | | | | | | | when !isSingleWord() but getActiveBits() is small, we were using the pointer value instead of the low word of the integer value. llvm-svn: 78821 | |||||
* | llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable. | Torok Edwin | 2009-07-14 | 1 | -4/+4 | |
| | | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640 | |||||
* | Switch to raw_ostream. | Daniel Dunbar | 2009-07-13 | 1 | -35/+35 | |
| | | | | llvm-svn: 75451 | |||||
* | assert(0) -> LLVM_UNREACHABLE. | Torok Edwin | 2009-07-11 | 1 | -4/+5 | |
| | | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379 | |||||
* | Reapply 74494, this time removing the conflicting definition of operator<< | Dan Gohman | 2009-06-30 | 1 | -0/+6 | |
| | | | | | | in APIntTest.cpp. llvm-svn: 74550 | |||||
* | Temporarily revert r74494. It was causing failures in the unit tests. | Bill Wendling | 2009-06-30 | 1 | -6/+0 | |
| | | | | llvm-svn: 74515 | |||||
* | Define an operator<< for APInt to be used with std::ostream. | Dan Gohman | 2009-06-30 | 1 | -0/+6 | |
| | | | | | | | This will allow it to be used in unittests that use gtest's EXPECT_EQ. llvm-svn: 74494 | |||||
* | 80 column violation. | Evan Cheng | 2009-05-21 | 1 | -1/+1 | |
| | | | | llvm-svn: 72235 | |||||
* | Fix whitespacing (space after switch). | Mike Stump | 2009-05-13 | 1 | -6/+5 | |
| | | | | llvm-svn: 71738 | |||||
* | Move helper functions for optimizing division by constant into the APInt | Jay Foad | 2009-04-30 | 1 | -0/+92 | |
| | | | | | | class. llvm-svn: 70488 | |||||
* | Fix PR4040: APInt's string constructor is too strict | Chris Lattner | 2009-04-25 | 1 | -7/+9 | |
| | | | | | | patch by Jeff Yasskin! llvm-svn: 70058 | |||||
* | Use CHAR_BIT instead of hard-coding 8 in several places where it | Dan Gohman | 2009-04-01 | 1 | -3/+3 | |
| | | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. llvm-svn: 68227 | |||||
* | Fix comment typo. | Duncan Sands | 2009-03-19 | 1 | -1/+1 | |
| | | | | llvm-svn: 67302 | |||||
* | Fix a hashing bug in APInt. A certain pathological testcase (too | Stuart Hastings | 2009-03-13 | 1 | -7/+85 | |
| | | | | | | | | | | | | large for the testsuite) took over six minutes to compile on my Mac. The patched LLVM-GCC compiles that testcase in three seconds (GCC takes less than one second). This hash function is more complex (about 35 instructions on x86) than what Chris wanted, but I expect it will be well-behaved with arbitrary inputs. Thank you to everyone who responded to my previous request for advice. llvm-svn: 66962 | |||||
* | APInt's countLeadingOnes() was broken for negative i128 values, | Torok Edwin | 2009-01-27 | 1 | -1/+7 | |
| | | | | | | | | | causing assertion failures in getSExtValue(). Fix it by making highWordBits actually contain what its name says, and add some more unit-tests for APInt. This fixes PR3419. llvm-svn: 63107 | |||||
* | Remove uses of uint32_t in favor of 'unsigned' for better | Chris Lattner | 2009-01-21 | 1 | -193/+193 | |
| | | | | | | compatibility with cygwin. Patch by Jay Foad! llvm-svn: 62695 | |||||
* | Fix typo, sentence fragment. | Nick Lewycky | 2009-01-19 | 1 | -2/+2 | |
| | | | | llvm-svn: 62512 | |||||
* | rearrange some code. | Chris Lattner | 2008-10-11 | 1 | -6/+6 | |
| | | | | llvm-svn: 57384 |