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

◆ polyClz32()

int fl::gfx::detail::polyClz32 ( fl::u32 v)
inline

Count leading zeros of a non-zero 32-bit value (branch form: portable to MSVC where __builtin_clz is unavailable, and branch-free on x86).

Definition at line 402 of file primitives.h.

402 {
403 int n = 0;
404 if ((v & 0xFFFF0000u) == 0) { n = 16; v <<= 16; }
405 if ((v & 0xFF000000u) == 0) { n += 8; v <<= 8; }
406 if ((v & 0xF0000000u) == 0) { n += 4; v <<= 4; }
407 if ((v & 0xC0000000u) == 0) { n += 2; v <<= 2; }
408 if ((v & 0x80000000u) == 0) { n += 1; }
409 return n;
410}

References fl::FL_NO_EXCEPT, and polyClz32().

Referenced by polyClz32(), and polyTopBit128().

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