]> git.sesse.net Git - stockfish/commitdiff
Use compiler intrinsic instead of assembly for popcnt
authorlucasart <lucas.braesch@gmail.com>
Tue, 1 Jul 2014 12:46:16 +0000 (20:46 +0800)
committerlucasart <lucas.braesch@gmail.com>
Tue, 1 Jul 2014 12:50:33 +0000 (20:50 +0800)
No functional change.

src/Makefile
src/bitcount.h

index 187e7b313404fb5df608a62eba6d38cd81b546fc..562192ca6150690e1216257cb668ab1d634939da 100644 (file)
@@ -285,7 +285,7 @@ endif
 
 ### 3.9 popcnt
 ifeq ($(popcnt),yes)
 
 ### 3.9 popcnt
 ifeq ($(popcnt),yes)
-       CXXFLAGS += -msse3 -DUSE_POPCNT
+       CXXFLAGS += -msse4.2 -DUSE_POPCNT
 endif
 
 ### 3.10 pext
 endif
 
 ### 3.10 pext
index f84c51cb8596caf76e658d126330c898dafde7f8..9feed19f9755a94be0022f3e9cf5c891972589d0 100644 (file)
@@ -96,8 +96,7 @@ inline int popcount<CNT_HW_POPCNT>(Bitboard b) {
 
 #else
 
 
 #else
 
-  __asm__("popcnt %1, %0" : "=r" (b) : "r" (b));
-  return b;
+  return __builtin_popcountll(b);
 
 #endif
 }
 
 #endif
 }