X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=7330a199e1fba11a416da7a37fe379f543eaa9de;hp=140867fa94a466272d55be020451b0eb8b012f77;hb=880e3cd7c82c82776e85042c849e884811378e21;hpb=2bfe61c33b99bd5ebb2e4616a6e8ac5790ff4c4f 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]);