]> git.sesse.net Git - stockfish/commitdiff
Retire __popcnt64 intrinsic
authorMarco Costalba <mcostalba@gmail.com>
Sun, 1 May 2016 16:18:10 +0000 (18:18 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 5 May 2016 07:09:07 +0000 (09:09 +0200)
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.

src/bitboard.h
src/types.h

index a0f7ea8d69b0bfe325f4ceb060d0a91f49055210..390966e3494273969bdb53a50c6953a6c9782611 100644 (file)
@@ -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
 
   return __builtin_popcountll(b);
 #else // Assumed gcc or compatible compiler
 
   return __builtin_popcountll(b);
index e45d2674fe70a1b3d293d7d848404f621c4de10c..10dfdb07183d1a09c7f8b281f8b71bb1e7301445 100644 (file)
 /// _WIN64             Building on Windows 64 bit
 
 #if defined(_WIN64) && defined(_MSC_VER) // No Makefile used
 /// _WIN64             Building on Windows 64 bit
 
 #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
 #endif
 
 #if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
 #  define IS_64BIT
 #endif
 
 #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
 
 #if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
 #endif
 
 #if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))