X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;fp=src%2Fbitboard.h;h=cf52b39d37598c7ebc4f66af272a4000458ff8ac;hp=8fa774818db69b71c34d5e357ce722dd7cdab1b6;hb=05f7d59a9a27d9f8bce8bde4e9fed7ecefeb03b9;hpb=332b90455bf613e65cf2abe46594e12fc7a27f71 diff --git a/src/bitboard.h b/src/bitboard.h index 8fa77481..cf52b39d 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -153,7 +153,7 @@ inline Bitboard file_bb(Square s) { } -/// shift() moves a bitboard one step along direction D (mainly for pawns) +/// shift() moves a bitboard one step along direction D template constexpr Bitboard shift(Bitboard b) { @@ -165,8 +165,8 @@ constexpr Bitboard shift(Bitboard b) { } -/// pawn_attacks_bb() returns the pawn attacks for the given color from the -/// squares in the given bitboard. +/// pawn_attacks_bb() returns the squares attacked by pawns of the given color +/// from the squares in the given bitboard. template constexpr Bitboard pawn_attacks_bb(Bitboard b) { @@ -175,11 +175,11 @@ constexpr Bitboard pawn_attacks_bb(Bitboard b) { } -/// double_pawn_attacks_bb() returns the pawn attacks for the given color -/// from the squares in the given bitboard. +/// pawn_double_attacks_bb() returns the squares doubly attacked by pawns of the +/// given color from the squares in the given bitboard. template -constexpr Bitboard double_pawn_attacks_bb(Bitboard b) { +constexpr Bitboard pawn_double_attacks_bb(Bitboard b) { return C == WHITE ? shift(b) & shift(b) : shift(b) & shift(b); }