File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 3737 */
3838struct FeeFrac
3939{
40- /* * Fallback version for Mul (see below).
41- *
42- * Separate to permit testing on platforms where it isn't actually needed.
43- */
40+ /* * Helper function for 32*64 signed multiplication, returning an unspecified but totally
41+ * ordered type. This is a fallback version, separate so it can be tested on platforms where
42+ * it isn't actually needed. */
4443 static inline std::pair<int64_t , uint32_t > MulFallback (int64_t a, int32_t b) noexcept
4544 {
46- // Otherwise, emulate 96-bit multiplication using two 64-bit multiplies.
4745 int64_t low = int64_t {static_cast <uint32_t >(a)} * b;
4846 int64_t high = (a >> 32 ) * b;
4947 return {high + (low >> 32 ), static_cast <uint32_t >(low)};
5048 }
5149
52- // Compute a * b, returning an unspecified but totally ordered type.
5350#ifdef __SIZEOF_INT128__
51+ /* * Helper function for 32*64 signed multiplication, returning an unspecified but totally
52+ * ordered type. This is a version relying on __int128. */
5453 static inline __int128 Mul (int64_t a, int32_t b) noexcept
5554 {
56- // If __int128 is available, use 128-bit wide multiply.
5755 return __int128{a} * b;
5856 }
5957#else
You can’t perform that action at this time.
0 commit comments