X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=ba1af2f2865f28865791178206add9752a392889;hp=ef0bc2a843cc1d437f0804bebbefe7ae6b543f12;hb=f256388e0808b45d8468b088cdc141a41feac3fb;hpb=9742fb10fd83e82ad760e4cac5cef3d6dff670ed diff --git a/src/bitboard.cpp b/src/bitboard.cpp index ef0bc2a8..ba1af2f2 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -1,7 +1,8 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008-2016 Marco Costalba, Joona Kiiski, Tord Romstad + Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad + Copyright (C) 2015-2016 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -75,16 +76,18 @@ namespace { } } -#ifndef USE_BSFQ +#ifdef NO_BSF /// Software fall-back of lsb() and msb() for CPU lacking hardware support Square lsb(Bitboard b) { + assert(b); return BSFTable[bsf_index(b)]; } Square msb(Bitboard b) { + assert(b); unsigned b32; int result = 0; @@ -111,7 +114,7 @@ Square msb(Bitboard b) { return Square(result + MSBTable[b32]); } -#endif // ifndef USE_BSFQ +#endif // ifdef NO_BSF /// Bitboards::pretty() returns an ASCII representation of a bitboard suitable