mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Skip TT_MOVES phase when possible
If we don't have tt moves to search skip the
useless loop associated with TT_MOVES phase.
Another 1% speed boost that brings this series
to a +6.2% against original revision 595a90df
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -61,10 +61,12 @@ namespace {
|
|||||||
|
|
||||||
MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
||||||
const History& h, SearchStack* ss) : pos(p), H(h) {
|
const History& h, SearchStack* ss) : pos(p), H(h) {
|
||||||
|
int searchTT = ttm;
|
||||||
ttMoves[0].move = ttm;
|
ttMoves[0].move = ttm;
|
||||||
if (ss)
|
if (ss)
|
||||||
{
|
{
|
||||||
ttMoves[1].move = (ss->mateKiller == ttm)? MOVE_NONE : ss->mateKiller;
|
ttMoves[1].move = (ss->mateKiller == ttm)? MOVE_NONE : ss->mateKiller;
|
||||||
|
searchTT |= ttMoves[1].move;
|
||||||
killers[0].move = ss->killers[0];
|
killers[0].move = ss->killers[0];
|
||||||
killers[1].move = ss->killers[1];
|
killers[1].move = ss->killers[1];
|
||||||
} else
|
} else
|
||||||
@@ -81,11 +83,11 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
|||||||
if (p.is_check())
|
if (p.is_check())
|
||||||
phasePtr = EvasionsPhaseTable;
|
phasePtr = EvasionsPhaseTable;
|
||||||
else if (d > Depth(0))
|
else if (d > Depth(0))
|
||||||
phasePtr = MainSearchPhaseTable;
|
phasePtr = MainSearchPhaseTable + !searchTT;
|
||||||
else if (d == Depth(0))
|
else if (d == Depth(0))
|
||||||
phasePtr = QsearchWithChecksPhaseTable;
|
phasePtr = QsearchWithChecksPhaseTable + !searchTT;
|
||||||
else
|
else
|
||||||
phasePtr = QsearchWithoutChecksPhaseTable;
|
phasePtr = QsearchWithoutChecksPhaseTable + !searchTT;
|
||||||
|
|
||||||
phasePtr--;
|
phasePtr--;
|
||||||
go_next_phase();
|
go_next_phase();
|
||||||
|
|||||||
Reference in New Issue
Block a user