https://github.com/BurntSushi/aho-corasick/blob/f227162f7c56...
But no `_mm256_sad_epu8`. What an oddly specific question..?
It computes `sum(|x[i] - y[i]|)` for consecutive `i` at different offsets, so it should be zero at substring matches.
For context: https://epubs.siam.org/doi/pdf/10.1137/1.9781611972931.10
I was slightly mistaken, the instruction of interest is _mm256_mpsadbw_epu8
I mentioned exactly that paper (I believe) in my write-up on Teddy: https://github.com/BurntSushi/aho-corasick/tree/master/src/p...
[1] http://0x80.pl/articles/simd-strfind.html#id7
https://github.com/BurntSushi/aho-corasick/blob/f227162f7c56...
But no `_mm256_sad_epu8`. What an oddly specific question..?