X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=9814268327afdd9c269d728077d1f82770035c87;hp=140867fa94a466272d55be020451b0eb8b012f77;hb=da2f8880b96004505e27b0b87f5df5bfe67a72a9;hpb=2bfe61c33b99bd5ebb2e4616a6e8ac5790ff4c4f diff --git a/src/bitboard.h b/src/bitboard.h index 140867fa..98142683 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(); @@ -243,6 +241,9 @@ FORCE_INLINE unsigned magic_index(Square s, Bitboard occ) { Bitboard* const Magics = Pt == ROOK ? RMagics : BMagics; unsigned* const Shifts = Pt == ROOK ? RShifts : BShifts; + if (HasPext) + return unsigned(_pext_u64(occ, Masks[s])); + if (Is64Bit) return unsigned(((occ & Masks[s]) * Magics[s]) >> Shifts[s]);