]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Prefetch pawn hash key
[stockfish] / src / position.cpp
index b7272645a3914e896ab7a0ede8311bd04ed2307b..10f0d8742d228a3d205a14ec087f6f28f66c5e3f 100644 (file)
@@ -71,10 +71,16 @@ struct PieceLetters : std::map<char, Piece> {
     }
 };
 
+
 ////
-//// Variables
+//// Constants and variables
 ////
 
+/// Bonus for having the side to move (modified by Joona Kiiski)
+
+static const Score TempoValue = make_score(48, 22);
+
+
 Key Position::zobrist[2][8][64];
 Key Position::zobEp[64];
 Key Position::zobCastle[16];
@@ -839,8 +845,9 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
       // Reset rule 50 draw counter
       st->rule50 = 0;
 
-      // Update pawn hash key
+      // Update pawn hash key and prefetch in L1/L2 cache
       st->pawnKey ^= zobrist[us][PAWN][from] ^ zobrist[us][PAWN][to];
+      prefetchPawn(st->pawnKey, threadID);
 
       // Set en passant square, only if moved pawn can be captured
       if ((to ^ from) == 16)