MCPcopy Create free account
hub / github.com/FastLED/FastLED / mul_hi_u64

Function mul_hi_u64

src/fl/stl/ieee754_string.cpp.hpp:242–253  ·  view source on GitHub ↗

Top 64 bits of the 128-bit product of two u64 values, computed via four 32x32->64 widening multiplies. Portable to every Cortex-M target -- uses only integer ops, never the libgcc soft-FP cascade.

Source from the content-addressed store, hash-verified

240// 32x32->64 widening multiplies. Portable to every Cortex-M target -- uses
241// only integer ops, never the libgcc soft-FP cascade.
242inline fl::u64 mul_hi_u64(fl::u64 a, fl::u64 b) FL_NOEXCEPT {
243 const fl::u64 ah = a >> 32;
244 const fl::u64 al = a & 0xFFFFFFFFull;
245 const fl::u64 bh = b >> 32;
246 const fl::u64 bl = b & 0xFFFFFFFFull;
247 const fl::u64 ll = al * bl;
248 const fl::u64 hl = ah * bl;
249 const fl::u64 lh = al * bh;
250 const fl::u64 hh = ah * bh;
251 const fl::u64 mid = (ll >> 32) + (hl & 0xFFFFFFFFull) + (lh & 0xFFFFFFFFull);
252 return hh + (hl >> 32) + (lh >> 32) + (mid >> 32);
253}
254
255constexpr fl::u32 kSignBitMask = 0x80000000u;
256constexpr fl::u32 kInfBitsPos = 0x7F800000u;

Callers 2

ieee754_parse_decimalFunction · 0.85
ieee754_format_decimalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected