Merge branch 'master' of https://github.com/official-stockfish/Stockfish
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 13 Apr 2019 16:09:25 +0000 (18:09 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 13 Apr 2019 16:09:25 +0000 (18:09 +0200)
bench: 2706246

1  2 
src/pawns.cpp
src/search.cpp

diff --cc src/pawns.cpp
@@@ -89,6 -89,7 +89,7 @@@ namespace 
          assert(pos.piece_on(s) == make_piece(Us, PAWN));
  
          File f = file_of(s);
 -        Rank r = relative_rank(Us, s);
++        Rank r = relative_rank(Us, s, pos.max_rank());
  
          e->semiopenFiles[Us]   &= ~(1 << f);
          e->pawnAttacksSpan[Us] |= pawn_attack_span(Us, s);
          // Flag the pawn
          opposed    = theirPawns & forward_file_bb(Us, s);
          stoppers   = theirPawns & passed_pawn_span(Us, s);
 -        lever      = theirPawns & PawnAttacks[Us][s];
 -        leverPush  = theirPawns & PawnAttacks[Us][s + Up];
 -        doubled    = ourPawns   & (s - Up);
 +        lever      = theirPawns & PseudoAttacks[Us][PAWN][s];
 +        leverPush  = relative_rank(Them, s, pos.max_rank()) > RANK_1 ? theirPawns & PseudoAttacks[Us][PAWN][s + Up] : 0;
-         doubled    = relative_rank(Us, s, pos.max_rank()) > RANK_1 ? ourPawns & (s - Up) : 0;
++        doubled    = r > RANK_1 ? ourPawns & (s - Up) : 0;
          neighbours = ourPawns   & adjacent_files_bb(f);
          phalanx    = neighbours & rank_bb(s);
-         support    = relative_rank(Us, s, pos.max_rank()) > RANK_1 ? neighbours & rank_bb(s - Up) : 0;
 -        support    = neighbours & rank_bb(s - Up);
++        support    = r > RANK_1 ? neighbours & rank_bb(s - Up) : 0;
  
          // A pawn is backward when it is behind all pawns of the same color
          // on the adjacent files and cannot be safely advanced.
              && popcount(phalanx) >= popcount(leverPush))
              e->passedPawns[Us] |= s;
  
 -        else if (stoppers == square_bb(s + Up) && r >= RANK_5)
 +        else if (   relative_rank(Them, s, pos.max_rank()) > RANK_1
 +                 && stoppers == square_bb(s + Up)
-                  && relative_rank(Us, s, pos.max_rank()) >= RANK_5)
++                 && r >= RANK_5)
          {
              b = shift<Up>(support) & ~theirPawns;
              while (b)
diff --cc src/search.cpp
Simple merge