]> git.sesse.net Git - stockfish/commitdiff
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)
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.


No differences found