1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 17:49:35 +00:00

Fix compile on 64 bits

Reported by Quocvuong82.

No functional change.
This commit is contained in:
Marco Costalba 2012-09-20 19:25:27 +02:00
parent e4a0482e43
commit 09acdac56b

View file

@ -72,14 +72,8 @@ namespace {
void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[], void init_magics(Bitboard table[], Bitboard* attacks[], Bitboard magics[],
Bitboard masks[], unsigned shifts[], Square deltas[], Fn index); Bitboard masks[], unsigned shifts[], Square deltas[], Fn index);
}
/// lsb()/msb() finds the least/most significant bit in a nonzero bitboard. FORCE_INLINE unsigned bsf_index(Bitboard b) {
/// pop_lsb() finds and clears the least significant bit in a nonzero bitboard.
#if !defined(USE_BSFQ)
FORCE_INLINE unsigned bsf_index(Bitboard b) {
if (Is64Bit) if (Is64Bit)
return ((b & -b) * DeBruijn_64) >> 58; return ((b & -b) * DeBruijn_64) >> 58;
@ -87,8 +81,14 @@ FORCE_INLINE unsigned bsf_index(Bitboard b) {
// Use Matt Taylor's folding trick for 32 bit systems // Use Matt Taylor's folding trick for 32 bit systems
b ^= (b - 1); b ^= (b - 1);
return ((unsigned(b) ^ unsigned(b >> 32)) * DeBruijn_32) >> 26; return ((unsigned(b) ^ unsigned(b >> 32)) * DeBruijn_32) >> 26;
}
} }
/// lsb()/msb() finds the least/most significant bit in a nonzero bitboard.
/// pop_lsb() finds and clears the least significant bit in a nonzero bitboard.
#if !defined(USE_BSFQ)
Square lsb(Bitboard b) { return BSFTable[bsf_index(b)]; } Square lsb(Bitboard b) { return BSFTable[bsf_index(b)]; }
Square pop_lsb(Bitboard* b) { Square pop_lsb(Bitboard* b) {