Move Attacks out of Bitboard File

Over the past few months our attacks and bitboard logic got a bit more involved and target specific, so I think it makes sense to split this up a bit more into separate files.

While it's not in an ideal state I think it's first step and can be improved later, `pawn_attacks_bb` could also be moved into the attacks.h but this was more of an oversight from my side.

closes https://github.com/official-stockfish/Stockfish/pull/6833

No functional change
This commit is contained in:
Disservin
2026-05-24 14:18:45 +02:00
committed by Joost VandeVondele
parent be9df38f27
commit 24d6398490
11 changed files with 529 additions and 491 deletions
+4 -2
View File
@@ -43,6 +43,8 @@ using std::string;
namespace Stockfish {
using namespace Attacks;
namespace Zobrist {
Key psq[PIECE_NB][SQUARE_NB];
@@ -1216,11 +1218,11 @@ void Position::update_piece_threats(Piece pc,
Square sliderSq = pop_lsb(sliders);
Piece slider = piece_on(sliderSq);
const Bitboard ray = RayPassBB[sliderSq][s];
const Bitboard ray = ray_pass_bb(sliderSq, s);
const Bitboard discovered = ray & (rAttacks | bAttacks) & occupiedNoK;
assert(!more_than_one(discovered));
if (discovered && (RayPassBB[sliderSq][s] & noRaysContaining) != noRaysContaining)
if (discovered && (ray_pass_bb(sliderSq, s) & noRaysContaining) != noRaysContaining)
{
const Square threatenedSq = lsb(discovered);
const Piece threatenedPc = piece_on(threatenedSq);