A small tip, broadcasting from memory is often free. For lookup tables like that I typically define a global variable like that:
static const __m128i g_lookup = _mm_setr_epi8( ... );
A small tip, broadcasting from memory is often free. For lookup tables like that I typically define a global variable like that:
And then in the function, before the main loop, I use `_mm256_broadcastsi128_si256` to load + broadcast the 16-byte vector in 1 instruction.