mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 13:17:44 +00:00
Micro-optimze extension()
Explicitly write the conditions for pawn to 7th and passed pawn instead of wrapping in redundant helpers. Also retire the now unused move_is_pawn_push_to_7th() and the never used move_was_passed_pawn_push() and move_is_deep_pawn_push() Function extension() is so time critical that this simple patch speeds up the pgo compile of 0.5% and it is also more clear what actually happens there. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+3
-2
@@ -2267,12 +2267,13 @@ namespace {
|
||||
|
||||
if (pos.type_of_piece_on(move_from(m)) == PAWN)
|
||||
{
|
||||
if (pos.move_is_pawn_push_to_7th(m))
|
||||
Color c = pos.side_to_move();
|
||||
if (relative_rank(c, move_to(m)) == RANK_7)
|
||||
{
|
||||
result += PawnPushTo7thExtension[pvNode];
|
||||
*dangerous = true;
|
||||
}
|
||||
if (pos.move_is_passed_pawn_push(m))
|
||||
if (pos.pawn_is_passed(c, move_to(m)))
|
||||
{
|
||||
result += PassedPawnExtension[pvNode];
|
||||
*dangerous = true;
|
||||
|
||||
Reference in New Issue
Block a user