From 9e44a6dba9718b74a64656ae7801a62946c3b725 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 29 Mar 2009 17:22:10 +0100 Subject: [PATCH 1/1] A move needs 17 bits not 19 Fix a bug in the way a move is stored and read in a TT entry. We use a mask of 19 bits insteaad of 17 so that the last two bits in the TT entry end up to be random data. This bug will bite us when we will use these two until now unused bits. Signed-off-by: Marco Costalba --- src/tt.cpp | 2 +- src/tt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tt.cpp b/src/tt.cpp index c88aef48..5c842db8 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -206,5 +206,5 @@ TTEntry::TTEntry() { TTEntry::TTEntry(Key k, Value v, ValueType t, Depth d, Move m, int generation) : - key_ (k), data((m & 0x7FFFF) | (t << 20) | (generation << 23)), + key_ (k), data((m & 0x1FFFF) | (t << 20) | (generation << 23)), value_(int16_t(v)), depth_(int16_t(d)) {} diff --git a/src/tt.h b/src/tt.h index 02913efe..31fc1fbc 100644 --- a/src/tt.h +++ b/src/tt.h @@ -43,7 +43,7 @@ public: 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); } + Move move() const { return Move(data & 0x1FFFF); } Value value() const { return Value(value_); } ValueType type() const { return ValueType((data >> 20) & 7); } int generation() const { return (data >> 23); } -- 2.39.2