From: protonspring Date: Sat, 21 Jul 2018 06:17:27 +0000 (-0600) Subject: simplified forward ranks. X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=af1ddfd83b59a98f7f23f75419f0492fc7e2e85f simplified forward ranks. This is a non-functional simplification. We change replaces an 'OR' and a lookup (rank_bb(ksq)) with a bitwise ~. This is fewer operations and is probably faster. STC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 25441 W: 5689 L: 5575 D: 14177 http://tests.stockfishchess.org/tests/view/5b52d05a0ebc5902bdb8010e LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 26904 W: 4664 L: 4553 D: 17687 http://tests.stockfishchess.org/tests/view/5b543df70ebc5902bdb8212d No functional change. --- diff --git a/src/pawns.cpp b/src/pawns.cpp index 55462bcf..761d770e 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -208,7 +208,7 @@ Value Entry::evaluate_shelter(const Position& pos, Square ksq) { constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH); constexpr Bitboard BlockRanks = (Us == WHITE ? Rank1BB | Rank2BB : Rank8BB | Rank7BB); - Bitboard b = pos.pieces(PAWN) & (forward_ranks_bb(Us, ksq) | rank_bb(ksq)); + Bitboard b = pos.pieces(PAWN) & ~forward_ranks_bb(Them, ksq); Bitboard ourPawns = b & pos.pieces(Us); Bitboard theirPawns = b & pos.pieces(Them);