Skip to content

Commit

Permalink
Removes a few Bitboards and functions that are not used
Browse files Browse the repository at this point in the history
  • Loading branch information
rn5f107s2 committed Jul 17, 2023
1 parent 34d0c1b commit 91554ce
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
30 changes: 0 additions & 30 deletions src/bitboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ std::string pretty(Bitboard b);

} // namespace Stockfish::Bitboards

constexpr Bitboard AllSquares = ~Bitboard(0);
constexpr Bitboard DarkSquares = 0xAA55AA55AA55AA55ULL;

constexpr Bitboard FileABB = 0x0101010101010101ULL;
Expand All @@ -53,17 +52,6 @@ constexpr Bitboard Rank6BB = Rank1BB << (8 * 5);
constexpr Bitboard Rank7BB = Rank1BB << (8 * 6);
constexpr Bitboard Rank8BB = Rank1BB << (8 * 7);

constexpr Bitboard QueenSide = FileABB | FileBBB | FileCBB | FileDBB;
constexpr Bitboard CenterFiles = FileCBB | FileDBB | FileEBB | FileFBB;
constexpr Bitboard KingSide = FileEBB | FileFBB | FileGBB | FileHBB;
constexpr Bitboard Center = (FileDBB | FileEBB) & (Rank4BB | Rank5BB);

constexpr Bitboard KingFlank[FILE_NB] = {
QueenSide ^ FileDBB, QueenSide, QueenSide,
CenterFiles, CenterFiles,
KingSide, KingSide, KingSide ^ FileEBB
};

extern uint8_t PopCnt16[1 << 16];
extern uint8_t SquareDistance[SQUARE_NB][SQUARE_NB];

Expand Down Expand Up @@ -178,16 +166,6 @@ inline Bitboard pawn_attacks_bb(Color c, Square s) {
}


/// pawn_double_attacks_bb() returns the squares doubly attacked by pawns of the
/// given color from the squares in the given bitboard.

template<Color C>
constexpr Bitboard pawn_double_attacks_bb(Bitboard b) {
return C == WHITE ? shift<NORTH_WEST>(b) & shift<NORTH_EAST>(b)
: shift<SOUTH_WEST>(b) & shift<SOUTH_EAST>(b);
}


/// adjacent_files_bb() returns a bitboard representing all the squares on the
/// adjacent files of a given square.

Expand Down Expand Up @@ -430,14 +408,6 @@ inline Square pop_lsb(Bitboard& b) {
return s;
}


/// frontmost_sq() returns the most advanced square for the given color,
/// requires a non-zero bitboard.
inline Square frontmost_sq(Color c, Bitboard b) {
assert(b);
return c == WHITE ? msb(b) : lsb(b);
}

} // namespace Stockfish

#endif // #ifndef BITBOARD_H_INCLUDED
1 change: 0 additions & 1 deletion src/position.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class Position {
Key key() const;
Key key_after(Move m) const;
Key material_key() const;
Key pawn_key() const;

// Other properties of the position
Color side_to_move() const;
Expand Down

0 comments on commit 91554ce

Please sign in to comment.