- TTEntry();
- TTEntry(Key k, Value v, ValueType t, Depth d, Move m, int generation);
- Key key() const { return key_; }
- Depth depth() const { return Depth(depth_); }
- Move move() const { return Move(data & 0x7FFFF); }
- Value value() const { return Value(value_); }
- ValueType type() const { return ValueType((data >> 20) & 7); }
- int generation() const { return (data >> 23); }
+ void save(uint32_t k, Value v, ValueType t, Depth d, Move m, int g, Value statV, Value kd) {
+
+ key32 = k;
+ data = (m & 0x1FFFF) | (t << 21) | (g << 23);
+ value16 = int16_t(v);
+ depth16 = int16_t(d);
+ staticValue = int16_t(statV);
+ staticValueMargin = int16_t(kd);
+ }
+
+ uint32_t key() const { return key32; }
+ Depth depth() const { return Depth(depth16); }
+ Move move() const { return Move(data & 0x1FFFF); }
+ Value value() const { return Value(value16); }
+ ValueType type() const { return ValueType((data >> 21) & 3); }
+ int generation() const { return data >> 23; }
+ Value static_value() const { return Value(staticValue); }
+ Value static_value_margin() const { return Value(staticValueMargin); }