# include <nmmintrin.h> // Intel header for _mm_popcnt_u64() intrinsic
#endif
+#if defined(USE_PEXT)
+# include <immintrin.h> // Header for _pext_u64() intrinsic
+#else
+# define _pext_u64(b, m) (0)
+#endif
+
# if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
# include <xmmintrin.h> // Intel and Microsoft header for _mm_prefetch()
# endif
const bool HasPopCnt = false;
#endif
+#ifdef USE_PEXT
+const bool HasPext = true;
+#else
+const bool HasPext = false;
+#endif
+
#ifdef IS_64BIT
const bool Is64Bit = true;
#else
VALUE_ZERO = 0,
VALUE_DRAW = 0,
VALUE_KNOWN_WIN = 10000,
- VALUE_MATE = 30000,
- VALUE_INFINITE = 30001,
- VALUE_NONE = 30002,
+ VALUE_MATE = 32000,
+ VALUE_INFINITE = 32001,
+ VALUE_NONE = 32002,
VALUE_MATE_IN_MAX_PLY = VALUE_MATE - MAX_PLY,
VALUE_MATED_IN_MAX_PLY = -VALUE_MATE + MAX_PLY,
struct ExtMove {
Move move;
- int score;
+ Value value;
};
inline bool operator<(const ExtMove& f, const ExtMove& s) {
- return f.score < s.score;
+ return f.value < s.value;
}
inline Color operator~(Color c) {
return Square(s ^ SQ_A8); // Vertical flip SQ_A1 -> SQ_A8
}
-inline Square operator|(File f, Rank r) {
- return Square((r << 3) | f);
-}
-
inline CastlingRight operator|(Color c, CastlingSide s) {
return CastlingRight(WHITE_OO << ((s == QUEEN_SIDE) + 2 * c));
}
return -VALUE_MATE + ply;
}
+inline Square make_square(File f, Rank r) {
+ return Square((r << 3) | f);
+}
+
inline Piece make_piece(Color c, PieceType pt) {
return Piece((c << 3) | pt);
}
-inline PieceType type_of(Piece p) {
- return PieceType(p & 7);
+inline PieceType type_of(Piece pc) {
+ return PieceType(pc & 7);
}
-inline Color color_of(Piece p) {
- assert(p != NO_PIECE);
- return Color(p >> 3);
+inline Color color_of(Piece pc) {
+ assert(pc != NO_PIECE);
+ return Color(pc >> 3);
}
inline bool is_ok(Square s) {