tt buckets | bench 1783856
This commit is contained in:
1 parent
931b6fa999
commit
41dabc2150
3 files changed
+37
-14
No files matched your search
+14
-1
@@ -1,7 +1,20 @@
|
||||
#include "tt.h"
|
||||
|
||||
void TTable::WriteEntry(U64 &hashKey, int depth, int score, int nodeType, Move bestMove, bool ttpv) {
|
||||
TTEntry *current = &table[hashKey % table.size()];
|
||||
TTBucket *bucket = &table[hashKey % table.size()];
|
||||
TTEntry *current = nullptr;
|
||||
|
||||
if (bucket->depthPreferred && bucket->depthPreferred.hashKey == hashKey) {
|
||||
current = &bucket->depthPreferred;
|
||||
} else if (bucket->alwaysReplace && bucket->alwaysReplace.hashKey == hashKey) {
|
||||
current = &bucket->alwaysReplace;
|
||||
} else if (ttpv) {
|
||||
current = &bucket->depthPreferred;
|
||||
} else if (!bucket->depthPreferred || bucket->depthPreferred.depth <= depth) {
|
||||
current = &bucket->depthPreferred;
|
||||
} else {
|
||||
current = &bucket->alwaysReplace;
|
||||
}
|
||||
|
||||
current->hashKey = hashKey;
|
||||
current->nodeType = nodeType;
|
||||
|
||||
Reference in new issue
Block a user