mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 01:11:44 +00:00
APInt: Simplify code. No functionality change.
llvm-svn: 183073
This commit is contained in:
parent
0116e00b91
commit
f7427d954c
@ -2304,24 +2304,7 @@ namespace {
|
||||
static unsigned int
|
||||
partMSB(integerPart value)
|
||||
{
|
||||
unsigned int n, msb;
|
||||
|
||||
if (value == 0)
|
||||
return -1U;
|
||||
|
||||
n = integerPartWidth / 2;
|
||||
|
||||
msb = 0;
|
||||
do {
|
||||
if (value >> n) {
|
||||
value >>= n;
|
||||
msb += n;
|
||||
}
|
||||
|
||||
n >>= 1;
|
||||
} while (n);
|
||||
|
||||
return msb;
|
||||
return findLastSet(value, ZB_Max);
|
||||
}
|
||||
|
||||
/* Returns the bit number of the least significant set bit of a
|
||||
@ -2329,24 +2312,7 @@ namespace {
|
||||
static unsigned int
|
||||
partLSB(integerPart value)
|
||||
{
|
||||
unsigned int n, lsb;
|
||||
|
||||
if (value == 0)
|
||||
return -1U;
|
||||
|
||||
lsb = integerPartWidth - 1;
|
||||
n = integerPartWidth / 2;
|
||||
|
||||
do {
|
||||
if (value << n) {
|
||||
value <<= n;
|
||||
lsb -= n;
|
||||
}
|
||||
|
||||
n >>= 1;
|
||||
} while (n);
|
||||
|
||||
return lsb;
|
||||
return findFirstSet(value, ZB_Max);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user