Skip to content

Commit c4ce850

Browse files
committed
Fix use of intrinsics on windows ARM platforms
1 parent e084a29 commit c4ce850

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

include/boost/json/detail/charconv/detail/emulated128.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,15 @@ struct uint128
5858

5959
static inline std::uint64_t umul64(std::uint32_t x, std::uint32_t y) noexcept
6060
{
61-
#if defined(BOOST_JSON_HAS_MSVC_32BIT_INTRINSICS)
61+
#if defined(BOOST_JSON_HAS_MSVC_32BIT_INTRINSICS) && !defined(_M_ARM64)
62+
6263
return __emulu(x, y);
63-
#else
64+
65+
#else
66+
6467
return x * static_cast<std::uint64_t>(y);
65-
#endif
68+
69+
#endif
6670
}
6771

6872
// Get 128-bit result of multiplication of two 64-bit unsigned integers.
@@ -73,7 +77,7 @@ BOOST_JSON_SAFEBUFFERS inline uint128 umul128(std::uint64_t x, std::uint64_t y)
7377
auto result = static_cast<boost::uint128_type>(x) * static_cast<boost::uint128_type>(y);
7478
return {static_cast<std::uint64_t>(result >> 64), static_cast<std::uint64_t>(result)};
7579

76-
#elif defined(BOOST_JSON_HAS_MSVC_64BIT_INTRINSICS)
80+
#elif defined(BOOST_JSON_HAS_MSVC_64BIT_INTRINSICS) && !defined(_M_ARM64)
7781

7882
std::uint64_t high;
7983
std::uint64_t low = _umul128(x, y, &high);

0 commit comments

Comments
 (0)