4 ms·
I recently started manually writing assembly with focus AVX2 (a flavor of Intel SIMD extensions). The rationale is that these are complex enough that compilers
by praptak 5y ago
I recently started manually writing assembly with focus AVX2 (a flavor of Intel SIMD extensions). The rationale is that these are complex enough that compilers do not always notice the opportunity to use them, so my ultimate goal is to apply this is to find a non-artificial problem where I could beat a compiler :-)
I confirm that its one of the most satisfactory ways to add some numbers using a modern computer.
- JimBlackwood 5y agoWould you maybe be able to share some of the learning resources you’ve been using? I’ve really been wanting to get into this! :)
- praptak 5y agoI found surprisingly little material about "how to program AVX/AVX2". That said here's what I used so far: * Intel AVX Programming Reference [0] - comprehensive but not very useful as "where do I even start" * Godbolt[1] to look at code samples produced by compilers. This is good to see how the instructions work together. * A random discussion that has *some* concepts behind the YMM registers[2] * Stack Overflow, for example [3] [0] https://www.intel.com/content/dam/develop/external/us/en/documents/36945 https://www.intel.com/content/dam/develop/external/us/en/doc... [1] A sample code that generates some AVX2 code: https://godbolt.org/z/Kr1sojov6 https://godbolt.org/z/Kr1sojov6 [2] https://community.intel.com/t5/Intel-ISA-Extensions/Software-consequences-of-extending-XMM-to-YMM/td-p/872131 https://community.intel.com/t5/Intel-ISA-Extensions/Software... [3] https://stackoverflow.com/q/40623773/12166 https://stackoverflow.com/q/40623773/12166
- JimBlackwood 5y agoThank you! Sorry for the late response, I always seem to miss responses to my posts. I had been struggling with the same thing, but these are some great sources. Thanks :)
- stevekemp 5y agoMy favourite way to add numbers, in assembly, was this project: https://github.com/skx/math-compiler https://github.com/skx/math-compiler I had far too much fun writing it, even though it is completely pointless!
- praptak 5y agoThat sounds like formula translator, aka Fortran!