-#define POPCNT_INTRINSIC(x) _mm_popcnt_u64(x)
-
-#else // Safe fallback for unsupported compilers
-
-inline bool cpu_has_popcnt() { return false; }
-
-#define POPCNT_INTRINSIC(x) sw_count_1s(x)
-
-#endif
-
-
-/// Software implementation of bit count functions
-
-#if defined(BITCOUNT_LOOP)
-
-inline int sw_count_1s(Bitboard b) {
- int r;
- for(r = 0; b; r++, b &= b - 1);
- return r;
-}
-
-inline int sw_count_1s_max_15(Bitboard b) {
- return count_1s(b);
-}
-
-#elif defined(BITCOUNT_SWAR_32)
-
-inline int sw_count_1s(Bitboard b) {