mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Simplify APInt::getAllOnesValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120911 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3069cbf7b3
commit
bd7d2622a2
@ -379,15 +379,12 @@ public:
|
|||||||
/// @{
|
/// @{
|
||||||
/// @brief Gets maximum unsigned value of APInt for specific bit width.
|
/// @brief Gets maximum unsigned value of APInt for specific bit width.
|
||||||
static APInt getMaxValue(unsigned numBits) {
|
static APInt getMaxValue(unsigned numBits) {
|
||||||
APInt API(numBits, 0);
|
return getAllOnesValue(numBits);
|
||||||
API.setAllBits();
|
|
||||||
return API;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Gets maximum signed value of APInt for a specific bit width.
|
/// @brief Gets maximum signed value of APInt for a specific bit width.
|
||||||
static APInt getSignedMaxValue(unsigned numBits) {
|
static APInt getSignedMaxValue(unsigned numBits) {
|
||||||
APInt API(numBits, 0);
|
APInt API = getAllOnesValue(numBits);
|
||||||
API.setAllBits();
|
|
||||||
API.clearBit(numBits - 1);
|
API.clearBit(numBits - 1);
|
||||||
return API;
|
return API;
|
||||||
}
|
}
|
||||||
@ -414,9 +411,7 @@ public:
|
|||||||
/// @returns the all-ones value for an APInt of the specified bit-width.
|
/// @returns the all-ones value for an APInt of the specified bit-width.
|
||||||
/// @brief Get the all-ones value.
|
/// @brief Get the all-ones value.
|
||||||
static APInt getAllOnesValue(unsigned numBits) {
|
static APInt getAllOnesValue(unsigned numBits) {
|
||||||
APInt API(numBits, 0);
|
return APInt(numBits, -1ULL, true);
|
||||||
API.setAllBits();
|
|
||||||
return API;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @returns the '0' value for an APInt of the specified bit-width.
|
/// @returns the '0' value for an APInt of the specified bit-width.
|
||||||
|
Loading…
Reference in New Issue
Block a user