X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fbitboard.h;h=d3a4ae53e5ed93137e44df2d6fc329729a2ff223;hb=3e40bd0648ab69c04e37da50fd3f3d4beb072df2;hp=d1cf40f25b0e0f480f04c488babe248805d4442f;hpb=74160ac60266f9e6824a5a6417d8a0ac8c0b39cf;p=stockfish diff --git a/src/bitboard.h b/src/bitboard.h index d1cf40f2..d3a4ae53 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008 Marco Costalba + Copyright (C) 2008-2009 Marco Costalba Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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.