[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-18 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.85 - 1.86 --- Log message: Fix an assertion introduced by my last change to the toString method. We can't use getZExtValue() to extract the low order bits for each digit. Instead, we need to access the low order word directly. ---

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-17 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.84 - 1.85 --- Log message: Get rid of leading zeros in the output of toString. --- Diffs of the changes: (+27 -8) APInt.cpp | 35 +++ 1 files changed, 27 insertions(+), 8 deletions(-) Index:

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-16 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.82 - 1.83 --- Log message: Fix a bug in the fromString method where radix 2,8 and 16 values were not being generated correctly because the shl operator does not mutate its object but returns a new value. Also, make the distinction

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-16 Thread Chris Lattner
Fix a bug in the fromString method where radix 2,8 and 16 values were 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. FWIW, I find this part of the API

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-16 Thread Reid Spencer
On Wed, 2007-05-16 at 13:30 -0700, Chris Lattner wrote: Fix a bug in the fromString method where radix 2,8 and 16 values were 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

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-13 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.80 - 1.81 --- Log message: Add some things needed by the llvm-gcc version supporting bit accurate integer types: 1. Functions to compute div/rem at the same time. 2. Further assurance that an APInt with 0 bitwidth cannot be

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-13 Thread Chris Lattner
On May 13, 2007, at 4:45 PM, Reid Spencer wrote: +APInt APInt::rotl(uint32_t rotateAmt) const { + // Don't get too fancy, just use existing shift/or facilities + APInt hi(*this); + APInt lo(*this); + hi.shl(rotateAmt); + lo.lshr(BitWidth - rotateAmt); + return hi | lo; +} +

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-13 Thread Reid Spencer
On Sun, 2007-05-13 at 16:49 -0700, Chris Lattner wrote: On May 13, 2007, at 4:45 PM, Reid Spencer wrote: +APInt APInt::rotl(uint32_t rotateAmt) const { + // Don't get too fancy, just use existing shift/or facilities + APInt hi(*this); + APInt lo(*this); + hi.shl(rotateAmt); +

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-13 Thread Chris Lattner
On May 13, 2007, at 4:57 PM, Reid Spencer wrote: On Sun, 2007-05-13 at 16:49 -0700, Chris Lattner wrote: On May 13, 2007, at 4:45 PM, Reid Spencer wrote: +APInt APInt::rotl(uint32_t rotateAmt) const { + // Don't get too fancy, just use existing shift/or facilities + APInt hi(*this); +

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-13 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.81 - 1.82 --- Log message: Make the results for the rotate functions correct when rotateAmt == 0. --- Diffs of the changes: (+4 -0) APInt.cpp |4 1 files changed, 4 insertions(+) Index: llvm/lib/Support/APInt.cpp diff

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-12 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.79 - 1.80 --- Log message: Fix shl to produce the correct result when the bitwidth is 64 and the shift amount is 0. Previously this code would do a lshr by the bit width which can lead to incorrect results. --- Diffs of the

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-05-03 Thread Chris Lattner
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.78 - 1.79 --- Log message: silence some annoying gcc 4.3 warnings --- Diffs of the changes: (+10 -7) APInt.cpp | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) Index: llvm/lib/Support/APInt.cpp diff

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-04-13 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.76 - 1.77 --- Log message: Implement a getBitsNeeded method to determine how many bits are needed to represent a string in binary form by an APInt. --- Diffs of the changes: (+37 -0) APInt.cpp | 37

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-04-13 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.77 - 1.78 --- Log message: We want the number of bits needed, not the power of 2. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-04-11 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.75 - 1.76 --- Log message: Fix an approximate calculation in an assertion not to give false negatives. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index:

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-20 Thread Jeff Cohen
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.73 - 1.74 --- Log message: Fix (and simplify) 48-bit byte swap. Get pos/neg infinity the correct way. --- Diffs of the changes: (+8 -9) APInt.cpp | 17 - 1 files changed, 8 insertions(+), 9 deletions(-) Index:

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-19 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.71 - 1.72 --- Log message: Implement extension of sign bits for negative values in the uint64_t constructor. This helps to fix test/Assembler/2007-03-19-NegValue.ll --- Diffs of the changes: (+5 -1) APInt.cpp |6 +- 1

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-19 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.72 - 1.73 --- Log message: Fix coding standards violation. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-12 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.69 - 1.70 --- Log message: For APInt::z/sext(width), if width == BitWidth, just return *this. --- Diffs of the changes: (+4 -0) APInt.cpp |4 1 files changed, 4 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-12 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.70 - 1.71 --- Log message: Revert the last patch as it violates the conditions of sext/zext. --- Diffs of the changes: (+0 -4) APInt.cpp |4 1 files changed, 4 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-12 Thread Reid Spencer
On Mon, 2007-03-12 at 12:48 -0500, Zhou Sheng wrote: Changes in directory llvm/lib/Support: APInt.cpp updated: 1.69 - 1.70 --- Log message: For APInt::z/sext(width), if width == BitWidth, just return *this. Sheng, this is incorrect. It is not legal to use sext/zext with a bit width

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-04 Thread Jeff Cohen
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.68 - 1.69 --- Log message: Unbreak VC++ build. --- Diffs of the changes: (+9 -1) APInt.cpp | 10 +- 1 files changed, 9 insertions(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-02 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.67 - 1.68 --- Log message: Fix ashr for bitwidths 64. This is now validated up to 1024 bits. --- Diffs of the changes: (+49 -33) APInt.cpp | 82 +- 1 files changed,

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-01 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.61 - 1.62 --- Log message: Add methods for bit width modification: sextOrTrunc, zextOrTrunc. --- Diffs of the changes: (+16 -0) APInt.cpp | 16 1 files changed, 16 insertions(+) Index:

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-01 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.62 - 1.63 --- Log message: Make the static table of results in sqrt const. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-01 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.63 - 1.64 --- Log message: Combine two lines that can be. --- Diffs of the changes: (+1 -2) APInt.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-01 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.64 - 1.65 --- Log message: Fix a problem where shifting by 64-bits leads to incorrect results on PPC but not on X86 becuase shift by word size is undefined. --- Diffs of the changes: (+4 -1) APInt.cpp |5 - 1 files

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-01 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.65 - 1.66 --- Log message: Add a FIXME --- Diffs of the changes: (+3 -0) APInt.cpp |3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.65

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-03-01 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.66 - 1.67 --- Log message: Use a better algorithm for rounding sqrt results. Change the FIXME about this to a NOTE: because pari/gp results start to get rounded incorrectly after 192 bits of precision. APInt and pari/gp never differ

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-28 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.58 - 1.59 --- Log message: Make the trunc/sext/zext methods return APInt so that these operations can be chained together with other operations. --- Diffs of the changes: (+8 -7) APInt.cpp | 15 --- 1 files changed,

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-28 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.59 - 1.60 --- Log message: Add a square root function. --- Diffs of the changes: (+87 -6) APInt.cpp | 93 ++ 1 files changed, 87 insertions(+), 6 deletions(-) Index:

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-28 Thread Chris Lattner
+ // Use a fast table for some small values. This also gets rid of some + // rounding errors in libc sqrt for small values. + if (magnitude = 5) { Please use a real table, not a switch, for this. It will be smaller (codesize) and faster. -Chris

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-27 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.52 - 1.53 --- Log message: 1. Fix three serious bugs in the comparison code. 2. Change RoundDoubleToAPInt to take a bit width parameter. Use that parameter to limit the bit width of the result. --- Diffs of the changes: (+22

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-27 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.53 - 1.54 --- Log message: Conform to single person attribution in file comment. --- Diffs of the changes: (+2 -3) APInt.cpp |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/Support/APInt.cpp diff

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-27 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.54 - 1.55 --- Log message: Improve APInt interface: 1. Add unsigned and signed versions of methods so a bool argument doesn't need to be passed in. 2. Make the various getMin/getMax functions all be inline since they are so

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-27 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.55 - 1.56 --- Log message: Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize the bit width of negative numbers by computing the minimum bit width for a negative value. E.g. 0x1800 could be just

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-27 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.56 - 1.57 --- Log message: Join two lines that can be joined. --- Diffs of the changes: (+1 -2) APInt.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-27 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.57 - 1.58 --- Log message: Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits instead of honoring the client's requested bit width. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-26 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.47 - 1.48 --- Log message: Re-enable this. The header was committed. --- Diffs of the changes: (+0 -4) APInt.cpp |4 1 files changed, 4 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-26 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.48 - 1.49 --- Log message: Implement the getHashValue method. Fix toString use of getValue to use getZExtValue() --- Diffs of the changes: (+16 -1) APInt.cpp | 17 - 1 files changed, 16 insertions(+), 1

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-26 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.49 - 1.50 --- Log message: 1. Make sure all delete operators of arrays use the array form of delete. 2. Rewrite operator=(const APInt RHS) to allow the RHS to be a different bit width than the LHS. This makes it possible to use

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-26 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.50 - 1.51 --- Log message: Simplify and document RoundDoubleToAPInt. --- Diffs of the changes: (+15 -3) APInt.cpp | 18 +++--- 1 files changed, 15 insertions(+), 3 deletions(-) Index: llvm/lib/Support/APInt.cpp

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-26 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.51 - 1.52 --- Log message: Get rid of extraneous // in file comment. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-25 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.41 - 1.42 --- Log message: 1. Provide more detail in file comment. 2. Move comments for methods to .h file, delete them in .cpp file. 3. All places that were doing manual clear of high order bits now call the clearUnusedBits()

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-25 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.42 - 1.43 --- Log message: 1. Fix the flip() method to correctly flip all words of the APInt. 2. Implement the trunc, sext, and zext operations. 3. Improve fromString to accept negative values as input. --- Diffs of the changes:

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-25 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.43 - 1.44 --- Log message: Fix sext operation. Shifting by zero would leave an incorrect mask. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index:

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-25 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.44 - 1.45 --- Log message: Rewrite lshr to not do bit by bit copy but to copy and shift whole words. This makes it much more efficient. --- Diffs of the changes: (+44 -17) APInt.cpp | 61

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-25 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.45 - 1.46 --- Log message: 1. Remove redundant calls to clearUsedBits(). 2. Fix countTrailingZeros to use a faster algorithm. 3. Simplify sext() slightly by using isNegative(). 4. Implement ashr using word-at-a-time logic instead of

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-25 Thread Chris Lattner
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.46 - 1.47 --- Log message: another missing header :( :( :( --- Diffs of the changes: (+4 -0) APInt.cpp |4 1 files changed, 4 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.46

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.33 - 1.34 --- Log message: 1. Fix last bug in KnuthDiv. All divide tests pass up to 1024 bits now. 2. Clean up comments, style, coding standards, etc. 3. Simplify a constructor. Extended testing revealed some additional bugs in

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.34 - 1.35 --- Log message: 1. Fix a bug in fromString for the = 64bits case 2. Fix shl when shiftAmount == BitWidth. --- Diffs of the changes: (+30 -18) APInt.cpp | 48 ++-- 1 files

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.35 - 1.36 --- Log message: Fix the remainder shifting in KnuthDiv. --- Diffs of the changes: (+13 -6) APInt.cpp | 19 +-- 1 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/lib/Support/APInt.cpp

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.36 - 1.37 --- Log message: Fix the 64 bits case for left shift. --- Diffs of the changes: (+52 -27) APInt.cpp | 79 -- 1 files changed, 52 insertions(+), 27

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.37 - 1.38 --- Log message: Whoops, last word with bits in large shift left wasn't correct. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.38 - 1.39 --- Log message: Clean up lshr and ashr to coding standards. Handle the single word cases for shiftAmt == BitWidth. --- Diffs of the changes: (+79 -53) APInt.cpp | 132

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Chris Lattner
/ Clean up the memory we allocated. - delete [] U; - delete [] V; - delete [] Q; - delete [] R; + if (U != SPACE[0]) { +delete [] U; +delete [] V; +delete [] Q; +delete [] R; + } } Please just use SmallVectoruint32, N instead of explicitly doing it yourself.

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-24 Thread Chris Lattner
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.39 - 1.40 --- Log message: this doesn't compile, disable it --- Diffs of the changes: (+4 -0) APInt.cpp |4 1 files changed, 4 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.39

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-23 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.32 - 1.33 --- Log message: 1. Make internal functions take const arguments where they should, just to be safe. 2. Make internal functions that return a carry/borrow return bool instead of uint64_t because the carry/borrow can

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-22 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.31 - 1.32 --- Log message: 1. Fix a carry out problem in add if destination and x point to the same memory (as done in fromString). 2. Implement Knuth divide more closely to what is recommended in his book. 3. Fix computation of

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-21 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.28 - 1.29 --- Log message: Reorganize some code to make it clearer, avoid a few uninitialized memory reads, and reduce the number of temporary APInt instances we construct. --- Diffs of the changes: (+57 -56) APInt.cpp | 113

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-21 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.29 - 1.30 --- Log message: Fix countLeadingZeros in the case that the bitwidth evenly divides the word size. This fixes all reads of uninitialized data (buffer over read) and makes APInt.cpp memory clean, per valgrind. The only

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-21 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.30 - 1.31 --- Log message: When converting from 64 to 32-bits, use the actual number of words to extract the value, not the number of words implied by the active bits. This fixes numerous, but not all divide bugs. --- Diffs of the

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.21 - 1.22 --- Log message: First version that can process arith.cpp test case up to 1024 bits: 1. Ensure pVal is set to 0 in each constructor. 2. Fix roundToDouble to make correct calculations and not read beyond the end of

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.22 - 1.23 --- Log message: Use INFINITY macro from math.h instead of constructing hex floating point constants (avoids warnings). --- Diffs of the changes: (+3 -2) APInt.cpp |5 +++-- 1 files changed, 3 insertions(+), 2

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Evan Cheng
Hi Reid, This breaks the build for me. $ make ENABLE_OPTIMIZED=1 -j2 make[1]: Nothing to be done for `all'. llvm[1]: Compiling Annotation.cpp for Release build llvm[1]: Compiling APInt.cpp for Release build APInt.cpp:841: error: floating constant exceeds range of 'float' APInt.cpp:843: error:

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Chris Lattner
On Feb 20, 2007, at 11:13 AM, Evan Cheng wrote: Hi Reid, This breaks the build for me. $ make ENABLE_OPTIMIZED=1 -j2 make[1]: Nothing to be done for `all'. llvm[1]: Compiling Annotation.cpp for Release build llvm[1]: Compiling APInt.cpp for Release build APInt.cpp:841: error: floating

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.23 - 1.24 --- Log message: Clean up variable names in operator*. Attempt #3 for getting a portable INFINITY value. --- Diffs of the changes: (+8 -8) APInt.cpp | 16 1 files changed, 8 insertions(+), 8

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.24 - 1.25 --- Log message: Make long addition and subtraction work. Speed things up by using internal functions more. --- Diffs of the changes: (+69 -72) APInt.cpp | 141

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.25 - 1.26 --- Log message: Fix countLeadingZeros to actually return the correct number. Fix toString to correctly return 0 for zero valued APInts over 128 bits. --- Diffs of the changes: (+13 -11) APInt.cpp | 24

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.26 - 1.27 --- Log message: 1. Add a dump() method for faster debugging. 2. Change 0 initialization of union to larger component so all is zeroed. 3. Fix the borrow logic in subtraction so it works for 128 bits. 4. Rewrite fromString

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-20 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.27 - 1.28 --- Log message: Fix the carry in addition. --- Diffs of the changes: (+2 -2) APInt.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-18 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.20 - 1.21 --- Log message: 1. Fix some indentation and variable names in the get{Min,Max}Value methods. 2. Implement toString for power-of-2 radix without using divide and always printing full words. This allows hex/binary to look

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-17 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.15 - 1.16 --- Log message: Fix some bugs in division logic. --- Diffs of the changes: (+5 -3) APInt.cpp |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-17 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.16 - 1.17 --- Log message: Implement signed output for toString. Fix bugs in countLeadingZeros and countTrailingZeros. --- Diffs of the changes: (+75 -44) APInt.cpp | 119

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-17 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.17 - 1.18 --- Log message: Make add_1 exit early if carry is 0. Fix line breaks and 80 cols violation. Simplify operator^= since bitwidths must be the same. --- Diffs of the changes: (+23 -36) APInt.cpp | 59

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-16 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.11 - 1.12 --- Log message: Review changes: 1. Function style changes. 2. 80-col violations. 3. Better names for things. 4. Arrange constructors so they all take bit width first. 5. Add named signed and unsigned comparison functions

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-16 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.12 - 1.13 --- Log message: Fix bugs introduced by constructor parameter order change. --- Diffs of the changes: (+29 -13) APInt.cpp | 42 +- 1 files changed, 29 insertions(+), 13

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-16 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.13 - 1.14 --- Log message: Clean up the divide and remainder logic a bit (exit early). Use more meaningful variable names. Add comments to document the flow. --- Diffs of the changes: (+90 -65) APInt.cpp | 155

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-16 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.14 - 1.15 --- Log message: Move static functions closer to their usage. --- Diffs of the changes: (+295 -295) APInt.cpp | 590 +++--- 1 files changed, 295 insertions(+),

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-14 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.10 - 1.11 --- Log message: Fix some buges: 1. Make getMinValue() returns the right value. 2. Fix the ByteSwap() crash problem. 3. Make Postfix increment work correctly. 4. Fix some bugs in LogBase2, Hi/LoBits and UDiv. --- Diffs of

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-13 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.8 - 1.9 --- Log message: Make some minor improvements to APInt: 1. Make all the operators use uppercase 2. Rename APIntRoundToDouble method just RoundToDouble, the APInt is redundant. 3. Turn the class on for compilation. ---

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-13 Thread Reid Spencer
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.9 - 1.10 --- Log message: Use brute-force algorithm for to_string. It doesn't have to be efficient at this point, it just needs to work so we can test things reliably. --- Diffs of the changes: (+35 -28) APInt.cpp | 63

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-12 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.7 - 1.8 --- Log message: 1. Make APInt::shl work correctly and more efficiently. 2. Add functions to support the numberical conversion between APInt and double/float. --- Diffs of the changes: (+78 -10) APInt.cpp | 88

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-08 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.4 - 1.5 --- Log message: As Chris and Reid suggested, remove isSigned field from APInt, instead, add some signed/unsigned arithmetic operation functions into APInt.h to handle the signed/unsigned issue. These functions will be defined

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-08 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.5 - 1.6 --- Log message: Switched this file on accidently. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-08 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.6 - 1.7 --- Log message: Eliminates friend function declaration inside APInt, instead, adds public methods as those global function's internal implementation. --- Diffs of the changes: (+23 -23) APInt.cpp | 46

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-06 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.3 - 1.4 --- Log message: As Chris suggested, fixed some problems. (This is the first part) --- Diffs of the changes: (+157 -147) APInt.cpp | 304 -- 1 files changed,

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-05 Thread Zhou Sheng
Changes in directory llvm/lib/Support: APInt.cpp added (r1.1) --- Log message: Add a class APInt to represent arbitrary precision constant integral values. It is a functional replacement for common case integer type like unsigned, uint64_t, but also allows non-byte-width integer type and large

[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-05 Thread Chris Lattner
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.1 - 1.2 --- Log message: Disable this for now. --- Diffs of the changes: (+5 -0) APInt.cpp |5 + 1 files changed, 5 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.1

Re: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp

2007-02-05 Thread Chris Lattner
+ #include llvm/ADT/APInt.h + #include llvm/DerivedTypes.h + #include llvm/Support/MathExtras.h + #include strings.h strings.h is not portable. Please use cstring, and memcpy/memset/ etc instead of bzero and friends. I've #ifdef'd this file out temporarily until this is resolved. +