Fix _umul128 pointer type

This commit is contained in:
Matt Borland
2023-06-29 09:24:05 +02:00
parent 038b885581
commit a0bbacebb2
2 changed files with 5 additions and 3 deletions

View File

@@ -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<std::uint64_t>(high), low};
// https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/UMULH
#elif defined(__arm__)

View File

@@ -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<uint64_t>(high);
#elif defined(BOOST_CHARCONV_FASTFLOAT_64BIT)
__uint128_t r = ((__uint128_t)a) * b;
answer.low = uint64_t(r);