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

◆ polyABPop8()

fl::u8 fl::gfx::detail::polyABPop8 ( fl::u8 v)
inline

Popcount of a byte.

AVR: 256 B PROGMEM LUT (4 lookups per u32); the blog's memory budget explicitly allows small LUTs. Host: builtin.

Definition at line 191 of file poly_abuffer.h.

191 {
192#if defined(__AVR__)
194#elif defined(__GNUC__) || defined(__clang__)
195 return (fl::u8)__builtin_popcount((unsigned)v);
196#else
197 v = v - ((v >> 1) & 0x55u);
198 v = (v & 0x33u) + ((v >> 2) & 0x33u);
199 return (fl::u8)((v + (v >> 4)) & 0x0Fu);
200#endif
201}
#define FL_PGM_READ_BYTE_NEAR(x)
Read a byte (8-bit) from PROGMEM memory.
unsigned char u8
Definition s16x16x4.h:132
const fl::u8 * polyABPop8Table() FL_NO_EXCEPT

References fl::FL_NO_EXCEPT, FL_PGM_READ_BYTE_NEAR, and polyABPop8Table().

Referenced by polyABPopcount32().

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