MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / umul128_generic

Function umul128_generic

Source/external/fast_float.h:355–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355fastfloat_really_inline FASTFLOAT_CONSTEXPR14
356uint64_t umul128_generic(uint64_t ab, uint64_t cd, uint64_t *hi) {
357 uint64_t ad = emulu((uint32_t)(ab >> 32), (uint32_t)cd);
358 uint64_t bd = emulu((uint32_t)ab, (uint32_t)cd);
359 uint64_t adbc = ad + emulu((uint32_t)ab, (uint32_t)(cd >> 32));
360 uint64_t adbc_carry = !!(adbc < ad);
361 uint64_t lo = bd + (adbc << 32);
362 *hi = emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) +
363 (adbc_carry << 32) + !!(lo < bd);
364 return lo;
365}
366
367#ifdef FASTFLOAT_32BIT
368

Callers 2

_umul128Function · 0.85
full_multiplicationFunction · 0.85

Calls 1

emuluFunction · 0.85

Tested by

no test coverage detected