]> git.sesse.net Git - stockfish/commitdiff
Revert "Use compiler intrinsic instead of assembly for popcnt"
authorGary Linscott <glinscott@gmail.com>
Tue, 1 Jul 2014 21:01:54 +0000 (17:01 -0400)
committerGary Linscott <glinscott@gmail.com>
Tue, 1 Jul 2014 21:01:54 +0000 (17:01 -0400)
This reverts commit a69f1d7c2060dc7b320a7b4801105df00b22a96a.

src/Makefile
src/bitcount.h

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