X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=b1422ac67eccb50fefdebde17d7396d01b0542db;hp=8eb0364844a363e5fb33e5a7e55a4d8e26dd739c;hb=eced15fe36a16c38659f586bc558b1175114cc76;hpb=a4d058bca25b65c52b0be063d4c5d2ca50d6a25c diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 8eb03648..b1422ac6 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -702,7 +702,9 @@ namespace { template int evaluate_space(const Position& pos, const EvalInfo& ei) { - const Color Them = (Us == WHITE ? BLACK : WHITE); + const Color Them = (Us == WHITE ? BLACK : WHITE); + const Square Down = (Us == WHITE ? DELTA_S : DELTA_N); + const Square DownDown = (Us == WHITE ? DELTA_SS : DELTA_NN); // Find the safe squares for our pieces inside the area defined by // SpaceMask[]. A square is unsafe if it is attacked by an enemy @@ -714,8 +716,8 @@ namespace { // Find all squares which are at most three squares behind some friendly pawn Bitboard behind = pos.pieces(Us, PAWN); - behind |= (Us == WHITE ? behind >> 8 : behind << 8); - behind |= (Us == WHITE ? behind >> 16 : behind << 16); + behind |= shift_bb< Down>(behind); + behind |= shift_bb(behind); // Since SpaceMask[Us] is fully on our half of the board assert(unsigned(safe >> (Us == WHITE ? 32 : 0)) == 0);