X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=0774557e000a421aa63a5958368f0fb04237960c;hp=d67b2eea63a411bcda7fccfdc55ec26b2438ea97;hb=189b6fc270f91f4111c1a8049c97455093f8be97;hpb=7c8b7222f5eea024ab480abb2d9289fd1e42da9c diff --git a/src/types.h b/src/types.h index d67b2eea..0774557e 100644 --- a/src/types.h +++ b/src/types.h @@ -41,7 +41,7 @@ #include "platform.h" -#if defined(_WIN64) +#if defined(_WIN64) && !defined(IS_64BIT) # include // MSVC popcnt and bsfq instrinsics # define IS_64BIT # define USE_BSFQ @@ -51,6 +51,10 @@ # include // Intel header for _mm_popcnt_u64() intrinsic #endif +# if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER)) +# include // Intel and Microsoft header for _mm_prefetch() +# endif + #if defined(_MSC_VER) || defined(__INTEL_COMPILER) # define CACHE_LINE_ALIGNMENT __declspec(align(64)) #else @@ -168,16 +172,13 @@ enum Value { VALUE_ENSURE_INTEGER_SIZE_P = INT_MAX, VALUE_ENSURE_INTEGER_SIZE_N = INT_MIN, - PawnValueMidgame = 198, - PawnValueEndgame = 258, - KnightValueMidgame = 817, - KnightValueEndgame = 846, - BishopValueMidgame = 836, - BishopValueEndgame = 857, - RookValueMidgame = 1270, - RookValueEndgame = 1278, - QueenValueMidgame = 2521, - QueenValueEndgame = 2558 + Mg = 0, Eg = 1, + + PawnValueMg = 198, PawnValueEg = 258, + KnightValueMg = 817, KnightValueEg = 846, + BishopValueMg = 836, BishopValueEg = 857, + RookValueMg = 1270, RookValueEg = 1278, + QueenValueMg = 2521, QueenValueEg = 2558 }; enum PieceType { @@ -323,7 +324,7 @@ inline Score apply_weight(Score v, Score w) { namespace Zobrist { - extern Key psq[2][8][64]; // [color][pieceType][square]/[piece count] + extern Key psq[2][8][64]; // [color][pieceType][square / piece count] extern Key enpassant[8]; // [file] extern Key castle[16]; // [castleRight] extern Key side; @@ -332,10 +333,11 @@ namespace Zobrist { void init(); } -extern Score pieceSquareTable[16][64]; -extern int SquareDistance[64][64]; -extern const Value PieceValueMidgame[17]; // Indexed by Piece or PieceType -extern const Value PieceValueEndgame[17]; +CACHE_LINE_ALIGNMENT + +extern Score pieceSquareTable[16][64]; // [piece][square] +extern Value PieceValue[2][18]; // [Mg / Eg][piece / pieceType] +extern int SquareDistance[64][64]; // [square][square] struct MoveStack { Move move;