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

_umul128() is not available on arm64 #926

Closed
liubing opened this issue Aug 11, 2023 · 0 comments · Fixed by #928
Closed

_umul128() is not available on arm64 #926

liubing opened this issue Aug 11, 2023 · 0 comments · Fixed by #928

Comments

@liubing
Copy link

liubing commented Aug 11, 2023

Version of Boost

boost 1.83beta

Steps necessary to reproduce the problem

Compile the library on arm64 / windows platform.

All relevant compiler information

Error message:

D:\Projects\pts\pts\include\boost\json\detail\charconv\detail\emulated128.hpp(79): error C3861: '_umul128': identifier not found

It can be fixed changing

    #elif defined(BOOST_JSON_HAS_MSVC_64BIT_INTRINSICS)

    std::uint64_t high;
    std::uint64_t low = _umul128(x, y, &high);
    return {high, low};

    // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/UMULH
    #elif defined(__arm__)

to

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

    std::uint64_t high;
    std::uint64_t low = _umul128(x, y, &high);
    return {high, low};

    // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/UMULH
    #elif defined(__arm__)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant