From: Marco Costalba Date: Sun, 1 May 2016 16:18:10 +0000 (+0200) Subject: Retire __popcnt64 intrinsic X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=5e4cd3fc0d4b88eeb09ae458b9cb9f73db8c4ae7;ds=sidebyside 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. --- diff --git a/src/bitboard.h b/src/bitboard.h index a0f7ea8d..390966e3 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -272,10 +272,6 @@ inline int popcount(Bitboard b) { return (int)_mm_popcnt_u64(b); -#elif defined(_MSC_VER) - - return (int)__popcnt64(b); - #else // Assumed gcc or compatible compiler return __builtin_popcountll(b); diff --git a/src/types.h b/src/types.h index e45d2674..10dfdb07 100644 --- a/src/types.h +++ b/src/types.h @@ -60,12 +60,12 @@ /// _WIN64 Building on Windows 64 bit #if defined(_WIN64) && defined(_MSC_VER) // No Makefile used -# include // MSVC popcnt and bsfq instrinsics +# include // Microsoft header for _BitScanForward64() # define IS_64BIT #endif #if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER)) -# include // Intel header for _mm_popcnt_u64() intrinsic +# include // Intel and Microsoft header for _mm_popcnt_u64() #endif #if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))