]> git.sesse.net Git - stockfish/blobdiff - src/bitboard.h
Move to_char() and to_string() to notation
[stockfish] / src / bitboard.h
index 140867fa94a466272d55be020451b0eb8b012f77..7330a199e1fba11a416da7a37fe379f543eaa9de 100644 (file)
 #ifndef BITBOARD_H_INCLUDED
 #define BITBOARD_H_INCLUDED
 
+#include <string>
 #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]);