mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Add a static APInt::getNumWords
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68977 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
48c7fa21a3
commit
17893a5fb6
@ -1000,6 +1000,14 @@ public:
|
||||
/// @returns the number of words to hold the integer value of this APInt.
|
||||
/// @brief Get the number of words.
|
||||
unsigned getNumWords() const {
|
||||
return getNumWords(BitWidth);
|
||||
}
|
||||
|
||||
/// Here one word's bitwidth equals to that of uint64_t.
|
||||
/// @returns the number of words to hold the integer value with a
|
||||
/// given bit width.
|
||||
/// @brief Get the number of words.
|
||||
static unsigned getNumWords(unsigned BitWidth) {
|
||||
return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user