X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fbitboard.h;h=888e96905469b1c907340a79beaca613d2b90c41;hb=eced15fe36a16c38659f586bc558b1175114cc76;hp=cd6c280c8c444d9e349c1895b4c792ef8325d77d;hpb=c556fe1d716fcef3215c239f02b314ec7b42f0d1;p=stockfish diff --git a/src/bitboard.h b/src/bitboard.h index cd6c280c..888e9690 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -23,8 +23,6 @@ #include "types.h" -extern Bitboard pext(Bitboard b, Bitboard mask); - namespace Bitboards { void init(); @@ -132,10 +130,9 @@ inline int rank_distance(Square s1, Square s2) { template inline Bitboard shift_bb(Bitboard b) { - return Delta == DELTA_N ? b << 8 : Delta == DELTA_S ? b >> 8 - : Delta == DELTA_NE ? (b & ~FileHBB) << 9 : Delta == DELTA_SE ? (b & ~FileHBB) >> 7 + return Delta == DELTA_NE ? (b & ~FileHBB) << 9 : Delta == DELTA_SE ? (b & ~FileHBB) >> 7 : Delta == DELTA_NW ? (b & ~FileABB) << 7 : Delta == DELTA_SW ? (b & ~FileABB) >> 9 - : 0; + : Delta > 0 ? b << Delta : b >> -Delta; } @@ -244,7 +241,7 @@ FORCE_INLINE unsigned magic_index(Square s, Bitboard occ) { unsigned* const Shifts = Pt == ROOK ? RShifts : BShifts; if (HasPext) - return unsigned(pext(occ, Masks[s])); + return unsigned(_pext_u64(occ, Masks[s])); if (Is64Bit) return unsigned(((occ & Masks[s]) * Magics[s]) >> Shifts[s]);