X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=7330a199e1fba11a416da7a37fe379f543eaa9de;hp=3ff0408a61b16faab014965ed063af2c85124a0c;hb=880e3cd7c82c82776e85042c849e884811378e21;hpb=64d29a633066e39b62af5ee0bbf32645994744ec diff --git a/src/bitboard.h b/src/bitboard.h index 3ff0408a..7330a199 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -21,6 +21,7 @@ #ifndef BITBOARD_H_INCLUDED #define BITBOARD_H_INCLUDED +#include #include "types.h" namespace Bitboards { @@ -241,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]);