aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Now that convertFromUnsignedParts has a sane, constant interface,Neil Booth2007-10-071-5/+1
| | | | | | | | convertFromZeroExtendedInteger can be simplified as it doesn't need to make a copy of the source bignum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42734 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement convertFromUnsignedInteger so it is passed a const bignum.Neil Booth2007-10-071-18/+29
| | | | | | | | | | It used to modify its argument in-place. This interface is saner and the implementation more efficient. It will be needed for decimal->binary conversion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42733 91177308-0d34-0410-b5e6-96231b3b80d8
* convertFromInteger, as originally written, expected sign-extendedNeil Booth2007-10-071-4/+6
| | | | | | | | | | input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
* combineLostFractions does not need to be a member functionNeil Booth2007-10-071-16/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42729 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleaner, more general exponent output.Neil Booth2007-10-061-21/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42690 91177308-0d34-0410-b5e6-96231b3b80d8
* silence warnings in no-assert build.Chris Lattner2007-10-061-23/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42687 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix and clarify some comments.Neil Booth2007-10-061-12/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42670 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize tcFullMultiply so that the operands can be of differingNeil Booth2007-10-062-16/+24
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42669 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APFloat -> hexadecimal string conversion, as per %a and %A in C99.Neil Booth2007-10-031-3/+240
| | | | | | | Useful for diagnostics and debugging. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42598 91177308-0d34-0410-b5e6-96231b3b80d8
* Add initial iterator support for folding set.Chris Lattner2007-10-031-0/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42589 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify implementation of the FoldingSet circular list, a necessary stepChris Lattner2007-10-031-11/+20
| | | | | | | to giving it iterators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42586 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak RoundAwayFromZero the bit number below which is truncated, and makeNeil Booth2007-10-031-8/+13
| | | | | | | | | it const. Preparation for APFloat -> hexadecimal string conversion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42576 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify and fix signed int -> FP conversions.Dale Johannesen2007-09-301-11/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42483 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace and compiler warning cleanup.Neil Booth2007-09-261-76/+91
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42373 91177308-0d34-0410-b5e6-96231b3b80d8
* Make APFloat->int conversions deterministic even inDale Johannesen2007-09-251-5/+33
| | | | | | | cases with undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42328 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix long double<->shorter FP type conversionsDale Johannesen2007-09-251-12/+29
| | | | | | | | of zero, infinity, and NaNs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42298 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle storage complications of float->float conversions.Neil Booth2007-09-221-18/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42220 91177308-0d34-0410-b5e6-96231b3b80d8
* Change APFloat::convertFromInteger to take the incomingDale Johannesen2007-09-212-17/+20
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42210 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR 1688. See comments there.Dale Johannesen2007-09-201-13/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42181 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not hide APInt::dump() inside #ifndef NDEBUG.Devang Patel2007-09-171-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42068 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a gcc warning: comparison between signed and unsigned integer expressionsChris Lattner2007-09-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41972 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the assumption that FP's are either float orDale Johannesen2007-09-142-1/+7
| | | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41967 91177308-0d34-0410-b5e6-96231b3b80d8
* And an FoldingSetImpl::NodeID::AddInteger overload for int64_t, to avoidDan Gohman2007-09-141-0/+3
| | | | | | | ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41960 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove spurious consts. This fixes warnings with compilers thatDan Gohman2007-09-141-2/+2
| | | | | | | are strict about such things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41956 91177308-0d34-0410-b5e6-96231b3b80d8
* Compensate for partCount change in Bogus definitionDale Johannesen2007-09-121-1/+1
| | | | | | | (could break hash table in ConstantFP) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41874 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APInt interfaces to APFloat (allows directlyDale Johannesen2007-09-111-15/+149
| | | | | | | | | | | access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
* Smarter Reset(). Instead of deallocating all memory regions and reallocate theEvan Cheng2007-09-081-5/+17
| | | | | | | first region, just deallocate all but the last region in the list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41782 91177308-0d34-0410-b5e6-96231b3b80d8
* Added Reset() to free all allocated memory regions and reset state to be the ↵Evan Cheng2007-09-051-0/+6
| | | | | | same as right after ctor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41728 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix mod so it actually works. Fix conversions toDale Johannesen2007-09-051-9/+33
| | | | | | | native types to handle denormals correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41726 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops, should be part of 41664; won't work very well without this piece.Dale Johannesen2007-08-311-0/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41665 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance APFloat to retain bits of NaNs (fixes oggenc).Dale Johannesen2007-08-311-77/+76
| | | | | | | | Use APFloat interfaces for more references, mostly of ConstantFPSDNode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41632 91177308-0d34-0410-b5e6-96231b3b80d8