From: Erik Faye-Lund Date: Wed, 14 Aug 2019 20:29:24 +0000 (+0200) Subject: util: only allow _BitScanReverse64 on 64-bit cpus X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f82d972ab982a816009228ff62bd5c5434062ca;p=mesa.git util: only allow _BitScanReverse64 on 64-bit cpus While the documentation for _BitScanReverse64 on MSDN says that it's available on ARM, this isn't true. It's only available on ARM64. So let's match reality. Signed-off-by: Erik Faye-Lund Acked-by: Matt Turner --- diff --git a/src/util/bitscan.c b/src/util/bitscan.c index 7858291bf63..88d7f94e119 100644 --- a/src/util/bitscan.c +++ b/src/util/bitscan.c @@ -60,7 +60,7 @@ ffs(int i) #endif #ifdef HAVE___BUILTIN_FFSLL -#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM || _M_IA64) +#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM64 || _M_IA64) #else int ffsll(long long int val) diff --git a/src/util/bitscan.h b/src/util/bitscan.h index 02b3afda7f9..895a1e7a372 100644 --- a/src/util/bitscan.h +++ b/src/util/bitscan.h @@ -72,7 +72,7 @@ int ffs(int i); #ifdef HAVE___BUILTIN_FFSLL #define ffsll __builtin_ffsll -#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM || _M_IA64) +#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM64 || _M_IA64) static inline int ffsll(long long int i) { @@ -235,7 +235,7 @@ util_last_bit64(uint64_t u) { #if defined(HAVE___BUILTIN_CLZLL) return u == 0 ? 0 : 64 - __builtin_clzll(u); -#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM || _M_IA64) +#elif defined(_MSC_VER) && (_M_AMD64 || _M_ARM64 || _M_IA64) unsigned long index; if (_BitScanReverse64(&index, u)) return index + 1;