From 449fcfed7547a9203a7f44afd37835d373268201 Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Tue, 12 Feb 2019 22:15:35 +0300 Subject: [PATCH] Fix for GCC on ARM 32/64-bit --- src/gemm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gemm.c b/src/gemm.c index 33b6fa20..022f1322 100644 --- a/src/gemm.c +++ b/src/gemm.c @@ -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;