mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 07:27:46 +00:00
Simplify move legality check for uncommon cases
Remove a bunch of difficult and tricky code to test legality of castle and ep moves and instead use a slower but simpler check against the list of generated legal moves. Because these moves are very rare the performance impact is small but code semplification is ver big: almost 100 lines of difficult code removed ! No functionality change. No performance change (strangely enough there is no even minimal performance regression in pgo builds but instead a slightly and unexpected increase). Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ extern MoveStack* generate_captures(const Position& pos, MoveStack* mlist);
|
||||
extern MoveStack* generate_noncaptures(const Position& pos, MoveStack* mlist);
|
||||
extern MoveStack* generate_non_capture_checks(const Position& pos, MoveStack* mlist, Bitboard dc);
|
||||
extern MoveStack* generate_evasions(const Position& pos, MoveStack* mlist, Bitboard pinned);
|
||||
extern MoveStack* generate_legal_moves(const Position& pos, MoveStack* mlist);
|
||||
extern MoveStack* generate_moves(const Position& pos, MoveStack* mlist, bool pseudoLegal = false);
|
||||
extern bool move_is_legal(const Position& pos, const Move m, Bitboard pinned);
|
||||
extern bool move_is_legal(const Position& pos, const Move m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user