]> git.sesse.net Git - stockfish/blobdiff - src/bitcount.h
Fix POPCNT support for Intel compiler under Windows
[stockfish] / src / bitcount.h
index 0992c00625e084ecc1fa78110ccef0c04a500166..3c5ba2a1fa4004e40905e0b2514d76d4ab1518ee 100644 (file)
@@ -85,6 +85,8 @@ template<>
 inline int count_1s<CNT_POPCNT>(Bitboard b) {
 #if !defined(USE_POPCNT)
   return int(b != 0); // Avoid 'b not used' warning
 inline int count_1s<CNT_POPCNT>(Bitboard b) {
 #if !defined(USE_POPCNT)
   return int(b != 0); // Avoid 'b not used' warning
+#elif defined(_MSC_VER) && defined(__INTEL_COMPILER)
+  return _mm_popcnt_u64(b);
 #elif defined(_MSC_VER)
   return __popcnt64(b);
 #elif defined(__GNUC__)
 #elif defined(_MSC_VER)
   return __popcnt64(b);
 #elif defined(__GNUC__)