]> git.sesse.net Git - stockfish/commit
Speedup and simplify pinners and blockers
authorMarco Costalba <mcostalba@gmail.com>
Tue, 27 Feb 2018 00:18:33 +0000 (01:18 +0100)
committerStéphane Nicolet <cassio@free.fr>
Tue, 27 Feb 2018 00:19:06 +0000 (01:19 +0100)
commitad2a0e356e395038a08324f9ff0afee7fc98b8e9
tree0d32e961e304eac1291306c255a5995d74c0ee43
parentd438720a1c8115485ff47eeca3b734cd681d01c4
Speedup and simplify pinners and blockers

To compute dicovered check or pinned pieces we use some bitwise
operators that are not really needed because already accounted for
at the caller site.

For instance in evaluation we compute:

     pos.pinned_pieces(Us) & s

Where pinned_pieces() is:

     st->blockersForKing[c] & pieces(c)

So in this case the & operator with pieces(c) is useless,
given the outer '& s'.

There are many places where we can use the naked blockersForKing[]
instead of the full pinned_pieces() or discovered_check_candidates().

This path is simpler than original and gives around 1% speed up for me.
Also tested for speed by mstembera and snicolet (neutral in both cases).

No functional change.
src/evaluate.cpp
src/movegen.cpp
src/position.cpp
src/position.h
src/search.cpp