- Mar 01, 2007
-
-
Reid Spencer authored
Thanks for the idea Chris. llvm-svn: 34779
-
Reid Spencer authored
llvm-svn: 34775
-
- Feb 28, 2007
-
-
Reid Spencer authored
interface not depend on Type or ICmpInst. llvm-svn: 34761
-
Reid Spencer authored
can be chained together with other operations. llvm-svn: 34743
-
Reid Spencer authored
instead of honoring the client's requested bit width. llvm-svn: 34712
-
Reid Spencer authored
llvm-svn: 34705
-
- Feb 27, 2007
-
-
Reid Spencer authored
the bit width of negative numbers by computing the minimum bit width for a negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000 llvm-svn: 34695
-
Reid Spencer authored
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 simple. 3. Simplify sdiv and srem code. llvm-svn: 34680
-
Reid Spencer authored
llvm-svn: 34678
-
Reid Spencer authored
2. Change RoundDoubleToAPInt to take a bit width parameter. Use that parameter to limit the bit width of the result. llvm-svn: 34673
-
Reid Spencer authored
llvm-svn: 34662
-
Reid Spencer authored
llvm-svn: 34648
-
Reid Spencer authored
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 APInt as the key of a DenseMap, as needed for the IntConstants map in Constants.cpp 3. Fix operator=(uint64_t) to clear unused bits in case the client assigns a value that has more bits than the APInt allows. 4. Assert that bit widths are equal in operator== 5. Revise getHashValue() to put the bit width in the low order six bits. This should help to make i1 0, i2 0, ... i64 0 all distinct in the IntConstants DenseMap. llvm-svn: 34646
-
- Feb 26, 2007
-
-
Reid Spencer authored
Fix toString use of getValue to use getZExtValue() llvm-svn: 34642
-
Reid Spencer authored
llvm-svn: 34634
-
Chris Lattner authored
llvm-svn: 34632
-
Reid Spencer authored
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 bit-at-a-time 5. Rename locals named isNegative so they don't clash with method name. 6. Fix fromString to compute negated value correctly. llvm-svn: 34629
-
Reid Spencer authored
This makes it much more efficient. llvm-svn: 34618
-
Reid Spencer authored
llvm-svn: 34617
-
Reid Spencer authored
2. Implement the trunc, sext, and zext operations. 3. Improve fromString to accept negative values as input. llvm-svn: 34616
-
- Feb 25, 2007
-
-
Reid Spencer authored
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() method in order to not depend on undefined behavior of the >> operator when the number of bits shifted equals the word size. 4. Reduced # of loc by using the new result of clearUnusedBits() method. 5. Simplified logic (decreased indentation) in a few places. 6. Added code comments to larger functions that needed them. 7. Added FIXME notes about weak implementations of things (e.g. bit-by-bit shift right is sub-optimal). llvm-svn: 34603
-
Reid Spencer authored
llvm-svn: 34581
-
Chris Lattner authored
llvm-svn: 34571
-
Reid Spencer authored
Handle the single word cases for shiftAmt == BitWidth. llvm-svn: 34569
-
Reid Spencer authored
llvm-svn: 34565
-
Reid Spencer authored
llvm-svn: 34564
-
- Feb 24, 2007
-
-
Reid Spencer authored
llvm-svn: 34562
-
Reid Spencer authored
2. Fix shl when shiftAmount == BitWidth. llvm-svn: 34560
-
Reid Spencer authored
2. Clean up comments, style, coding standards, etc. 3. Simplify a constructor. Extended testing revealed some additional bugs in shifting. I'll fix these tomorrow. llvm-svn: 34559
-
Reid Spencer authored
to be safe. 2. Make internal functions that return a carry/borrow return bool instead of uint64_t because the carry/borrow can only be in range [0,1]. 3. Assert that the pointers to KnuthDiv are all different so that the result and operands can't overlap. 4. Add debug output to KnuthDiv function. 5. Fix a problem with KnuthDiv by separating the b's complement operation from the subtraction borrow operation. This fixes a wide range of division problems, but alas, not all of them. llvm-svn: 34554
-
Chris Lattner authored
llvm-svn: 34549
-
- Feb 23, 2007
-
-
Chris Lattner authored
llvm-svn: 34539
-
Reid Spencer authored
memory (as done in fromString). 2. Implement Knuth divide more closely to what is recommended in his book. 3. Fix computation of the remainder for Knuth Divide (bad shifting). 4. Remove some cruft from the file llvm-svn: 34518
-
- Feb 22, 2007
-
-
Reid Spencer authored
extract the value, not the number of words implied by the active bits. This fixes numerous, but not all divide bugs. llvm-svn: 34484
-
Reid Spencer authored
word size. This fixes all reads of uninitialized data (buffer over read) and makes APInt.cpp memory clean, per valgrind. The only remaining problem is division in a few cases. llvm-svn: 34483
-
- Feb 21, 2007
-
-
Reid Spencer authored
reads, and reduce the number of temporary APInt instances we construct. llvm-svn: 34467
-
Reid Spencer authored
llvm-svn: 34465
-
Reid Spencer authored
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 to use a simpler but correct algorithm and also to not set the bit width contrary to the user's request. 5. Optimize toString a bit by making it only do one Knuth divide per iteration instead of two. With these changes, all arithmetic passes (verified by pari/GP) up to 1024 bits except for certain division cases. llvm-svn: 34463
-
Reid Spencer authored
Fix toString to correctly return "0" for zero valued APInts over 128 bits. llvm-svn: 34459
-
Reid Spencer authored
functions more. llvm-svn: 34458
-