mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
[block-freq] Add the APInt method extractBit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -607,6 +607,14 @@ void APInt::flipBit(unsigned bitPosition) {
|
||||
else setBit(bitPosition);
|
||||
}
|
||||
|
||||
bool APInt::extractBit(unsigned bitPosition) const {
|
||||
assert(bitPosition < BitWidth && "Out of the bit-width range!");
|
||||
if (isSingleWord())
|
||||
return VAL & maskBit(bitPosition);
|
||||
else
|
||||
return pVal[whichWord(bitPosition)] & maskBit(bitPosition);
|
||||
}
|
||||
|
||||
unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) {
|
||||
assert(!str.empty() && "Invalid string length");
|
||||
assert((radix == 10 || radix == 8 || radix == 16 || radix == 2 ||
|
||||
|
Reference in New Issue
Block a user