mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Restore MS1BTable[]
Incredible typo from my side! The 2 tables are completely different, one counts 1s the other returns the msb position. Even more incredible the 'stockfish bench' command returns the same number of nodes!!! Spotted by Justin Blanchard. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
d6e3a40c81
commit
76622342ec
1 changed files with 6 additions and 1 deletions
|
@ -58,6 +58,7 @@ namespace {
|
|||
CACHE_LINE_ALIGNMENT
|
||||
|
||||
int BSFTable[64];
|
||||
int MS1BTable[256];
|
||||
Bitboard RTable[0x19000]; // Storage space for rook attacks
|
||||
Bitboard BTable[0x1480]; // Storage space for bishop attacks
|
||||
|
||||
|
@ -160,7 +161,7 @@ Square last_1(Bitboard b) {
|
|||
result += 8;
|
||||
}
|
||||
|
||||
return Square(result + BitCount8Bit[b]);
|
||||
return Square(result + MS1BTable[b]);
|
||||
}
|
||||
|
||||
#endif // !defined(USE_BSFQ)
|
||||
|
@ -170,6 +171,10 @@ Square last_1(Bitboard b) {
|
|||
|
||||
void bitboards_init() {
|
||||
|
||||
for (int k = 0, i = 0; i < 8; i++)
|
||||
while (k < (2 << i))
|
||||
MS1BTable[k++] = i;
|
||||
|
||||
for (Bitboard b = 0; b < 256; b++)
|
||||
BitCount8Bit[b] = (uint8_t)popcount<Max15>(b);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue