mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Tidy up tt.h
Backport some non-functional changes found working on 'dense TT' patch. No functional change.
This commit is contained in:
39
src/tt.h
39
src/tt.h
@@ -23,19 +23,28 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
/// The TTEntry is the 128 bit transposition table entry, defined as below:
|
/// The TTEntry is the 14 bytes transposition table entry, defined as below:
|
||||||
///
|
///
|
||||||
/// key: 32 bit
|
/// key 32 bit
|
||||||
/// move: 16 bit
|
/// move 16 bit
|
||||||
/// bound type: 8 bit
|
/// bound type 8 bit
|
||||||
/// generation: 8 bit
|
/// generation 8 bit
|
||||||
/// value: 16 bit
|
/// value 16 bit
|
||||||
/// depth: 16 bit
|
/// depth 16 bit
|
||||||
/// static value: 16 bit
|
/// eval value 16 bit
|
||||||
|
|
||||||
struct TTEntry {
|
struct TTEntry {
|
||||||
|
|
||||||
void save(uint32_t k, Value v, Bound b, Depth d, Move m, int g, Value ev) {
|
Move move() const { return (Move )move16; }
|
||||||
|
Bound bound() const { return (Bound)bound8; }
|
||||||
|
Value value() const { return (Value)value16; }
|
||||||
|
Depth depth() const { return (Depth)depth16; }
|
||||||
|
Value eval_value() const { return (Value)evalValue; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class TranspositionTable;
|
||||||
|
|
||||||
|
void save(uint32_t k, Value v, Bound b, Depth d, Move m, uint8_t g, Value ev) {
|
||||||
|
|
||||||
key32 = (uint32_t)k;
|
key32 = (uint32_t)k;
|
||||||
move16 = (uint16_t)m;
|
move16 = (uint16_t)m;
|
||||||
@@ -46,16 +55,6 @@ struct TTEntry {
|
|||||||
evalValue = (int16_t)ev;
|
evalValue = (int16_t)ev;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t key() const { return key32; }
|
|
||||||
Move move() const { return (Move)move16; }
|
|
||||||
Bound bound() const { return (Bound)bound8; }
|
|
||||||
Value value() const { return (Value)value16; }
|
|
||||||
Depth depth() const { return (Depth)depth16; }
|
|
||||||
Value eval_value() const { return (Value)evalValue; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class TranspositionTable;
|
|
||||||
|
|
||||||
uint32_t key32;
|
uint32_t key32;
|
||||||
uint16_t move16;
|
uint16_t move16;
|
||||||
uint8_t bound8, generation8;
|
uint8_t bound8, generation8;
|
||||||
@@ -71,7 +70,7 @@ private:
|
|||||||
|
|
||||||
class TranspositionTable {
|
class TranspositionTable {
|
||||||
|
|
||||||
static const unsigned ClusterSize = 4; // A cluster is 64 Bytes
|
static const unsigned ClusterSize = 4;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~TranspositionTable() { free(mem); }
|
~TranspositionTable() { free(mem); }
|
||||||
|
|||||||
Reference in New Issue
Block a user