From: lucasart Date: Tue, 1 Jul 2014 12:46:16 +0000 (+0800) Subject: Use compiler intrinsic instead of assembly for popcnt X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a69f1d7c2060dc7b320a7b4801105df00b22a96a;ds=inline Use compiler intrinsic instead of assembly for popcnt No functional change. --- diff --git a/src/Makefile b/src/Makefile index 187e7b31..562192ca 100644 --- a/src/Makefile +++ b/src/Makefile @@ -285,7 +285,7 @@ endif ### 3.9 popcnt ifeq ($(popcnt),yes) - CXXFLAGS += -msse3 -DUSE_POPCNT + CXXFLAGS += -msse4.2 -DUSE_POPCNT endif ### 3.10 pext diff --git a/src/bitcount.h b/src/bitcount.h index f84c51cb..9feed19f 100644 --- a/src/bitcount.h +++ b/src/bitcount.h @@ -96,8 +96,7 @@ inline int popcount(Bitboard b) { #else - __asm__("popcnt %1, %0" : "=r" (b) : "r" (b)); - return b; + return __builtin_popcountll(b); #endif }