Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of intrinsics on windows ARM platforms #928

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions include/boost/json/detail/charconv/detail/emulated128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ struct uint128

static inline std::uint64_t umul64(std::uint32_t x, std::uint32_t y) noexcept
{
#if defined(BOOST_JSON_HAS_MSVC_32BIT_INTRINSICS)
#if defined(BOOST_JSON_HAS_MSVC_32BIT_INTRINSICS) && !defined(_M_ARM)

return __emulu(x, y);
#else

#else

return x * static_cast<std::uint64_t>(y);
#endif

#endif
}

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

#elif defined(BOOST_JSON_HAS_MSVC_64BIT_INTRINSICS)
#elif defined(BOOST_JSON_HAS_MSVC_64BIT_INTRINSICS) && !defined(_M_ARM64)

std::uint64_t high;
std::uint64_t low = _umul128(x, y, &high);
Expand Down
Loading