From 2dd24dc4e618dc7b83799890fe7e84b09b6456b4 Mon Sep 17 00:00:00 2001 From: erbsenzaehler Date: Sun, 1 May 2016 10:57:50 +0200 Subject: [PATCH] Use popcount intrinsic with Interl compiler It seems that icc used our fallback version of popcount. Now use intrinsics. icc version 16.0.2 (gcc version 5.3.0 compatibility) bmi2 compile uname -r 4.5.1-1-ARCH 20xbench gives a nice speedup ./stockfish-icc-master 2161515 +- 34462 ./stockfish-icc-sse42 2260857 +- 50349 --- src/bitboard.h | 2 +- src/types.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bitboard.h b/src/bitboard.h index a704edbe..c4fc26e1 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -268,7 +268,7 @@ inline int popcount(Bitboard b) { union { Bitboard bb; uint16_t u[4]; } v = { b }; return PopCnt16[v.u[0]] + PopCnt16[v.u[1]] + PopCnt16[v.u[2]] + PopCnt16[v.u[3]]; -#elif defined(_MSC_VER) && defined(__INTEL_COMPILER) +#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) return _mm_popcnt_u64(b); diff --git a/src/types.h b/src/types.h index 6f62c776..e45d2674 100644 --- a/src/types.h +++ b/src/types.h @@ -64,7 +64,7 @@ # define IS_64BIT #endif -#if defined(USE_POPCNT) && defined(__INTEL_COMPILER) && defined(_MSC_VER) +#if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER)) # include // Intel header for _mm_popcnt_u64() intrinsic #endif -- 2.39.2