- typedef unsigned (Fn)(Square, Bitboard);
-
- void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[],
- Bitboard masks[], unsigned shifts[], Square deltas[], Fn index);
-
- // bsf_index() returns the index into BSFTable[] to look up the bitscan. Uses
- // Matt Taylor's folding for 32 bit case, extended to 64 bit by Kim Walisch.
-
- FORCE_INLINE unsigned bsf_index(Bitboard b) {
- b ^= b - 1;
- return Is64Bit ? (b * DeBruijn64) >> 58
- : ((unsigned(b) ^ unsigned(b >> 32)) * DeBruijn32) >> 26;
- }
-}
-
-#ifndef USE_BSFQ
-
-/// Software fall-back of lsb() and msb() for CPU lacking hardware support
-
-Square lsb(Bitboard b) {
- return BSFTable[bsf_index(b)];