]> git.sesse.net Git - stockfish/commit - src/types.h
Clarify the mapping of files to queenside
authornickpelling <nickpelling@nickpelling.com>
Sat, 21 Sep 2019 07:59:32 +0000 (08:59 +0100)
committerStéphane Nicolet <cassio@free.fr>
Tue, 24 Sep 2019 08:05:54 +0000 (10:05 +0200)
commitd232a4ae684eccd829fd703a1872c1e0e17aaee9
treed01ca59f242c0aa37058ee6b3fed805653c0501b
parentdefa1ccaa9c145b0ccff38a1ae660c052d753e81
Clarify the mapping of files to queenside

This patch replaces the obscure expressions mapping files ABCDEFGH to ABCDDCBA
by explicite calls to an auxiliary function:

  old:   f = min(f, ~f)
  new:   f = map_to_queenside(f)

We used the Golbolt web site (https://godbolt.org) to check that the current
code for the auxiliary function is optimal.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 30292 W: 6756 L: 6651 D: 16885
http://tests.stockfishchess.org/tests/view/5d8676720ebc5971531d6aa1

Achieved with a bit of help from Sopel97, snicolet and vondele, thanks everyone!
Closes https://github.com/official-stockfish/Stockfish/pull/2325

No functional change
AUTHORS
src/evaluate.cpp
src/pawns.cpp
src/psqt.cpp
src/types.h