mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00:00
Revert to byTypeBB[0] storing occupied squares
As it was in Glaurung times. Also rearranged order so that byTypeBB[0] is accessed before byTypeBB[x] to be more cache friendly. It seems there is even a small speedup. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+4
-5
@@ -231,7 +231,6 @@ private:
|
||||
// Bitboards
|
||||
Bitboard byTypeBB[8]; // [pieceType]
|
||||
Bitboard byColorBB[2]; // [color]
|
||||
Bitboard occupied;
|
||||
|
||||
// Piece counts
|
||||
int pieceCount[2][8]; // [color][pieceType]
|
||||
@@ -286,7 +285,7 @@ inline Color Position::side_to_move() const {
|
||||
}
|
||||
|
||||
inline Bitboard Position::pieces() const {
|
||||
return occupied;
|
||||
return byTypeBB[ALL_PIECES];
|
||||
}
|
||||
|
||||
inline Bitboard Position::pieces(Color c) const {
|
||||
@@ -334,7 +333,7 @@ inline bool Position::can_castle(Color c) const {
|
||||
}
|
||||
|
||||
inline bool Position::castle_impeded(CastleRight f) const {
|
||||
return occupied & castlePath[f];
|
||||
return byTypeBB[ALL_PIECES] & castlePath[f];
|
||||
}
|
||||
|
||||
inline Square Position::castle_rook_square(CastleRight f) const {
|
||||
@@ -354,11 +353,11 @@ inline Bitboard Position::attacks_from<PAWN>(Square s, Color c) const {
|
||||
}
|
||||
|
||||
inline Bitboard Position::attacks_from(Piece p, Square s) const {
|
||||
return attacks_from(p, s, occupied);
|
||||
return attacks_from(p, s, byTypeBB[ALL_PIECES]);
|
||||
}
|
||||
|
||||
inline Bitboard Position::attackers_to(Square s) const {
|
||||
return attackers_to(s, occupied);
|
||||
return attackers_to(s, byTypeBB[ALL_PIECES]);
|
||||
}
|
||||
|
||||
inline Bitboard Position::checkers() const {
|
||||
|
||||
Reference in New Issue
Block a user