mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Micro optimization in evaluate_pawns()
Avoid a double bitcount in test for candidate passed pawn when we don't have any supporting pawn. Also use outpost_mask() instead of build it up on the fly. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
ea5af9b8c0
commit
9079bab84c
1 changed files with 5 additions and 5 deletions
|
@ -252,12 +252,12 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
|
||||||
backward = (b | (Us == WHITE ? b << 8 : b >> 8)) & theirPawns;
|
backward = (b | (Us == WHITE ? b << 8 : b >> 8)) & theirPawns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(passed | opposed | (outpost_mask(Us, s) & theirPawns));
|
||||||
|
|
||||||
// Test for candidate passed pawn
|
// Test for candidate passed pawn
|
||||||
candidate = !passed
|
candidate = !(opposed | passed)
|
||||||
&& !opposed
|
&& (b = outpost_mask(opposite_color(Us), s + pawn_push(Us)) & ourPawns) != EmptyBoardBB
|
||||||
&& ( count_1s_max_15(neighboring_files_bb(f) & (behind_bb(Us, r) | rank_bb(r)) & ourPawns)
|
&& count_1s_max_15(b) >= count_1s_max_15(outpost_mask(Us, s) & theirPawns);
|
||||||
- count_1s_max_15(neighboring_files_bb(f) & in_front_bb(Us, r) & theirPawns)
|
|
||||||
>= 0);
|
|
||||||
|
|
||||||
// In order to prevent doubled passed pawns from receiving a too big
|
// In order to prevent doubled passed pawns from receiving a too big
|
||||||
// bonus, only the frontmost passed pawn on each file is considered as
|
// bonus, only the frontmost passed pawn on each file is considered as
|
||||||
|
|
Loading…
Add table
Reference in a new issue