-inline int count_1s_max_15(Bitboard b) {
- unsigned w = unsigned(b >> 32), v = unsigned(b);
- v = v - ((v >> 1) & 0x55555555);
- w = w - ((w >> 1) & 0x55555555);
- v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
- w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
- v = ((v+w) * 0x11111111) >> 28;
- return int(v);
-}
-
-#elif defined(BITCOUNT_SWAR_64)
-
-inline int count_1s(Bitboard b) {
- b -= ((b>>1) & 0x5555555555555555ULL);
- b = ((b>>2) & 0x3333333333333333ULL) + (b & 0x3333333333333333ULL);
- b = ((b>>4) + b) & 0x0F0F0F0F0F0F0F0FULL;
- b *= 0x0101010101010101ULL;
- return int(b >> 56);
-}
-
-inline int count_1s_max_15(Bitboard b) {
- b -= (b>>1) & 0x5555555555555555ULL;
- b = ((b>>2) & 0x3333333333333333ULL) + (b & 0x3333333333333333ULL);
- b *= 0x1111111111111111ULL;
- return int(b >> 60);
-}