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

Function transpose8x1_noinline

src/fl/math/transposition.cpp.hpp:19–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17FL_DISABLE_WARNING(cast-align)
18
19void FL_OPTIMIZE_FUNCTION FL_IRAM transpose8x1_noinline(unsigned char *A, unsigned char *B) {
20 u32 x, y, t;
21
22 // Load the array and pack it into x and y.
23 y = *(u32*)(A);
24 x = *(u32*)(A+4);
25
26 // pre-transform x
27 t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7);
28 t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14);
29
30 // pre-transform y
31 t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7);
32 t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14);
33
34 // final transform
35 t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F);
36 y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F);
37 x = t;
38
39 *((u32*)B) = y;
40 *((u32*)(B+4)) = x;
41}
42
43FL_DISABLE_WARNING_POP
44

Callers 2

writeBitsFunction · 0.85
writeBitsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected