Feerate comparisons in the recently (#29242) introduced FeeFrac
type rely on multiplications between 32-bit and 64-bit integers. On 64-bit systems, hardware can do this natively. On GCC and Clang we can use the __int128
type for this, but on MSVC one needs to use the _mul128
or _mulh
intrinsics instead. This PR adds the use of _mul128
which is available on x86_64 systems.
Performance of these operations isn’t currently very important, but they will become crucial with cluster mempool.
I have not tested this code myself, though it’s based on similar code in libsecp256k1 (see https://github.com/bitcoin-core/secp256k1/blob/v0.4.1/src/int128_struct_impl.h#L7L30).