diff --git a/AK/FloatingPointStringConversions.cpp b/AK/FloatingPointStringConversions.cpp index 0dfddd17469..202d09c928c 100644 --- a/AK/FloatingPointStringConversions.cpp +++ b/AK/FloatingPointStringConversions.cpp @@ -1227,14 +1227,7 @@ static i32 decimal_exponent_to_binary_exponent(i32 exponent) static u128 multiply(u64 a, u64 b) { -#ifdef __SIZEOF_INT128__ - unsigned __int128 result = (unsigned __int128)a * b; - u64 low = result; - u64 high = result >> 64; - return u128 { low, high }; -#else - return u128 { a }.wide_multiply(u128 { b }).low; -#endif + return UFixedBigInt<64>(a).wide_multiply(b); } template @@ -1249,10 +1242,7 @@ u128 multiplication_approximation(u64 value, i32 exponent) if ((lower_result.high() & mask) == mask) { auto upper_result = multiply(z.low(), value); - lower_result.low() += upper_result.high(); - if (upper_result.high() > lower_result.low()) { - ++lower_result.high(); - } + lower_result += upper_result.high(); } return lower_result; diff --git a/AK/StringFloatingPointConversions.cpp b/AK/StringFloatingPointConversions.cpp index ad04bce760e..85f3c8358b1 100644 --- a/AK/StringFloatingPointConversions.cpp +++ b/AK/StringFloatingPointConversions.cpp @@ -171,25 +171,14 @@ FloatingPointExponentialForm inner_convert_floating_point_to_decimal_exponential static u128 multiply(u64 a, u64 b) { -#ifdef __SIZEOF_INT128__ - unsigned __int128 result = (unsigned __int128)a * b; - u64 low = result; - u64 high = result >> 64; - return u128 { low, high }; -#else - return u128 { a }.wide_multiply(u128 { b }).low; -#endif + return UFixedBigInt<64>(a).wide_multiply(b); } template<> FloatingPointExponentialForm convert_floating_point_to_decimal_exponential_form(float value) { auto multiply_and_shift = [](u64 operand, u64 multiplier, i32 shift) { -#ifdef __SIZEOF_INT128__ - auto result = (unsigned __int128)operand * multiplier; -#else auto result = multiply(operand, multiplier); -#endif if (shift < 0) return static_cast(result << static_cast(-shift)); else diff --git a/Userland/Libraries/LibCrypto/Curves/SECP256r1.cpp b/Userland/Libraries/LibCrypto/Curves/SECP256r1.cpp index f647c07c1b6..91ff20a00af 100644 --- a/Userland/Libraries/LibCrypto/Curves/SECP256r1.cpp +++ b/Userland/Libraries/LibCrypto/Curves/SECP256r1.cpp @@ -57,8 +57,7 @@ static u256 select(u256 const& left, u256 const& right, bool condition) static u512 multiply(u256 const& left, u256 const& right) { - auto result = left.wide_multiply(right); - return { result.low, result.high }; + return left.wide_multiply(right); } static u256 modular_reduce(u256 const& value)