3 ms·
Sadly, even something like [1.0f32].map(|s| s.sqrt().abs().recip()).collect() doesn't get vectorized 99% of the time; you can check the disassembly and you'll s
by vvimpcrvsh 9y ago
Sadly, even something like [1.0f32].map(|s| s.sqrt().abs().recip()).collect() doesn't get vectorized 99% of the time; you can check the disassembly and you'll see sqrtss et al.
- galangalalgol 9y agoThere are some llvm flags you can pass to see what got autovectorized in the rustic output. And some that make it autovec more stuff. It is really sensitive to container size. Just throwing a few flags when compiling n-body speeds it up quite a bit over the one up on the benchmark game. I got it to beat the c implementation which had explicit SIMD with portable rust code. Still didn't beat FORTRAN with ifort but faster than gfortran. Also, when rust brings in an llvm with newgvn the autovec should get better.