diff --git a/include/fmt/format.h b/include/fmt/format.h index 4104d91f..4b65f7a0 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1486,7 +1486,13 @@ template class to_utf8 { // Computes 128-bit result of multiplication of two 64-bit unsigned integers. inline uint128_fallback umul128(uint64_t x, uint64_t y) noexcept { -#if FMT_USE_INT128 +#if __x86_64__ + uint64_t hi, lo; + __asm__( "mulq %[y] \n" + : "=a"(lo), "=d"(hi) + : [y] "r"(y), "a"(x), "d"(0)); + return {hi, lo}; +#elif FMT_USE_INT128 auto p = static_cast(x) * static_cast(y); return {static_cast(p >> 64), static_cast(p)}; #elif defined(_MSC_VER) && defined(_M_X64)