ASCII Validation from 2.5 to 114 GB/s with SIMD

14 points by modulovalue


orib

Interesting. I haven't tested throughput, but from a very quick skim, this autovectorizes quite well with both gcc and clang on x86 (edit: once the early return is removed):

int
scalar(char *b, int len) {
    int acc = 0;
    for (int i = 0; i < len; i++)
        acc |= b[i] & 0x80;
    return acc;
}

I was expecting to see some exploration of what the assembly looks like, and how autovectorization kicks in.