On 2/23/20 11:07 PM, Robert Hoo wrote: > Inspired by your suggestion, I'm thinking go further: use immediate > rather than a global variable, so that saves 1 memory(/cache) access. > > #ifdef CONFIG_AVX512F_OPT > #define OPTIMIZE_LEN 256 > #else > #define OPTIMIZE_LEN 64 > #endif
With that, the testing in tests/test-bufferiszero.c, looping through the implementations, is invalidated. Because once you start compiling for avx512, you're no longer testing sse2 et al with the same inputs. IF we want to change the length to suit avx512, we would want to change it unconditionally. And then you could also tidy up avx2 to avoid the extra comparisons there. r~