mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Retire __popcnt64 intrinsic
Just use _mm_popcnt_u64() that is available both for MSVC abd Intel compiler. Verified on MSVC that the produced assembly has the hardware 'popcnt' instruction. No functional change.
This commit is contained in:
@@ -272,10 +272,6 @@ inline int popcount(Bitboard b) {
|
|||||||
|
|
||||||
return (int)_mm_popcnt_u64(b);
|
return (int)_mm_popcnt_u64(b);
|
||||||
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
|
|
||||||
return (int)__popcnt64(b);
|
|
||||||
|
|
||||||
#else // Assumed gcc or compatible compiler
|
#else // Assumed gcc or compatible compiler
|
||||||
|
|
||||||
return __builtin_popcountll(b);
|
return __builtin_popcountll(b);
|
||||||
|
|||||||
@@ -60,12 +60,12 @@
|
|||||||
/// _WIN64 Building on Windows 64 bit
|
/// _WIN64 Building on Windows 64 bit
|
||||||
|
|
||||||
#if defined(_WIN64) && defined(_MSC_VER) // No Makefile used
|
#if defined(_WIN64) && defined(_MSC_VER) // No Makefile used
|
||||||
# include <intrin.h> // MSVC popcnt and bsfq instrinsics
|
# include <intrin.h> // Microsoft header for _BitScanForward64()
|
||||||
# define IS_64BIT
|
# define IS_64BIT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
|
#if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
|
||||||
# include <nmmintrin.h> // Intel header for _mm_popcnt_u64() intrinsic
|
# include <nmmintrin.h> // Intel and Microsoft header for _mm_popcnt_u64()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
|
#if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
|
||||||
|
|||||||
Reference in New Issue
Block a user