until know I am using my own bitcount-methods:
A) for few bits:
Code: Select all
char _bitcnt(u64 bit) {
char c = 0;
while (bit) { bit &= (bit - 1); c++; }
return c;
}
Code: Select all
char bitcnt (u64 n) {
return BITC[LOW16(n)]
+ BITC[LOW16(n >> 16)]
+ BITC[LOW16(n >> 32)]
+ BITC[LOW16(n >> 48)];
}
Code: Select all
__builtin_popcountll()
1) There is no hardware support.
2) The compiler doesn't use hardware support.
3) The hardware popcount isn't that fast.
Who can help with answers?
