Consolidate all attacks bitboards
authorprotonspring <mike@whiteley.org>
Thu, 28 May 2020 15:48:31 +0000 (09:48 -0600)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 30 May 2020 18:30:31 +0000 (20:30 +0200)
commita5e3b4eddede900c1df610e8e25026a79d706500
tree45de90d49a128c6593167cb293964322537f8f19
parentfb8095718bd0789d2743fa6216c6aa522555dc4b
Consolidate all attacks bitboards

This is a non-functional simplification that simplifies getting attacks bitboards.

* consolidates all attacks to attacks_bb (remove Position::attacks_from(..)).
* attacks_bb<PieceType>(square) gets pseudo attacks
* attacks_bb<PieceType>(square, bitboard) gets attacks considering occupied squares in the bitboard).
* pawn_attacks_bb(Color, Square) gets pawn attacks like other pawn attack bitboards.
* Wraps all access to PawnAttacks arrays and PseudoAttacks arrays and adds asserts as appropriate.

Passed STC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 90208 W: 17533 L: 17482 D: 55193
Ptnml(0-2): 1412, 10232, 21798, 10217, 1445
https://tests.stockfishchess.org/tests/view/5ece996275787cc0c05d9790

closes https://github.com/official-stockfish/Stockfish/pull/2703

No functional change
src/bitbase.cpp
src/bitboard.h
src/endgame.cpp
src/evaluate.cpp
src/movegen.cpp
src/pawns.cpp
src/position.cpp
src/position.h