diff options
Diffstat (limited to 'src/see.c')
| -rwxr-xr-x | src/see.c | 43 |
1 files changed, 8 insertions, 35 deletions
@@ -167,39 +167,12 @@ Return value: // out-of-line FirstBit/LastBit -- worth avoiding call overhead in a // per-move-generated, per-node hot path like this one. // -static BITBOARD -_BuildOccupiedBB(IN POSITION *pos) -/** - -Routine description: - - Full-board occupancy (both colors, every piece including pawns - and kings), built from the incrementally-maintained bbPieces[2][8] - and bbPawns[2] fields plus the king mailbox array - (cNonPawns[.][0], a single square per side -- a bitboard for that - adds nothing). All O(1) ORs now that bbPawns exists; this used to - loop cPawns[2][8] (up to 16 iterations) to build the pawn portion, - which ran on every single call regardless of how few pawns were - actually relevant. - -Parameters: - - POSITION *pos - -Return value: - - BITBOARD - -**/ -{ - return (pos->bbPieces[WHITE][KNIGHT] | pos->bbPieces[WHITE][BISHOP] | - pos->bbPieces[WHITE][ROOK] | pos->bbPieces[WHITE][QUEEN] | - pos->bbPieces[BLACK][KNIGHT] | pos->bbPieces[BLACK][BISHOP] | - pos->bbPieces[BLACK][ROOK] | pos->bbPieces[BLACK][QUEEN] | - pos->bbPawns[WHITE] | pos->bbPawns[BLACK] | - COOR_TO_BB(pos->cNonPawns[WHITE][0]) | - COOR_TO_BB(pos->cNonPawns[BLACK][0])); -} +// (This file used to have its own static _BuildOccupiedBB here, +// byte-for-byte identical to generate.c's _BuildFullOccupiedBB -- +// removed 2026-09-05 now that pos->bbOccupied is incrementally +// maintained directly on POSITION; see board_representation/ +// EVAL.md section 0. Callers below just read pos->bbOccupied.) +// // Non-static (unlike its historical file-local status) so // generate.c's Part B (_GenerateEscapes) bitboard work can call it @@ -249,7 +222,7 @@ Parameters: POSITION *pos, COOR cSquare : target square ULONG uSide : side whose attackers on cSquare we want - BITBOARD bbOccupied : full-board occupancy (see _BuildOccupiedBB) + BITBOARD bbOccupied : full-board occupancy (see pos->bbOccupied) Return value: @@ -412,7 +385,7 @@ Return value: // // Knights/bishops/rooks/queens/king, via the bitboard primitive. // - bbOccupied = _BuildOccupiedBB(pos); + bbOccupied = pos->bbOccupied; bbAttackers = _WhoAttacksSquareBB(pos, cSquare, uSide, bbOccupied); while (bbAttackers) { |
