Skip to content

Added APInt::clearBits() method #136550 #136557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions llvm/include/llvm/ADT/APInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,12 @@ class [[nodiscard]] APInt {
/// Clear the given bit of a bignum. Zero-based.
static void tcClearBit(WordType *, unsigned bit);

/// Set the bits from loBit (inclusive) to hiBit (exclusive) to 0.
/// This function handles "high" bits correctly (i.e. hiBit can be bigger than
/// the bit width of the APInt - in which case all bits from loBit to the end
/// of the APInt are zeroed).
void clearBits(unsigned loBit, unsigned hiBit);

/// Returns the bit number of the least or most significant set bit of a
/// number. If the input number has no bits set -1U is returned.
static unsigned tcLSB(const WordType *, unsigned n);
Expand Down
Loading