mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 16:46:30 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user