summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-08-14 22:29:24 +0200
committerErik Faye-Lund <[email protected]>2019-09-02 12:45:45 +0000
commit2f82d972ab982a816009228ff62bd5c5434062ca (patch)
treee3b75970e71d246580ccba913a4f5451f5f2d2c2
parent1de9ba33a232c637121f5d2a5d0a43ff43fbb0b6 (diff)
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 <[email protected]> Acked-by: Matt Turner <[email protected]>
-rw-r--r--src/util/bitscan.c2
-rw-r--r--src/util/bitscan.h4
2 files changed, 3 insertions, 3 deletions
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;