Effectiveness of storing Pieces/En-passant/Castling in four bitboards

Discussion of chess software programming and technical issues.

Moderator: Ras

User030910
Posts: 1
Joined: Fri Jan 19, 2024 4:27 pm
Full name: Ethan Dailler

Effectiveness of storing Pieces/En-passant/Castling in four bitboards

Post by User030910 »

Hello,
I use Quad-Bitboards, however looking at a lot of codebases online I could scarcely found any that used Q-B.
Has there been some discussions on the cost/benefit of Q-B, were them found to be too expensive ?
Does someone have a link which explains why they have been more or less "abandonned" ?

Thank you for your time.

P.S. a code snippet of my Position class
BB0: The pieces of the side to move OR the en-passant square
BB1: Queens OR Bishops OR Pawns OR Rooks which have castling right
BB2: Rooks OR Bishops OR Knights
BB3: Queens OR Rooks OR Kings

Code: Select all

class Position {
public:
	inline Position() = default;

	inline Bitboard all() const { return bb[1] | bb[2] | bb[3]; }

	inline Bitboard us() const { return bb[0] & all(); }

	inline Bitboard them() const { return ~bb[0] & all(); }

	inline Bitboard enpassant() const { return bb[0] & ~all(); }

	inline Bitboard castling() const { return bb[1] & bb[2] & bb[3]; }

	inline Bitboard kings() const { return ~bb[1] & ~bb[2] & bb[3]; }

	inline Bitboard queens() const { return bb[1] & ~bb[2] & bb[3]; }

	inline Bitboard rooks() const { return bb[2] & bb[3]; }

	inline Bitboard bishops() const { return bb[1] & bb[2] & ~bb[3]; }

	inline Bitboard knights() const { return ~bb[1] & bb[2] & ~bb[3]; }

	inline Bitboard pawns() const { return bb[1] & ~bb[2] & ~bb[3]; }

private:
	Bitboard bb[4];
};