}
-////
-//// Functions
-////
-
+/// prefetchTables() is called in do_move() to prefetch pawn and material
+/// hash tables data that will be needed shortly after in evaluation.
-/// Prefetches in pawn hash tables
+void prefetchTables(Key pKey, Key mKey, int threadID) {
-void prefetchPawn(Key key, int threadID) {
-
- PawnTable[threadID]->prefetch(key);
+ PawnTable[threadID]->prefetch(pKey);
+ MaterialTable[threadID]->prefetch(mKey);
}
assert(eg_value(v) > -VALUE_INFINITE && eg_value(v) < VALUE_INFINITE);
assert(ph >= PHASE_ENDGAME && ph <= PHASE_MIDGAME);
- Value eg = eg_value(v);
- Value ev = Value((eg * int(sf)) / SCALE_FACTOR_NORMAL);
-
+ int ev = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL;
int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128;
return Value((result + GrainSize / 2) & ~(GrainSize - 1));
}