From 57919cea2097909b772fb79bb2bc64260aec37d7 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 21 Feb 2023 10:33:06 -0800 Subject: [PATCH] Change x86 intrinsic to work with 32bit environment --- include/boost/charconv/detail/leading_zeros.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/charconv/detail/leading_zeros.hpp b/include/boost/charconv/detail/leading_zeros.hpp index c928fee..c56ed90 100644 --- a/include/boost/charconv/detail/leading_zeros.hpp +++ b/include/boost/charconv/detail/leading_zeros.hpp @@ -76,7 +76,7 @@ inline int leading_zeros(std::uint64_t val) noexcept return static_cast(63 - leading_zero); } #elif defined(BOOST_CHARCONV_HAS_X86_INTRINSICS) - return static_cast(_lzcnt_u64(val);) + return static_cast(__builtin_clzll(val)); #elif defined(BOOST_CHARCONV_HAS_ARM_INTRINSICS) // CLZ Xd, Xm return __builtin_clzll(val);