History log of /llvm-project/llvm/lib/Support/APInt.cpp (Results 376 – 400 of 434)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 91d3b3fc 28-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Make the trunc/sext/zext methods return APInt& so that these operations
can be chained together with other operations.

llvm-svn: 34743


# 66d0d572 28-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits
instead of honoring the client's requested bit width.

llvm-svn: 34712


# c2d433d4 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Join two lines that can be joined.

llvm-svn: 34705


# 31acef50 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

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. 0x1800000000000000 could be

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. 0x1800000000000000 could be just 0x8000000000000000

llvm-svn: 34695

show more ...


# 70cb5d42 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

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

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 simple.
3. Simplify sdiv and srem code.

llvm-svn: 34680

show more ...


# 997d9e45 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Conform to single person attribution in file comment.

llvm-svn: 34678


# 54abdcf3 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

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.

llvm-svn: 34673


# 01165174 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Get rid of extraneous // in file comment.

llvm-svn: 34662


# 974551a7 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Simplify and document RoundDoubleToAPInt.

llvm-svn: 34648


# 7c16cd27 26-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

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 t

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 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

show more ...


# b2bc985a 26-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Implement the getHashValue method.
Fix toString use of getValue to use getZExtValue()

llvm-svn: 34642


# f09418d4 26-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Re-enable this. The header was committed.

llvm-svn: 34634


# d9fc2680 26-Feb-2007 Chris Lattner <sabre@nondot.org>

another missing header :( :( :(

llvm-svn: 34632


# aa8dcfe4 26-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

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 inst

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 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

show more ...


# 44eef169 26-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Rewrite lshr to not do bit by bit copy but to copy and shift whole words.
This makes it much more efficient.

llvm-svn: 34618


# fb55b7b9 25-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Fix sext operation. Shifting by zero would leave an incorrect mask.

llvm-svn: 34617


# b6b5cc3e 25-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

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.

llvm-svn: 34616


# a41e93be 25-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

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
clearUnusedBit

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() 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

show more ...


# 28555779 25-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Allow this to compile now that the header file is checked in.

llvm-svn: 34581


# 4ae31ba8 25-Feb-2007 Chris Lattner <sabre@nondot.org>

this doesn't compile, disable it

llvm-svn: 34571


# 522ca7cd 25-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Clean up lshr and ashr to coding standards.
Handle the single word cases for shiftAmt == BitWidth.

llvm-svn: 34569


# ab0e08ae 25-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Whoops, last word with bits in large shift left wasn't correct.

llvm-svn: 34565


# a5c84d95 25-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Fix the > 64 bits case for left shift.

llvm-svn: 34564


# 468ad911 24-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

Fix the remainder shifting in KnuthDiv.

llvm-svn: 34562


# 632ebdf8 24-Feb-2007 Reid Spencer <rspencer@reidspencer.com>

1. Fix a bug in fromString for the <= 64bits case
2. Fix shl when shiftAmount == BitWidth.

llvm-svn: 34560


1...<<1112131415161718