From 4c74671f734d071fa12d66a69f7a2ed785020337 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 10 Apr 2025 08:35:11 -0400 Subject: [PATCH] Use bit scan intrinsic on ARM64 platform --- include/boost/core/bit.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/core/bit.hpp b/include/boost/core/bit.hpp index cebc878..7520abf 100644 --- a/include/boost/core/bit.hpp +++ b/include/boost/core/bit.hpp @@ -28,7 +28,7 @@ # pragma intrinsic(_BitScanForward) # pragma intrinsic(_BitScanReverse) -# if defined(_M_X64) +# if defined(_M_X64) || defined(_M_ARM64) # pragma intrinsic(_BitScanForward64) # pragma intrinsic(_BitScanReverse64) # endif @@ -230,7 +230,7 @@ inline int countl_impl( boost::uint16_t x ) BOOST_NOEXCEPT #endif -#if defined(_MSC_VER) && defined(_M_X64) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL) +#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL) BOOST_CXX14_CONSTEXPR inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT { @@ -255,7 +255,7 @@ BOOST_CXX14_CONSTEXPR inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT } } -#elif defined(_MSC_VER) && defined(_M_X64) +#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT { @@ -455,7 +455,7 @@ inline int countr_impl( boost::uint16_t x ) BOOST_NOEXCEPT #endif -#if defined(_MSC_VER) && defined(_M_X64) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL) +#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) && defined(BOOST_CORE_HAS_BUILTIN_ISCONSTEVAL) BOOST_CXX14_CONSTEXPR inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT { @@ -480,7 +480,7 @@ BOOST_CXX14_CONSTEXPR inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT } } -#elif defined(_MSC_VER) && defined(_M_X64) +#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT {