X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=6a1755b662891b26051dad911b1c42bcf2c7de86;hp=140867fa94a466272d55be020451b0eb8b012f77;hb=15e21911110f9d459c4fef2bb17903d97345d0b9;hpb=2bfe61c33b99bd5ebb2e4616a6e8ac5790ff4c4f diff --git a/src/bitboard.h b/src/bitboard.h index 140867fa..6a1755b6 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -21,9 +21,9 @@ #ifndef BITBOARD_H_INCLUDED #define BITBOARD_H_INCLUDED -#include "types.h" +#include -extern Bitboard pext(Bitboard b, Bitboard mask); +#include "types.h" namespace Bitboards { @@ -243,6 +243,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]);