X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitcount.h;h=c6e969a82411d4b37dc1633e512ca5873d4a2912;hp=4016063383938fe7fbcc9309ff9767a2bfec6a7c;hb=ce5d9eb19da890c77d8ef00e078c60edc3e8e4aa;hpb=e7d3a006cda7822517159cad0ef222eb7e46db00 diff --git a/src/bitcount.h b/src/bitcount.h index 40160633..c6e969a8 100644 --- a/src/bitcount.h +++ b/src/bitcount.h @@ -22,6 +22,12 @@ #if !defined(BITCOUNT_H_INCLUDED) #define BITCOUNT_H_INCLUDED +// To disable POPCNT support uncomment following line. You should do it only +// in PGO compiling to exercise the default fallback path. Don't forget to +// re-comment the line for the final optimized compile though ;-) +//#define DISABLE_POPCNT_SUPPORT + + #include "bitboard.h" @@ -48,7 +54,7 @@ // Select type of intrinsic bit count instruction to use -#if defined(_MSC_VER) // Microsoft compiler +#if defined(_MSC_VER) && defined(_WIN64) // Microsoft compiler #include @@ -160,8 +166,21 @@ inline int count_1s_max_15(Bitboard b) { // Global variable initialized at startup that is set to true if -// CPU on which application runs support POPCNT intrinsic. - +// CPU on which application runs supports POPCNT intrinsic. Unless +// DISABLE_POPCNT_SUPPORT is defined. +#if defined(DISABLE_POPCNT_SUPPORT) +const bool CpuHasPOPCNT = false; +#else const bool CpuHasPOPCNT = cpu_has_popcnt(); +#endif + + +// Global variable used to print info about the use of 64 optimized +// functions to verify that a 64bit compile has been correctly built. +#if defined(BITCOUNT_SWAR_64) +const bool CpuHas64BitPath = true; +#else +const bool CpuHas64BitPath = false; +#endif #endif // !defined(BITCOUNT_H_INCLUDED)