@@ -37,7 +37,7 @@ Move *splat_moves(Move *moveList, Square from, Bitboard to_bb) {
3737 return moveList;
3838}
3939
40- template <int offset> Move *splat_pawn_moves (Move *moveList, Bitboard to_bb) {
40+ template <Direction offset> Move *splat_pawn_moves (Move *moveList, Bitboard to_bb) {
4141 const auto *table = reinterpret_cast <const __m512i *>(SPLAT_PAWN_TABLE<offset>.data .data ());
4242 moveList = write_moves (moveList, static_cast <uint32_t >(to_bb >> 0 ), _mm512_load_si512 (table + 0 ));
4343 moveList = write_moves (moveList, static_cast <uint32_t >(to_bb >> 32 ), _mm512_load_si512 (table + 1 ));
@@ -435,37 +435,28 @@ template Move *chess::_chess::splat_pawn_moves<SOUTH_WEST>(Move *, Bitboard);
435435 Movelist &, \
436436 Bitboard, \
437437 Bitboard, \
438- Bitboard); \
439- template void chess::movegen::genKnightMoves<PieceC, Color::WHITE, true >(const _Position<PieceC, void >&, Movelist&, Bitboard, Bitboard); \
440- template void chess::movegen::genKnightMoves<PieceC, Color::BLACK, true >(const _Position<PieceC, void >&, Movelist&, Bitboard, Bitboard); \
441- template void chess::movegen::genKnightMoves<PieceC, Color::WHITE, false >(const _Position<PieceC, void >&, Movelist&, Bitboard, Bitboard); \
442- template void chess::movegen::genKnightMoves<PieceC, Color::BLACK, false >(const _Position<PieceC, void >&, Movelist&, Bitboard, Bitboard); \
443- template void chess::movegen::genKingMoves<PieceC, Color::WHITE, true >(const _Position<PieceC, void >&, Movelist&); \
444- template void chess::movegen::genKingMoves<PieceC, Color::BLACK, true >(const _Position<PieceC, void >&, Movelist&); \
445- template void chess::movegen::genKingMoves<PieceC, Color::WHITE, false >(const _Position<PieceC, void >&, Movelist&); \
446- template void chess::movegen::genKingMoves<PieceC, Color::BLACK, false >(const _Position<PieceC, void >&, Movelist&);
438+ Bitboard); \
439+ template void chess::movegen::genKnightMoves<PieceC, Color::WHITE, true >(const _Position<PieceC, void > &, \
440+ Movelist &, \
441+ Bitboard, \
442+ Bitboard); \
443+ template void chess::movegen::genKnightMoves<PieceC, Color::BLACK, true >(const _Position<PieceC, void > &, \
444+ Movelist &, \
445+ Bitboard, \
446+ Bitboard); \
447+ template void chess::movegen::genKnightMoves<PieceC, Color::WHITE, false >(const _Position<PieceC, void > &, \
448+ Movelist &, \
449+ Bitboard, \
450+ Bitboard); \
451+ template void chess::movegen::genKnightMoves<PieceC, Color::BLACK, false >(const _Position<PieceC, void > &, \
452+ Movelist &, \
453+ Bitboard, \
454+ Bitboard); \
455+ template void chess::movegen::genKingMoves<PieceC, Color::WHITE, true >(const _Position<PieceC, void > &, Movelist &); \
456+ template void chess::movegen::genKingMoves<PieceC, Color::BLACK, true >(const _Position<PieceC, void > &, Movelist &); \
457+ template void chess::movegen::genKingMoves<PieceC, Color::WHITE, false >(const _Position<PieceC, void > &, Movelist &); \
458+ template void chess::movegen::genKingMoves<PieceC, Color::BLACK, false >(const _Position<PieceC, void > &, Movelist &);
447459INSTANTIATE (EnginePiece)
448460INSTANTIATE (PolyglotPiece)
449461INSTANTIATE (ContiguousMappingPiece)
450- inline static Bitboard att (PieceType pt, Square sq, Bitboard occ) {
451- return (pt == BISHOP) ? attacks::bishop (sq, occ) : attacks::rook (sq, occ);
452- }
453-
454- inline static std::array<std::array<Bitboard, 64 >, 64 > generate_between () {
455- std::array<std::array<Bitboard, 64 >, 64 > squares_between_bb{};
456-
457- for (int sq1 = 0 ; sq1 < 64 ; ++sq1) {
458- for (PieceType pt : { BISHOP, ROOK }) {
459- for (int sq2 = 0 ; sq2 < 64 ; ++sq2) {
460- if (att (pt, Square (sq1), 0 ) & (1ULL << sq2)) {
461- squares_between_bb[sq1][sq2] = att (pt, Square (sq1), 1ULL << (sq2)) & att (pt, Square (sq2), 1ULL << (sq1));
462- }
463- squares_between_bb[sq1][sq2] |= 1ULL << (sq2);
464- }
465- }
466- }
467-
468- return squares_between_bb;
469- }
470- std::array<std::array<Bitboard, 64 >, 64 > movegen::SQUARES_BETWEEN_BB = generate_between();
471- } // namespace chess
462+ } // namespace chess
0 commit comments