Fix for GCC on ARM 32/64-bit

This commit is contained in:
AlexeyAB
2019-02-12 22:15:35 +03:00
parent 00e992a600
commit 449fcfed75

View File

@ -2065,11 +2065,11 @@ static inline int popcnt_64(uint64_t val64) {
tmp_count += __popcnt(val64 >> 32);
#endif
#else // Linux
#ifdef __x86_64__ // Linux 64-bit
#if defined(__x86_64__) || defined(__aarch64__) // Linux 64-bit
int tmp_count = __builtin_popcountll(val64);
#else // Linux 32-bit
int tmp_count = __builtin_popcount(val64);
tmp_count += __builtin_popcount(val64);
tmp_count += __builtin_popcount(val64 >> 32);
#endif
#endif
return tmp_count;