prefetching tt for speedup | bench 5829415
This commit is contained in:
1 parent
ca51e59dd9
commit
9d26dc028d
2 files changed
+11
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->positionHistory[copy.positionIndex] = copy.hashKey;
|
||||||
ctx->nodes++;
|
ctx->nodes++;
|
||||||
|
|
||||||
|
ctx->TT.PrefetchEntry(copy.hashKey);
|
||||||
|
|
||||||
int score = -Quiescence<mode>(copy, -beta, -alpha, ply + 1, ctx).score;
|
int score = -Quiescence<mode>(copy, -beta, -alpha, ply + 1, ctx).score;
|
||||||
|
|
||||||
if (score >= beta) {
|
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;
|
const int reduction = 4 + improving + depth / 3;
|
||||||
|
|
||||||
|
ctx->TT.PrefetchEntry(copy.hashKey);
|
||||||
|
|
||||||
ctx->doingNullMove = true;
|
ctx->doingNullMove = true;
|
||||||
int score = -PVS<false, mode>(copy, depth - reduction, -beta, -beta + 1, ply + 1, ctx, !cutnode).score;
|
int score = -PVS<false, mode>(copy, depth - reduction, -beta, -beta + 1, ply + 1, ctx, !cutnode).score;
|
||||||
ctx->doingNullMove = false;
|
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->positionHistory[copy.positionIndex] = copy.hashKey;
|
||||||
ctx->nodes++;
|
ctx->nodes++;
|
||||||
|
|
||||||
|
ctx->TT.PrefetchEntry(copy.hashKey);
|
||||||
|
|
||||||
int extension = 0;
|
int extension = 0;
|
||||||
|
|
||||||
if (ply
|
if (ply
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ public:
|
|||||||
table.resize(size);
|
table.resize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PrefetchEntry(U64 &hashKey) {
|
||||||
|
__builtin_prefetch(&table[hashKey % table.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
TTEntry GetRawEntry(U64 &hashKey) {
|
TTEntry GetRawEntry(U64 &hashKey) {
|
||||||
TTEntry *current = &table[hashKey % table.size()];
|
TTEntry *current = &table[hashKey % table.size()];
|
||||||
return *current;
|
return *current;
|
||||||
|
|||||||
Reference in new issue
Block a user