From a0bbacebb270c4169647263ea824cccf9e478ccb Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 29 Jun 2023 09:24:05 +0200 Subject: [PATCH] Fix _umul128 pointer type --- include/boost/charconv/detail/emulated128.hpp | 4 ++-- include/boost/charconv/detail/fast_float/float_common.hpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/boost/charconv/detail/emulated128.hpp b/include/boost/charconv/detail/emulated128.hpp index 2c461de..297275b 100644 --- a/include/boost/charconv/detail/emulated128.hpp +++ b/include/boost/charconv/detail/emulated128.hpp @@ -792,9 +792,9 @@ BOOST_CHARCONV_SAFEBUFFERS inline uint128 umul128(std::uint64_t x, std::uint64_t #elif defined(BOOST_CHARCONV_HAS_MSVC_64BIT_INTRINSICS) - std::uint64_t high; + unsigned long long high; std::uint64_t low = _umul128(x, y, &high); - return {high, low}; + return {static_cast(high), low}; // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/UMULH #elif defined(__arm__) diff --git a/include/boost/charconv/detail/fast_float/float_common.hpp b/include/boost/charconv/detail/fast_float/float_common.hpp index 5582baf..2011675 100644 --- a/include/boost/charconv/detail/fast_float/float_common.hpp +++ b/include/boost/charconv/detail/fast_float/float_common.hpp @@ -250,7 +250,9 @@ value128 full_multiplication(uint64_t a, uint64_t b) { answer.high = __umulh(a, b); answer.low = a * b; #elif defined(BOOST_CHARCONV_FASTFLOAT_32BIT) || (defined(_WIN64) && !defined(__clang__)) - answer.low = _umul128(a, b, &answer.high); // _umul128 not available on ARM64 + unsigned long long high; + answer.low = _umul128(a, b, &high); // _umul128 not available on ARM64 + answer.high = static_cast(high); #elif defined(BOOST_CHARCONV_FASTFLOAT_64BIT) __uint128_t r = ((__uint128_t)a) * b; answer.low = uint64_t(r);