aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Fix a warning about comparison between signed and unsigned,Dan Gohman2008-02-141-1/+1
| | | | | | | being consistent with the rest of the APInt implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47138 91177308-0d34-0410-b5e6-96231b3b80d8
* Add countTrailingOnes member functions to APInt.Dan Gohman2008-02-131-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47086 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "Profile" method to APFloat for use with FoldingSet.Ted Kremenek2008-02-112-11/+6
| | | | | | | | | | | Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary objects to a profile via dispatch to FoldingSetTrait<T>::Profile(). Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their functionality is now replaced using the above mentioned member template. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46957 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to FoldingSet for hashing APInt objects.Dan Gohman2008-02-061-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46833 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "bucket_iterators" to FoldingSet. Bucket iterators allow iterationTed Kremenek2008-02-041-1/+7
| | | | | | | over all the nodes in a particular bucket. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46716 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed 80 col. violation.Ted Kremenek2008-02-041-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46709 91177308-0d34-0410-b5e6-96231b3b80d8
* Chris' change to print an approximation to long doublesDale Johannesen2008-01-311-1/+2
| | | | | | | | | exposed a bug in APFloat's long double->double conversion of NaNs. Broke several things in the ieee part of gcc testsuite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46617 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove top-level const qualifiers from casts, avoiding associatedDan Gohman2008-01-291-10/+10
| | | | | | | compiler warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46509 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the code and fix a typo.Lauro Ramos Venancio2008-01-281-7/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46458 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix fpcmp infinite loop when comparing "29-266" with "29-268".Lauro Ramos Venancio2008-01-281-5/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46455 91177308-0d34-0410-b5e6-96231b3b80d8
* Added FoldingSet style 'profiling' support for APSInt.Ted Kremenek2008-01-191-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46189 91177308-0d34-0410-b5e6-96231b3b80d8
* Added FoldingSet style 'profiling' support for APInt.Ted Kremenek2008-01-191-1/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46188 91177308-0d34-0410-b5e6-96231b3b80d8
* Made 'FoldingSetNodeID' a proper class instead of a nested class inTed Kremenek2008-01-191-19/+19
| | | | | | | | | | | 'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of 'FoldingSetNodeImpl::NodeID'). Why? Clients can now easily forward declare 'FoldingSetNodeID' without having to include FoldingSet.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46187 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-2925-50/+50
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* remove attribution from lib Makefiles.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45415 91177308-0d34-0410-b5e6-96231b3b80d8
* Cygwin defines uint32_t as unsigned long. Unbreak call to std::min in this caseAnton Korobeynikov2007-12-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45342 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44852 91177308-0d34-0410-b5e6-96231b3b80d8
* proper #include order.Chris Lattner2007-12-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44707 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding a StringPool data structure, which GC will use.Gordon Henriksen2007-12-081-0/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44705 91177308-0d34-0410-b5e6-96231b3b80d8
* Prior commit updated wrong if, apologies.Neil Booth2007-12-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44614 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle zero correctly.Neil Booth2007-12-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44613 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle 0 correctly in string->APFloat conversion.Dale Johannesen2007-12-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44594 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.Chris Lattner2007-11-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44296 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix APInt::countTrailingZeros to return BitWidth if the input is zero ↵Chris Lattner2007-11-231-2/+2
| | | | | | instead of returning some random large number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44294 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN ↵Chris Lattner2007-11-181-0/+18
| | | | | | | | | return a valid but empty buffer if stdin is empty. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44219 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix denormal check in float->APInt conversion.Dale Johannesen2007-11-171-1/+1
| | | | | | | PR 1804. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44201 91177308-0d34-0410-b5e6-96231b3b80d8
* make smallptrset more const and type correct, which caught a fewChris Lattner2007-11-061-2/+2
| | | | | | | minor bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43782 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some unnecessary C-style statics.Neil Booth2007-11-021-6/+8
| | | | | | | Restore an assertion that arithmetic can be performed on this format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43638 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back line whose removal somehow crept into prior patchNeil Booth2007-11-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43627 91177308-0d34-0410-b5e6-96231b3b80d8
* When converting to integer, do bit manipulations in the destinationNeil Booth2007-11-011-71/+107
| | | | | | | | | | | | | memory rather than in a copy of the APFloat. This avoids problems when the destination is wider than our significand and is cleaner. Also provide deterministic values in all cases where conversion fails, namely zero for NaNs and the minimal or maximal value respectively for underflow or overflow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43626 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarified operator precedence.Hartmut Kaiser2007-10-251-2/+2
| | | | | | Silenced VC++ warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43372 91177308-0d34-0410-b5e6-96231b3b80d8
* This requires rtti info because tblgen uses commandline,Chris Lattner2007-10-181-1/+4
| | | | | | | and tblgen requires rtti. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43127 91177308-0d34-0410-b5e6-96231b3b80d8
* Fast-track obviously over-large and over-small exponents during decimal->Neil Booth2007-10-151-8/+44
| | | | | | | | | | | integer conversion. In some such cases this makes us one or two orders of magnitude faster than NetBSD's libc. Glibc seems to have a similar fast path. Also, tighten up some upper bounds to save a bit of memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42984 91177308-0d34-0410-b5e6-96231b3b80d8
* Consolidate logic for creating NaNs. Silence compiler warning.Neil Booth2007-10-141-10/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42966 91177308-0d34-0410-b5e6-96231b3b80d8
* Whether arithmetic is supported is a property of the semantics. Make itNeil Booth2007-10-141-41/+36
| | | | | | | so, and clean up the checks by putting them in an inline function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42965 91177308-0d34-0410-b5e6-96231b3b80d8
* Separate out parsing of decimal number. Use this to only allocateNeil Booth2007-10-141-97/+150
| | | | | | | | memory for the significand once up-front. Also ignore insignificant trailing zeroes; this saves unnecessary multiplications later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42964 91177308-0d34-0410-b5e6-96231b3b80d8
* If the power of 5 is exact, and the reciprocal exact, the error is zero not ↵Neil Booth2007-10-131-1/+1
| | | | | | one half-ulps. This prevents an infinite loop in rare cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42950 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicate comment.Neil Booth2007-10-121-11/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42913 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement correctly-rounded decimal->binary conversion, i.e. conversionNeil Booth2007-10-121-6/+349
| | | | | | | | | | | | from user input strings. Such conversions are more intricate and subtle than they may appear; it is unlikely I have got it completely right first time. I would appreciate being informed of any bugs and incorrect roundings you might discover. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42912 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a field that was never used.Neil Booth2007-10-121-9/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42911 91177308-0d34-0410-b5e6-96231b3b80d8
* If we're trying to be arbitrary precision, unsigned char clearly won't cut ↵Neil Booth2007-10-121-1/+1
| | | | | | it. Needed for dec->bin conversions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42910 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attempt to mask no bitsNeil Booth2007-10-121-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42909 91177308-0d34-0410-b5e6-96231b3b80d8
* Next PPC long double bits. First cut at constants.Dale Johannesen2007-10-111-6/+157
| | | | | | | | | | | No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new MemoryBuffer::getMemBufferCopy method.Chris Lattner2007-10-091-2/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42815 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass argc by value, not by reference, since it isn't modified.Dan Gohman2007-10-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42788 91177308-0d34-0410-b5e6-96231b3b80d8
* Change a #include into a forward declarationChris Lattner2007-10-091-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42781 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the space in overview output for commands out of each of theDan Gohman2007-10-081-1/+1
| | | | | | | commands and into the common code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42752 91177308-0d34-0410-b5e6-96231b3b80d8
* Use APInt::tcExtract. It's cleaner, and works :)Neil Booth2007-10-081-19/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42746 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42745 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back convertFromSignExtendedInteger.Neil Booth2007-10-071-0/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42735 91177308-0d34-0410-b5e6-96231b3b80d8