Determine opposite colors mathematically
authorprotonspring <mike@whiteley.org>
Mon, 23 Dec 2019 17:58:30 +0000 (10:58 -0700)
committerStéphane Nicolet <cassio@free.fr>
Thu, 23 Jan 2020 16:59:03 +0000 (17:59 +0100)
commitf3c83ed46cdc2062c30551f457ac53ad635794ea
tree545bdff8303d51b43ecbe328763eb75a8a947b31
parent75dfdeac119d0ce71c36ba5ab4f33318f589b158
Determine opposite colors mathematically

This is a non-functional speed-up: master has to access SquareBB twice while this patch
determines opposite_colors just using the values of the squares. It doesn't seem to change
the overall speed of bench, but calling opposite_colors(...) 10 Million times:

master: 39.4 seconds
patch: 11.4 seconds.

The only data point I have (other than my own tests), is a quite old failed STC test:
LLR: -2.93 (-2.94,2.94) [-1.50,4.50]
Total: 24308 W: 5331 L: 5330 D: 13647
Ptnml(0-2): 315, 2577, 6326, 2623, 289
http://tests.stockfishchess.org/tests/view/5e010256c13ac2425c4a9a67

Closes https://github.com/official-stockfish/Stockfish/pull/2498

No functional change
src/bitboard.h