summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add assert for non-hexadecimal radixes.Bill Wendling2008-03-161-0/+4
| | | | llvm-svn: 48421
* Fix a typo. It's causing consumer-typeset to miscompile. Perhaps more.Evan Cheng2008-03-071-1/+1
| | | | llvm-svn: 48035
* Add support to APInt for shift and rotate operations with APIntDan Gohman2008-02-291-0/+27
| | | | | | instead of uint32_t for the shift/rotate count operand type. llvm-svn: 47741
* Fixed bug in APInt::Profile() where the BitWidth field was not included in theTed Kremenek2008-02-191-0/+2
| | | | | | | profile of the APSInt object. This caused unexpected Profile collisions where none should have occurred. llvm-svn: 47338
* Fix a warning about comparison between signed and unsigned,Dan Gohman2008-02-141-1/+1
| | | | | | being consistent with the rest of the APInt implementation. llvm-svn: 47138
* Add countTrailingOnes member functions to APInt.Dan Gohman2008-02-131-0/+12
| | | | llvm-svn: 47086
* Added FoldingSet style 'profiling' support for APInt.Ted Kremenek2008-01-191-1/+13
| | | | llvm-svn: 46188
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Cygwin defines uint32_t as unsigned long. Unbreak call to std::min in this caseAnton Korobeynikov2007-12-241-1/+1
| | | | llvm-svn: 45342
* Don't have APInt.cpp depend upon DerivedTypes.h. This helps with splitting theReid Spencer2007-12-111-14/+23
| | | | | | Support libraries separately into their own module. llvm-svn: 44852
* Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.Chris Lattner2007-11-231-1/+1
| | | | llvm-svn: 44296
* Fix APInt::countTrailingZeros to return BitWidth if the input is zero ↵Chris Lattner2007-11-231-2/+2
| | | | | | instead of returning some random large number. llvm-svn: 44294
* Don't attempt to mask no bitsNeil Booth2007-10-121-1/+2
| | | | llvm-svn: 42909
* Add a new function tcExtract for extracting a bignum from anNeil Booth2007-10-081-34/+76
| | | | | | | | | | | | | arbitrary range of bits embedded in the middle of another bignum. This kind of operation is desirable in many cases of software floating point, e.g. converting bignum integers to floating point numbers of fixed precision (you want to extract the precision most significant bits). Elsewhere, add an assertion, and exit the shift functions early if the shift count is zero. llvm-svn: 42745
* Fix and clarify some comments.Neil Booth2007-10-061-12/+12
| | | | llvm-svn: 42670
* Generalize tcFullMultiply so that the operands can be of differingNeil Booth2007-10-061-13/+20
| | | | | | | | part widths. Also, return the number of parts actually required to hold the result's value. Remove an over-cautious condition from rounding of float->hex conversion. llvm-svn: 42669
* Change APFloat::convertFromInteger to take the incomingDale Johannesen2007-09-211-1/+1
| | | | | | | | | | bit width instead of number of words allocated, which makes it actually work for int->APF conversions. Adjust callers. Add const to one of the APInt constructors to prevent surprising match when called with const argument. llvm-svn: 42210
* Do not hide APInt::dump() inside #ifndef NDEBUG.Devang Patel2007-09-171-4/+0
| | | | llvm-svn: 42068
* Remove the assumption that FP's are either float orDale Johannesen2007-09-141-1/+1
| | | | | | | | | | | | | double from some of the many places in the optimizers it appears, and do something reasonable with x86 long double. Make APInt::dump() public, remove newline, use it to dump ConstantSDNode's. Allow APFloats in FoldingSet. Expand X86 backend handling of long doubles (conversions to/from int, mostly). llvm-svn: 41967
OpenPOWER on IntegriCloud