X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmovepick.cpp;h=8089345546a1f1c58c31a8f3365fe0f2cf388c24;hb=a5d699d62fb625fba23b23bdeff2a68807ef6438;hp=0b887c99d0afb31abc3c963e7645a4224d082d3a;hpb=595a90dfd0cd393a8805f4f51cf5c5d8b264c121;p=stockfish diff --git a/src/movepick.cpp b/src/movepick.cpp index 0b887c99..80893455 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -43,7 +43,8 @@ namespace { /// Variables CACHE_LINE_ALIGNMENT - const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP}; + const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_NULL_MOVE, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP}; + const MovegenPhaseT MainSearchNoNullPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP}; const MovegenPhaseT EvasionsPhaseTable[] = { PH_STOP, PH_EVASIONS, PH_STOP}; const MovegenPhaseT QsearchWithChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_QCHECKS, PH_STOP}; const MovegenPhaseT QsearchWithoutChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_STOP}; @@ -63,7 +64,7 @@ namespace { /// move ordering is at the current node. MovePicker::MovePicker(const Position& p, Move ttm, Depth d, - const History& h, SearchStack* ss) : pos(p), H(h) { + const History& h, SearchStack* ss, bool useNullMove) : pos(p), H(h) { ttMoves[0] = ttm; if (ss) { @@ -79,7 +80,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, if (p.is_check()) phasePtr = EvasionsPhaseTable; else if (d > Depth(0)) - phasePtr = MainSearchPhaseTable; + phasePtr = useNullMove ? MainSearchPhaseTable : MainSearchNoNullPhaseTable; else if (d == Depth(0)) phasePtr = QsearchWithChecksPhaseTable; else @@ -115,6 +116,9 @@ Move MovePicker::get_next_move() { phasePtr++; switch (*phasePtr) { + case PH_NULL_MOVE: + return MOVE_NULL; + case PH_TT_MOVES: movesPicked = 0; // This is used as index to ttMoves[] break;