Skip to content

Commit b742746

Browse files
BM123499vondele
authored andcommitted
Use Bitboard over Square in movegen
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 #3383 No functional change
1 parent 5346f1c commit b742746

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/movegen.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,8 @@ namespace {
223223
target = ~pos.pieces();
224224
break;
225225
case EVASIONS:
226-
{
227-
Square checksq = lsb(pos.checkers());
228-
target = between_bb(pos.square<KING>(Us), checksq) | checksq;
226+
target = between_bb(pos.square<KING>(Us), lsb(pos.checkers())) | pos.checkers();
229227
break;
230-
}
231228
case NON_EVASIONS:
232229
target = ~pos.pieces(Us);
233230
break;

0 commit comments

Comments
 (0)