mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 14:27:45 +00:00
Fix POPCNT support for Intel compiler under Windows
Reported by Martin Wyngaarden that also confirmed this patch to work. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -85,6 +85,8 @@ template<>
|
|||||||
inline int count_1s<CNT_POPCNT>(Bitboard b) {
|
inline int count_1s<CNT_POPCNT>(Bitboard b) {
|
||||||
#if !defined(USE_POPCNT)
|
#if !defined(USE_POPCNT)
|
||||||
return int(b != 0); // Avoid 'b not used' warning
|
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)
|
#elif defined(_MSC_VER)
|
||||||
return __popcnt64(b);
|
return __popcnt64(b);
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ typedef uint64_t Bitboard;
|
|||||||
#define USE_BSFQ
|
#define USE_BSFQ
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Intel header for _mm_popcnt_u64() intrinsic
|
||||||
|
#if defined(USE_POPCNT) && defined(_MSC_VER) && defined(__INTEL_COMPILER)
|
||||||
|
#include <nmmintrin.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Cache line alignment specification
|
// Cache line alignment specification
|
||||||
#if defined(_MSC_VER) || defined(__INTEL_COMPILER)
|
#if defined(_MSC_VER) || defined(__INTEL_COMPILER)
|
||||||
#define CACHE_LINE_ALIGNMENT __declspec(align(64))
|
#define CACHE_LINE_ALIGNMENT __declspec(align(64))
|
||||||
|
|||||||
Reference in New Issue
Block a user