summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()Chris Lattner2007-08-231-2/+2
| | | | | | Add an APSInt::toString() method. llvm-svn: 41309
* initial checkin of Neil's APFloat work.Chris Lattner2007-08-201-10/+30
| | | | llvm-svn: 41203
* This adds a bunch of static functions that implement unsignedChris Lattner2007-08-161-0/+566
| | | | | | | | | | | two's complement bignum arithmetic. They could be used to implement much of APInt, but the idea is they are enough to implement APFloat as well, which the current APInt interface is not suited for. Patch by Neil Booth! llvm-svn: 41124
* Fix an assertion introduced by my last change to the toString method. WeReid Spencer2007-05-191-2/+2
| | | | | | | can't use getZExtValue() to extract the low order bits for each digit. Instead, we need to access the low order word directly. llvm-svn: 37242
* Get rid of leading zeros in the output of toString.Reid Spencer2007-05-171-8/+27
| | | | llvm-svn: 37175
* For lshr by 0 bits, just return *this as a short cut. This also preventsReid Spencer2007-05-171-0/+6
| | | | | | undefined behavior when the width > 64 bits. llvm-svn: 37153
* Fix a bug in the "fromString" method where radix 2,8 and 16 values wereReid Spencer2007-05-161-8/+13
| | | | | | | | not being generated correctly because the shl operator does not mutate its object but returns a new value. Also, make the distinction between radix 16 and the others more clear. llvm-svn: 37111
* Make the results for the rotate functions correct when rotateAmt == 0.Reid Spencer2007-05-141-0/+4
| | | | llvm-svn: 37026
* Add some things needed by the llvm-gcc version supporting bit accurate integerReid Spencer2007-05-131-1/+67
| | | | | | | | | | | types: 1. Functions to compute div/rem at the same time. 2. Further assurance that an APInt with 0 bitwidth cannot be constructed. 3. Left and right rotate operations. 4. An exactLogBase2 function which requires an exact power of two or it returns -1. llvm-svn: 37025
* Fix shl to produce the correct result when the bitwidth is > 64 and theReid Spencer2007-05-121-0/+6
| | | | | | | shift amount is 0. Previously this code would do a lshr by the bit width which can lead to incorrect results. llvm-svn: 37010
* silence some annoying gcc 4.3 warningsChris Lattner2007-05-031-7/+10
| | | | llvm-svn: 36680
* We want the number of bits needed, not the power of 2.Reid Spencer2007-04-141-1/+1
| | | | llvm-svn: 35977
* Implement a getBitsNeeded method to determine how many bits are needed toReid Spencer2007-04-131-0/+37
| | | | | | represent a string in binary form by an APInt. llvm-svn: 35968
* Fix an approximate calculation in an assertion not to give false negatives.Reid Spencer2007-04-111-1/+1
| | | | llvm-svn: 35901
* Fix a bug in getAllOnesValue() which brokeZhou Sheng2007-03-211-1/+1
| | | | | | some test cases for bitwidth > 64. llvm-svn: 35232
* Fix (and simplify) 48-bit byte swap.Jeff Cohen2007-03-201-9/+8
| | | | | | Get pos/neg infinity the correct way. llvm-svn: 35223
* Fix coding standards violation.Reid Spencer2007-03-191-1/+1
| | | | llvm-svn: 35189
* Implement extension of sign bits for negative values in the uint64_tReid Spencer2007-03-191-1/+5
| | | | | | constructor. This helps to fix test/Assembler/2007-03-19-NegValue.ll llvm-svn: 35180
* Revert the last patch as it violates the conditions of sext/zext.Reid Spencer2007-03-121-4/+0
| | | | llvm-svn: 35068
* For APInt::z/sext(width), if width == BitWidth, just return *this.Zhou Sheng2007-03-121-0/+4
| | | | llvm-svn: 35065
* Unbreak VC++ build.Jeff Cohen2007-03-051-1/+9
| | | | llvm-svn: 34917
* Fix ashr for bitwidths > 64. This is now validated up to 1024 bits.Reid Spencer2007-03-021-33/+49
| | | | llvm-svn: 34852
* Use a better algorithm for rounding sqrt results. Change the FIXME aboutReid Spencer2007-03-021-8/+12
| | | | | | | | | this to a NOTE: because pari/gp results start to get rounded incorrectly after 192 bits of precision. APInt and pari/gp never differ by more than 1, but APInt is more accurate because it does not lose precision after 192 bits as does pari/gp. llvm-svn: 34834
* Add a FIXMEReid Spencer2007-03-021-0/+3
| | | | llvm-svn: 34828
* Fix a problem where shifting by 64-bits leads to incorrect results on PPCReid Spencer2007-03-021-1/+4
| | | | | | but not on X86 becuase shift by word size is "undefined". llvm-svn: 34825
* Combine two lines that can be.Reid Spencer2007-03-011-2/+1
| | | | llvm-svn: 34818
* Make the static table of results in sqrt const.Reid Spencer2007-03-011-1/+1
| | | | llvm-svn: 34791
* Add methods for bit width modification: sextOrTrunc, zextOrTrunc.Reid Spencer2007-03-011-0/+16
| | | | llvm-svn: 34789
* Use a real table in sqrt to shorten and quicken the code.Reid Spencer2007-03-011-14/+10
| | | | | | Thanks for the idea Chris. llvm-svn: 34779
* Add a square root function.Reid Spencer2007-03-011-6/+87
| | | | llvm-svn: 34775
* Make the trunc/sext/zext methods return APInt& so that these operationsReid Spencer2007-02-281-7/+8
| | | | | | can be chained together with other operations. llvm-svn: 34743
OpenPOWER on IntegriCloud