3 ms·
Autovectorization is the kind of magic you can't rely on. It sort of works on a single platform but you will always run into cases it doesn't handle even if you
by astrange 6y ago
Autovectorization is the kind of magic you can't rely on. It sort of works on a single platform but you will always run into cases it doesn't handle even if you own your own team of autovectorization engineers who tell you it's perfect.
- pjmlp 6y agoA magic shared with C, Fortran and C++ compilers, among others, so support is there.
- sudosysgen 6y agoCompiled autovectorization is miles more reliable than JIT autovectorization.
- kaba0 6y agoAt the other hand, the explicit Vector API will use the correct "flavor" of SIMD instructions on the platform and will gracefully fall back to non-simd version if it is not supported. And as far as I know, the SIMD story is quite bad with C.
- sudosysgen 6y agoYes it's quite bad with C. With C++ and Rust it's much much better when you do it properly.
- pjmlp 6y agoWhen you do it properly is the big question.
- astrange 6y agoIt's pretty good in C with assembly, inline or not. SIMD usually involves a lot of aliasing violations and intrinsics have weird hard to read names, so I find assembly easier to deal with than C here.