X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=c6dbc647b093dfe1c8d5d425554a76161138adeb;hp=559c70f62acf9e5f056d26f205fa6dc2aa24f38f;hb=9dc6d270fc207d6715578b57a1cdf655527ec5fe;hpb=cf5d683408a2ef8a1c80be9bf7d6790a38b16277 diff --git a/src/bitboard.h b/src/bitboard.h index 559c70f6..c6dbc647 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -177,6 +177,16 @@ 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. + +template +constexpr Bitboard double_pawn_attacks_bb(Bitboard b) { + return C == WHITE ? shift(b) & shift(b) + : shift(b) & shift(b); +} + + /// adjacent_files_bb() returns a bitboard representing all the squares on the /// adjacent files of the given one.