FastLED 3.10.10
Loading...
Searching...
No Matches

◆ polyMul128()

void fl::gfx::detail::polyMul128 ( fl::u64 a,
fl::u64 b,
fl::u64 & hi,
fl::u64 & lo )
inline

Multiply two unsigned values < 2^48, returning the 128-bit product as a (hi, lo) u64 pair.

32-bit lanes — no __int128 (MSVC host portability).

Definition at line 344 of file primitives.h.

344 {
345 const fl::u32 a0 = (fl::u32)a, a1 = (fl::u32)(a >> 32);
346 const fl::u32 b0 = (fl::u32)b, b1 = (fl::u32)(b >> 32);
347 const fl::u64 p0 = (fl::u64)a0 * b0;
348 const fl::u64 p1 = (fl::u64)a0 * b1 + (fl::u64)a1 * b0;
349 const fl::u64 low = p0 + (p1 << 32);
350 hi = (fl::u64)a1 * b1 + (p1 >> 32) + (low < p0 ? 1u : 0u);
351 lo = low;
352}
fl::u64 u64
Definition s16x16x4.h:221

References fl::FL_NO_EXCEPT, and polyMul128().

Referenced by polyLineT28(), and polyMul128().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: