summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't pass StringRef by reference.Benjamin Kramer2010-07-141-3/+3
| | | | llvm-svn: 108366
* improve portability to systems that don't have round, patch byChris Lattner2010-05-151-4/+3
| | | | | | Evzen Muller! llvm-svn: 103877
* improve portability to minix, patch by Chris Lattner2010-03-261-2/+2
| | | | | | Kees van Reeuwijk for PR6704 llvm-svn: 99677
* Fix minor style issues.Dan Gohman2010-03-241-38/+37
| | | | llvm-svn: 99414
* Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-widthJohn McCall2010-02-281-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 Gohman2010-02-101-2/+2
| | | | llvm-svn: 95781
* Make APInt::countLeadingZerosSlowCase() treat the contents of padding bitsJohn McCall2010-02-031-6/+18
| | | | | | as undefined. Fixes an assertion in APFloat::toString noticed by Dale. llvm-svn: 95196
* Change errs() to dbgs().David Greene2010-01-051-34/+34
| | | | llvm-svn: 92643
* Set Remainder before Quotient in case Quotient and LHS alias. The newJohn McCall2009-12-241-1/+1
| | | | | | order should be immune to such problems. llvm-svn: 92124
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-201-1/+1
| | | | llvm-svn: 82355
* Remove some unused variables and methods warned about byDuncan Sands2009-09-061-2/+0
| | | | | | icc (#177, partial). Patch by Erick Tryzelaar. llvm-svn: 81106
* remove the dead std::ostream APInt inserterChris Lattner2009-08-231-8/+2
| | | | llvm-svn: 79875
* Clean up the APInt function getDigit.Erick Tryzelaar2009-08-211-21/+19
| | | | llvm-svn: 79602
* Update error messages for '+'. Fix grammar and make the twoEric Christopher2009-08-211-4/+5
| | | | | | negative checks resemble each other. llvm-svn: 79595
* Fix trailing whitespace and 80-col violation.Eric Christopher2009-08-211-120/+121
| | | | llvm-svn: 79594
* Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9.Erick Tryzelaar2009-08-211-30/+42
| | | | llvm-svn: 79593
* Allow '+' to appear in APInt strings, and add more unit tests.Erick Tryzelaar2009-08-211-6/+11
| | | | llvm-svn: 79592
* Switch to SmallString::str from SmallString::c_str, and removeDaniel Dunbar2009-08-191-3/+4
| | | | | | SmallString::c_str. llvm-svn: 79456
* Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.Daniel Dunbar2009-08-131-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 Johannesen2009-08-121-1/+2
| | | | llvm-svn: 78825
* Fix a nondeterministic bug in APInt::roundToDouble;Dale Johannesen2009-08-121-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 Edwin2009-07-141-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 Dunbar2009-07-131-35/+35
| | | | llvm-svn: 75451
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-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 Gohman2009-06-301-0/+6
| | | | | | in APIntTest.cpp. llvm-svn: 74550
* Temporarily revert r74494. It was causing failures in the unit tests.Bill Wendling2009-06-301-6/+0
| | | | llvm-svn: 74515
* Define an operator<< for APInt to be used with std::ostream.Dan Gohman2009-06-301-0/+6
| | | | | | | This will allow it to be used in unittests that use gtest's EXPECT_EQ. llvm-svn: 74494
* 80 column violation.Evan Cheng2009-05-211-1/+1
| | | | llvm-svn: 72235
* Fix whitespacing (space after switch).Mike Stump2009-05-131-6/+5
| | | | llvm-svn: 71738
* Move helper functions for optimizing division by constant into the APIntJay Foad2009-04-301-0/+92
| | | | | | class. llvm-svn: 70488
* Fix PR4040: APInt's string constructor is too strictChris Lattner2009-04-251-7/+9
| | | | | | patch by Jeff Yasskin! llvm-svn: 70058
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-011-3/+3
| | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. llvm-svn: 68227
* Fix comment typo.Duncan Sands2009-03-191-1/+1
| | | | llvm-svn: 67302
* Fix a hashing bug in APInt. A certain pathological testcase (tooStuart Hastings2009-03-131-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 Edwin2009-01-271-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 Lattner2009-01-211-193/+193
| | | | | | compatibility with cygwin. Patch by Jay Foad! llvm-svn: 62695
* Fix typo, sentence fragment.Nick Lewycky2009-01-191-2/+2
| | | | llvm-svn: 62512
* rearrange some code.Chris Lattner2008-10-111-6/+6
| | | | llvm-svn: 57384
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-231-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. llvm-svn: 55263
* Move the fast-path (<=i64) cases of various APInt methods inlineChris Lattner2008-08-201-150/+40
| | | | | | | and the slow-path cases out of line. This speeds up instcombine a bit in real world cases. Patch contributed by m-s. llvm-svn: 55063
* It's not necessary to check if a value is null before delete[].Dan Gohman2008-08-201-1/+1
| | | | llvm-svn: 55053
* Rework the routines that convert AP[S]Int into a string. Now, instead ofChris Lattner2008-08-171-95/+98
| | | | | | | | | | | | | | | | | returning an std::string by value, it fills in a SmallString/SmallVector passed in. This significantly reduces string thrashing in some cases. More specifically, this: - Adds an operator<< and a print method for APInt that allows you to directly send them to an ostream. - Reimplements APInt::toString to be much simpler and more efficient algorithmically in addition to not thrashing strings quite as much. This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the asmprinter. This also fixes a bug I introduced into the asmwriter in a previous patch w.r.t. alias printing. llvm-svn: 54873
* remove a dead APInt ctor.Chris Lattner2008-08-171-8/+1
| | | | llvm-svn: 54869
* Fix PR2088. Use modulo linear equation solver to compute loop iterationWojciech Matyjewicz2008-07-201-1/+1
| | | | | | count. llvm-svn: 53810
* First step to fix PR2088. Implement routine to compute the Wojciech Matyjewicz2008-06-231-7/+48
| | | | | | | | multiplicative inverse of a given number. Modify udivrem to allow input and output pairs of arguments to overlap. Patch is based on the work by Chandler Carruth. llvm-svn: 52638
* Avoid creating a redundant zero APInt.Dan Gohman2008-06-211-1/+1
| | | | llvm-svn: 52602
* As comments said, for negative value, the arithmetic Zhou Sheng2008-06-051-1/+1
| | | | | | | | | over-shift-right should return -1. So here it should be signed-extended, when bitwidth larger than 64. test case: llvm/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll llvm-svn: 51999
* Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.Evan Cheng2008-05-021-20/+21
| | | | llvm-svn: 50590
* Make several symbols static.Dan Gohman2008-04-101-5/+5
| | | | llvm-svn: 49496
* A quick nm audit turned up several fixed tables and objects that wereDan Gohman2008-03-251-1/+1
| | | | | | | marked read-write. Use const so that they can be allocated in a read-only segment. llvm-svn: 48800
OpenPOWER on IntegriCloud