X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.h;h=c41f231e2a251ec8f3035a5509abdca3e6232635;hp=6c7caf75fce19bbab5c55886a26e6d75f27f47c1;hb=da98a45bcb643addc52333ff29fcfb20aa6872ff;hpb=feeafb0a50556654e345a09d16529a5eb7715dc0 diff --git a/src/tt.h b/src/tt.h index 6c7caf75..c41f231e 100644 --- a/src/tt.h +++ b/src/tt.h @@ -59,20 +59,38 @@ public: void update(Value v, Bound b, Depth d, Move m, int g) { move16 = (uint16_t)m; - bound |= (uint8_t)b; generation8 = (uint8_t)g; + if (bound == BOUND_EXACT) + bound = BOUND_UPPER | BOUND_LOWER; // Drop 'EXACT' flag + if (b & BOUND_UPPER) { valueUpper = (int16_t)v; depthUpper = (int16_t)d; + + if ((bound & BOUND_LOWER) && v < valueLower) + { + bound ^= BOUND_LOWER; + valueLower = VALUE_NONE; + depthLower = DEPTH_NONE; + } } if (b & BOUND_LOWER) { valueLower = (int16_t)v; depthLower = (int16_t)d; + + if ((bound & BOUND_UPPER) && v > valueUpper) + { + bound ^= BOUND_UPPER; + valueUpper = VALUE_NONE; + depthUpper = DEPTH_NONE; + } } + + bound |= (uint8_t)b; } void set_generation(int g) { generation8 = (uint8_t)g; }