X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=d3a4ae53e5ed93137e44df2d6fc329729a2ff223;hp=a7b7717e71b4700b5d9d7c4bd3b408698b38c41f;hb=3e40bd0648ab69c04e37da50fd3f3d4beb072df2;hpb=5c81602d14539f8259a715477315e28b5de7cb54 diff --git a/src/bitboard.h b/src/bitboard.h index a7b7717e..d3a4ae53 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -205,6 +205,17 @@ inline void clear_bit(Bitboard *b, Square s) { } +/// Functions used to update a bitboard after a move. This is faster +/// then calling a sequence of clear_bit() + set_bit() + +inline Bitboard make_move_bb(Square from, Square to) { + return SetMaskBB[from] | SetMaskBB[to]; +} + +inline void do_move_bb(Bitboard *b, Bitboard move_bb) { + *b ^= move_bb; +} + /// rank_bb() and file_bb() gives a bitboard containing all squares on a given /// file or rank. It is also possible to pass a square as input to these /// functions.