#ifndef BITBOARD_H_INCLUDED
#define BITBOARD_H_INCLUDED
-#include "types.h"
+#include <string>
-extern Bitboard pext(Bitboard b, Bitboard mask);
+#include "types.h"
namespace Bitboards {
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]);