From 865b71309c4dd5c6c67c9c9422df5790cbb22440 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 23 Mar 2014 10:03:11 +0100 Subject: [PATCH 1/1] Simplify TT replace strategy Tested for no-regression with SPRT[-3, 1] at STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 32046 W: 6020 L: 5918 D: 20108 No functional change. --- src/tt.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/tt.cpp b/src/tt.cpp index 41fc33ff..d887844c 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -94,7 +94,6 @@ const TTEntry* TranspositionTable::probe(const Key key) const { void TranspositionTable::store(const Key key, Value v, Bound b, Depth d, Move m, Value statV) { - int c1, c2, c3; TTEntry *tte, *replace; uint32_t key32 = key >> 32; // Use the high 32 bits as key inside the cluster @@ -112,11 +111,9 @@ void TranspositionTable::store(const Key key, Value v, Bound b, Depth d, Move m, } // Implement replace strategy - c1 = (replace->generation8 == generation ? 2 : 0); - c2 = (tte->generation8 == generation || tte->bound() == BOUND_EXACT ? -2 : 0); - c3 = (tte->depth16 < replace->depth16 ? 1 : 0); - - if (c1 + c2 + c3 > 0) + if ( (replace->generation8 == generation) * 2 + - (tte->generation8 == generation || tte->bound() == BOUND_EXACT) * 2 + + (tte->depth16 < replace->depth16) > 0) replace = tte; } -- 2.39.2