Skip to content

Commit

Permalink
Use Bitboard over Square in movegen
Browse files Browse the repository at this point in the history
It uses pos.checkers() on target when movegen is the type of EVASION.
It simplify the code. And it's also expected a slightly speed up,
because Bitboard is more direct when doing bitwise.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 28176 W: 2506 L: 2437 D: 23233
Ptnml(0-2): 80, 1904, 10063, 1949, 92
https://tests.stockfishchess.org/tests/view/60421d18ddcba5f0627bb6a9

Passed LTC:
LLR: 2.93 (-2.94,2.94) {-0.75,0.25}
Total: 9704 W: 402 L: 341 D: 8961
Ptnml(0-2): 3, 279, 4230, 334, 6
https://tests.stockfishchess.org/tests/view/60422823ddcba5f0627bb6ae

closes official-stockfish#3383

No functional change
  • Loading branch information
BM123499 authored and Fanael committed Mar 10, 2021
1 parent 42b44ee commit 5118c15
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/movegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,8 @@ namespace {
target = ~pos.pieces();
break;
case EVASIONS:
{
Square checksq = lsb(pos.checkers());
target = between_bb(pos.square<KING>(Us), checksq) | checksq;
target = between_bb(pos.square<KING>(Us), lsb(pos.checkers())) | pos.checkers();
break;
}
case NON_EVASIONS:
target = ~pos.pieces(Us);
break;
Expand Down

0 comments on commit 5118c15

Please sign in to comment.