Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GCC can do it for you with autovectorization.

Doing the feature detection is fairly trivial. If they don't run the invalid instructions don't error.



Autovectorization basically doesn't work. The effort to test it properly (that it got vectorized the way you expect or at all) is more maintenance than writing it yourself.

If you insist on abstractions, autoscalarization (the opposite approach) would be better, which is kind of how Fortran works… but I unironically recommend just writing assembly like ffmpeg does.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: