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