Hacker News new | past | comments | ask | show | jobs | submit login

Nowadays this is a fringe way to write SIMD code, if you use something like simd-everywhere you will be able to write SIMD code for ARM, x86, RISC-V... who share quite a bit of common ground. It's easy to think we can schedule instructions and spill registers better than compilers but only is some extreme cases. Assembly is also longer to write than intrinsics and harder to read, and doesn't get better over time as the compiler improves.



> Assembly is also longer to write than intrinsics and harder to read, and doesn't get better over time as the compiler improves.

Intel intrinsics are actually kind of horrible to read, because they use Hungarian notation which is one of those strange galapagos Microsoft ideas. One reason we used assembly is that it's easier.

> It's easy to think we can schedule instructions and spill registers better than compilers but only is some extreme cases.

With GCC it used to happen every time. Modern compilers do it slightly less than every time, but they will still get the memory accesses wrong. (as I said in every other comment, C doesn't have enough information about memory alignment or aliasing.)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: