X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=0064fb26d83bf42decc3db7d9eb3102b47e4ce8a;hp=d5c16a919006f75caf3ddd44ae0c406c3a5440dc;hb=5d79af9e0d466572217dc47f5c307f6fd382a646;hpb=a87ea9846d4adc8d2ed8107c072c43b5ef53e4fe diff --git a/src/bitboard.h b/src/bitboard.h index d5c16a91..0064fb26 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -22,25 +22,6 @@ #if !defined(BITBOARD_H_INCLUDED) #define BITBOARD_H_INCLUDED -//// -//// Defines -//// - -// Quiet a warning on Intel compiler -#if !defined(__SIZEOF_INT__ ) -#define __SIZEOF_INT__ 0 -#endif - -// Check for 64 bits for different compilers: Intel, MSVC and gcc -#if defined(__x86_64) || defined(_WIN64) || (__SIZEOF_INT__ > 4) -#define IS_64BIT -#endif - -#if defined(IS_64BIT) && (defined(__GNUC__) || defined(__INTEL_COMPILER)) -#define USE_BSFQ -#endif - - //// //// Includes //// @@ -51,13 +32,6 @@ #include "types.h" -//// -//// Types -//// - -typedef uint64_t Bitboard; - - //// //// Constants and variables //// @@ -132,13 +106,6 @@ const Bitboard InFrontBB[2][8] = { } }; -const int BitTable[64] = { - 63, 30, 3, 32, 25, 41, 22, 33, 15, 50, 42, 13, 11, 53, 19, 34, 61, 29, 2, - 51, 21, 43, 45, 10, 18, 47, 1, 54, 9, 57, 0, 35, 62, 31, 40, 4, 49, 5, 52, - 26, 60, 6, 23, 44, 46, 27, 56, 16, 7, 39, 48, 24, 59, 14, 12, 55, 38, 28, - 58, 20, 37, 17, 36, 8 -}; - extern Bitboard SetMaskBB[65]; extern Bitboard ClearMaskBB[65]; @@ -407,12 +374,7 @@ inline Square __attribute__((always_inline)) pop_1st_bit(Bitboard* b) { #else // if !defined(USE_BSFQ) -inline Square first_1(Bitboard b) { - b ^= (b - 1); - uint32_t fold = int(b) ^ int(b >> 32); - return Square(BitTable[(fold * 0x783a9b23) >> 26]); -} - +extern Square first_1(Bitboard b); extern Square pop_1st_bit(Bitboard* b); #endif