]> git.sesse.net Git - stockfish/commitdiff
Tidy up tt.h
authorMarco Costalba <mcostalba@gmail.com>
Sat, 24 May 2014 21:53:01 +0000 (23:53 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 24 May 2014 22:02:09 +0000 (00:02 +0200)
Backport some non-functional changes
found working on 'dense TT' patch.

No functional change.

src/tt.h

index ff3605daa306b121c56f9aa3cf7c38b400ebcf97..eeb18e32acff0510656537dad8cdac29b4a8f1f6 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
 #include "misc.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
-/// move: 16 bit
-/// bound type: 8 bit
-/// generation: 8 bit
-/// value: 16 bit
-/// depth: 16 bit
-/// static value: 16 bit
+/// key        32 bit
+/// move       16 bit
+/// bound type  8 bit
+/// generation  8 bit
+/// value      16 bit
+/// depth      16 bit
+/// eval value 16 bit
 
 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;
     move16      = (uint16_t)m;
@@ -46,16 +55,6 @@ struct TTEntry {
     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;
   uint16_t move16;
   uint8_t bound8, generation8;
@@ -71,7 +70,7 @@ private:
 
 class TranspositionTable {
 
-  static const unsigned ClusterSize = 4; // A cluster is 64 Bytes
+  static const unsigned ClusterSize = 4;
 
 public:
  ~TranspositionTable() { free(mem); }