- case CAPTURES_S1: case CAPTURES_S3: case CAPTURES_S4: case CAPTURES_S5: case CAPTURES_S6:
- end = generate<CAPTURES>(pos, moves);
- score<CAPTURES>();
- return;
-
- case KILLERS_S1:
- cur = killers;
- end = cur + 2;
-
- if ((cur+3)->move && (cur+3)->move == (cur+2)->move) // Due to a SMP race
- (cur+3)->move = MOVE_NONE;
-
- // Be sure countermoves are different from killers
- if ((cur+2)->move != cur->move && (cur+2)->move != (cur+1)->move)
- end++;
-
- if ((cur+3)->move != cur->move && (cur+3)->move != (cur+1)->move)
- (end++)->move = (cur+3)->move;
- return;
-
- case QUIETS_1_S1:
- endQuiets = end = generate<QUIETS>(pos, moves);
- score<QUIETS>();
- end = std::partition(cur, end, has_positive_score);
- insertion_sort(cur, end);
- return;
-
- case QUIETS_2_S1:
- cur = end;
- end = endQuiets;
- if (depth >= 3 * ONE_PLY)
- insertion_sort(cur, end);
- return;
-
- case BAD_CAPTURES_S1:
- // Just pick them in reverse order to get MVV/LVA ordering
- cur = moves + MAX_MOVES - 1;
- end = endBadCaptures;
- return;
-
- case EVASIONS_S2:
- end = generate<EVASIONS>(pos, moves);
- if (end > moves + 1)
- score<EVASIONS>();
- return;
-
- case QUIET_CHECKS_S3:
- end = generate<QUIET_CHECKS>(pos, moves);
- return;
-
- case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT: case RECAPTURE:
- phase = STOP;
- case STOP:
- end = cur + 1; // Avoid another next_phase() call
- return;
-
- default:
- assert(false);
- }
-}