1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Prefetch earlier in qsearch()

Closes #1139
This commit is contained in:
snicolet 2017-06-16 19:52:38 -07:00 committed by Joona Kiiski
parent 27ba611a3d
commit b73016bb41

View file

@ -1256,6 +1256,9 @@ moves_loop: // When in check search starts from here
{
assert(is_ok(move));
// Speculative prefetch as early as possible
prefetch(TT.first_entry(pos.key_after(move)));
givesCheck = type_of(move) == NORMAL && !pos.discovered_check_candidates()
? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move)
: pos.gives_check(move);
@ -1297,9 +1300,6 @@ moves_loop: // When in check search starts from here
&& !pos.see_ge(move))
continue;
// Speculative prefetch as early as possible
prefetch(TT.first_entry(pos.key_after(move)));
// Check for legality just before making the move
if (!pos.legal(move))
{