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

Those specific functions are compiler builtin vector intrinsics. The main reason is that they can easily read past ends of arrays and have type safety and aliasing issues.

By the way, the rust compiler does generate such code because under the hood LLVM runs an autovectorizer when you turn on optimizations. However, for the autovectorizer to do a good job you have to write code in a very special way and you have no way of controlling whether or not it kicked in and once it did that it did a good job.

There’s work on creating safe abstractions (that also transparently scale to the appropriate vector instruction), but progress on that has felt slow to me personally and it’s not available outside nightly currently.



    > However, for the autovectorizer to do a good job you have to write code in a very special way
Can you give an example of this "very special way"?


For example many autovectorizers get upset if you put control flow in your loop




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

Search: