mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Fix compile on 64 bits
Reported by Quocvuong82. No functional change.
This commit is contained in:
parent
e4a0482e43
commit
09acdac56b
1 changed files with 10 additions and 10 deletions
|
@ -72,6 +72,16 @@ namespace {
|
|||
|
||||
void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[],
|
||||
Bitboard masks[], unsigned shifts[], Square deltas[], Fn index);
|
||||
|
||||
FORCE_INLINE unsigned bsf_index(Bitboard b) {
|
||||
|
||||
if (Is64Bit)
|
||||
return ((b & -b) * DeBruijn_64) >> 58;
|
||||
|
||||
// Use Matt Taylor's folding trick for 32 bit systems
|
||||
b ^= (b - 1);
|
||||
return ((unsigned(b) ^ unsigned(b >> 32)) * DeBruijn_32) >> 26;
|
||||
}
|
||||
}
|
||||
|
||||
/// lsb()/msb() finds the least/most significant bit in a nonzero bitboard.
|
||||
|
@ -79,16 +89,6 @@ namespace {
|
|||
|
||||
#if !defined(USE_BSFQ)
|
||||
|
||||
FORCE_INLINE unsigned bsf_index(Bitboard b) {
|
||||
|
||||
if (Is64Bit)
|
||||
return ((b & -b) * DeBruijn_64) >> 58;
|
||||
|
||||
// Use Matt Taylor's folding trick for 32 bit systems
|
||||
b ^= (b - 1);
|
||||
return ((unsigned(b) ^ unsigned(b >> 32)) * DeBruijn_32) >> 26;
|
||||
}
|
||||
|
||||
Square lsb(Bitboard b) { return BSFTable[bsf_index(b)]; }
|
||||
|
||||
Square pop_lsb(Bitboard* b) {
|
||||
|
|
Loading…
Add table
Reference in a new issue