- if (Piece == KING || !checkSqs)
- return mlist;
-
- while (b)
- {
- Square from = pop_1st_bit(&b);
- if ( (Piece == QUEEN && !(QueenPseudoAttacks[from] & checkSqs))
- || (Piece == ROOK && !(RookPseudoAttacks[from] & checkSqs))
- || (Piece == BISHOP && !(BishopPseudoAttacks[from] & checkSqs)))
- continue;
-
- Bitboard bb = pos.attacks_from<Piece>(from) & checkSqs;
- SERIALIZE_MOVES(bb);
- }
- return mlist;
- }
-
- template<Color Us>
- MoveStack* generate_pawn_blocking_evasions(const Position& pos, Bitboard pinned,
- Bitboard blockSquares, MoveStack* mlist) {
-
- // Calculate our parametrized parameters at compile time
- const Bitboard TRank8BB = (Us == WHITE ? Rank8BB : Rank1BB);
- const Bitboard TRank7BB = (Us == WHITE ? Rank7BB : Rank2BB);
- const Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB);
- const SquareDelta TDELTA_N = (Us == WHITE ? DELTA_N : DELTA_S);
-
- Bitboard b1, b2;
- Square to;
- Bitboard pawns = pos.pieces(PAWN, Us) & ~pinned;
- Bitboard emptySquares = pos.empty_squares();
-
- if (pawns & TRank7BB) // There is some promotion candidate ?