summaryrefslogtreecommitdiff
path: root/absl/numeric/internal
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2020-12-22 06:25:57 -0800
committerGravatar Derek Mauro <dmauro@google.com>2020-12-22 10:42:56 -0500
commit4611a601a7ce8d5aad169417092e3d5027aa8403 (patch)
tree8b1b4d2c97f495d974fd6d0deb74c0b2a26c4798 /absl/numeric/internal
parent8a9ef3c5da2a9064dda0ac3c61b43b87c12c50b8 (diff)
Export of internal Abseil changes
-- be02479c8f5ddf18f0d711e86648a2a0a9823fb6 by Gennadiy Rozental <rogeeff@google.com>: Suppress MSVC warning about unused return value PiperOrigin-RevId: 348624511 -- 10e6da15e34d84d314fc1eca1bcdeb96538a04d1 by Derek Mauro <dmauro@google.com>: Add additional information to README.md PiperOrigin-RevId: 348562436 -- 57283e13d221d9a3f6678a1c6db1a41b4421b938 by Jorg Brown <jorg@google.com>: Tweaks for better AArch64 support under MSVC PiperOrigin-RevId: 348518028 -- 48cb64ed90c71db6342dcf478a03bbb419b98500 by Christian Blichmann <cblichmann@google.com>: Internal change PiperOrigin-RevId: 348480642 GitOrigin-RevId: be02479c8f5ddf18f0d711e86648a2a0a9823fb6 Change-Id: I3614bf846ad1b99e34f507346da1252c6bbc13ba
Diffstat (limited to 'absl/numeric/internal')
-rw-r--r--absl/numeric/internal/bits.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/absl/numeric/internal/bits.h b/absl/numeric/internal/bits.h
index 50828156..af45700f 100644
--- a/absl/numeric/internal/bits.h
+++ b/absl/numeric/internal/bits.h
@@ -23,12 +23,6 @@
// windows intrinsic functions.
#if defined(_MSC_VER) && !defined(__clang__)
#include <intrin.h>
-#if defined(_M_X64)
-#pragma intrinsic(_BitScanReverse64)
-#pragma intrinsic(_BitScanForward64)
-#endif
-#pragma intrinsic(_BitScanReverse)
-#pragma intrinsic(_BitScanForward)
#endif
#include "absl/base/attributes.h"
@@ -185,7 +179,8 @@ CountLeadingZeroes64(uint64_t x) {
// Handle 0 as a special case because __builtin_clzll(0) is undefined.
return x == 0 ? 64 : __builtin_clzll(x);
-#elif defined(_MSC_VER) && !defined(__clang__) && defined(_M_X64)
+#elif defined(_MSC_VER) && !defined(__clang__) && \
+ (defined(_M_X64) || defined(_M_ARM64))
// MSVC does not have __buitin_clzll. Use _BitScanReverse64.
unsigned long result = 0; // NOLINT(runtime/int)
if (_BitScanReverse64(&result, x)) {
@@ -271,7 +266,8 @@ CountTrailingZeroesNonzero64(uint64_t x) {
static_assert(sizeof(unsigned long long) == sizeof(x), // NOLINT(runtime/int)
"__builtin_ctzll does not take 64-bit arg");
return __builtin_ctzll(x);
-#elif defined(_MSC_VER) && !defined(__clang__) && defined(_M_X64)
+#elif defined(_MSC_VER) && !defined(__clang__) && \
+ (defined(_M_X64) || defined(_M_ARM64))
unsigned long result = 0; // NOLINT(runtime/int)
_BitScanForward64(&result, x);
return result;