mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Use compiler intrinsic instead of assembly for popcnt
This time, do not break compatibility with some AMD machines that have SSE3 and popcnt, but do not have SSE4.2. No functional change.
This commit is contained in:
@@ -285,7 +285,7 @@ endif
|
|||||||
|
|
||||||
### 3.9 popcnt
|
### 3.9 popcnt
|
||||||
ifeq ($(popcnt),yes)
|
ifeq ($(popcnt),yes)
|
||||||
CXXFLAGS += -msse3 -DUSE_POPCNT
|
CXXFLAGS += -msse3 -mpopcnt -DUSE_POPCNT
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### 3.10 pext
|
### 3.10 pext
|
||||||
|
|||||||
@@ -96,8 +96,7 @@ inline int popcount<CNT_HW_POPCNT>(Bitboard b) {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
__asm__("popcnt %1, %0" : "=r" (b) : "r" (b));
|
return __builtin_popcountll(b);
|
||||||
return b;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user