mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Remove two popcount patterns which we are already able to recognize.
llvm-svn: 170158
This commit is contained in:
parent
9e2542c0cb
commit
6dd1fc357c
@ -262,22 +262,7 @@ unsigned countbits_slow(unsigned v) {
|
||||
c += v & 1;
|
||||
return c;
|
||||
}
|
||||
unsigned countbits_fast(unsigned v){
|
||||
unsigned c;
|
||||
for (c = 0; v; c++)
|
||||
v &= v - 1; // clear the least significant bit set
|
||||
return c;
|
||||
}
|
||||
|
||||
BITBOARD = unsigned long long
|
||||
int PopCnt(register BITBOARD a) {
|
||||
register int c=0;
|
||||
while(a) {
|
||||
c++;
|
||||
a &= a - 1;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
unsigned int popcount(unsigned int input) {
|
||||
unsigned int count = 0;
|
||||
for (unsigned int i = 0; i < 4 * 8; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user