prefetching tt for speedup | bench 5829415 #109
No files matched your search
@@ -329,6 +329,9 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear
|
||||
}
|
||||
ctx->positionHistory[copy.positionIndex] = copy.hashKey;
|
||||
ctx->nodes++;
|
||||
|
||||
ctx->TT.PrefetchEntry(copy.hashKey);
|
||||
|
||||
int score = -Quiescence<mode>(copy, -beta, -alpha, ply + 1, ctx).score;
|
||||
|
||||
if (score >= beta) {
|
||||
@@ -430,6 +433,8 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
||||
|
||||
const int reduction = 4 + improving + depth / 3;
|
||||
|
||||
ctx->TT.PrefetchEntry(copy.hashKey);
|
||||
|
||||
ctx->doingNullMove = true;
|
||||
int score = -PVS<false, mode>(copy, depth - reduction, -beta, -beta + 1, ply + 1, ctx, !cutnode).score;
|
||||
ctx->doingNullMove = false;
|
||||
@@ -508,6 +513,8 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
||||
ctx->positionHistory[copy.positionIndex] = copy.hashKey;
|
||||
ctx->nodes++;
|
||||
|
||||
ctx->TT.PrefetchEntry(copy.hashKey);
|
||||
|
||||
int extension = 0;
|
||||
|
||||
if (ply
|
||||
|
||||
@@ -61,6 +61,10 @@ public:
|
||||
table.resize(size);
|
||||
}
|
||||
|
||||
void PrefetchEntry(U64 &hashKey) {
|
||||
__builtin_prefetch(&table[hashKey % table.size()]);
|
||||
}
|
||||
|
||||
TTEntry GetRawEntry(U64 &hashKey) {
|
||||
TTEntry *current = &table[hashKey % table.size()];
|
||||
return *current;
|
||||
|
||||
Reference in new issue
Block a user