}
-////
-//// Functions
-////
-
-
-/// Prefetches in pawn hash tables
+/// prefetchTables() is called in do_move() to prefetch pawn and material
+/// hash tables data that will be needed shortly after in evaluation.
-void prefetchPawn(Key key, int threadID) {
+void prefetchTables(Key pKey, Key mKey, int threadID) {
- PawnTable[threadID]->prefetch(key);
+ PawnTable[threadID]->prefetch(pKey);
+ MaterialTable[threadID]->prefetch(mKey);
}
extern int cpu_count();
extern int input_available();
extern void prefetch(char* addr);
-extern void prefetchPawn(Key, int);
+extern void prefetchTables(Key pKey, Key mKey, int threadID);
// Debug functions
extern bool dbg_show_mean;
// 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)
}
}
+ // Prefetch pawn and material hash tables
+ prefetchTables(st->pawnKey, st->materialKey, threadID);
+
// Update incremental scores
st->value += pst_delta(piece, from, to);