Compute pinned and friends incrementally

In do_move() use previous pinned bitboards values to compute
the new one after the move. In particulary we end up with the
same bitboards in most cases. So detect these cases and just
keep the old values.

This should speedup a lot this slow computation in a very hot
path so that we can use this important info everywhere in the
code at very cheap cost.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-02-28 09:18:29 +01:00
parent 55f9afee2a
commit f9f30412e7
2 changed files with 73 additions and 32 deletions

View File

@@ -295,7 +295,6 @@ private:
void allow_ooo(Color c);
// Helper functions for doing and undoing moves
void init_new_state(StateInfo& newSt);
void do_capture_move(Move m, PieceType capture, Color them, Square to);
void do_castle_move(Move m);
void do_promotion_move(Move m);
@@ -304,7 +303,9 @@ private:
void undo_promotion_move(Move m);
void undo_ep_move(Move m);
void find_checkers();
void find_pinned();
void find_hidden_checks(Color us);
void find_hidden_checks();
void update_hidden_checks(Square from, Square to);
template<PieceType Piece>
void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates);