mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +08:00
Generalize shift_bb() to handle double pushes
And use it in evaluate_space. No functional change.
This commit is contained in:
@@ -130,10 +130,9 @@ inline int rank_distance(Square s1, Square s2) {
|
||||
template<Square Delta>
|
||||
inline Bitboard shift_bb(Bitboard b) {
|
||||
|
||||
return Delta == DELTA_N ? b << 8 : Delta == DELTA_S ? b >> 8
|
||||
: Delta == DELTA_NE ? (b & ~FileHBB) << 9 : Delta == DELTA_SE ? (b & ~FileHBB) >> 7
|
||||
return Delta == DELTA_NE ? (b & ~FileHBB) << 9 : Delta == DELTA_SE ? (b & ~FileHBB) >> 7
|
||||
: Delta == DELTA_NW ? (b & ~FileABB) << 7 : Delta == DELTA_SW ? (b & ~FileABB) >> 9
|
||||
: 0;
|
||||
: Delta > 0 ? b << Delta : b >> -Delta;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user