Skip to content

Commit 2dd24dc

Browse files
erbsenzaehlermcostalba
authored andcommitted
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
1 parent 8f934df commit 2dd24dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bitboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ inline int popcount(Bitboard b) {
268268
union { Bitboard bb; uint16_t u[4]; } v = { b };
269269
return PopCnt16[v.u[0]] + PopCnt16[v.u[1]] + PopCnt16[v.u[2]] + PopCnt16[v.u[3]];
270270

271-
#elif defined(_MSC_VER) && defined(__INTEL_COMPILER)
271+
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
272272

273273
return _mm_popcnt_u64(b);
274274

src/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# define IS_64BIT
6565
#endif
6666

67-
#if defined(USE_POPCNT) && defined(__INTEL_COMPILER) && defined(_MSC_VER)
67+
#if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
6868
# include <nmmintrin.h> // Intel header for _mm_popcnt_u64() intrinsic
6969
#endif
7070

0 commit comments

Comments
 (0)