4 ms·
People do this all the time. The world is littered with assembly code written by people who believe that modern x86 uarches are just like the Pentium IV they cu
by stephencanon 3y ago
People do this all the time. The world is littered with assembly code written by people who believe that modern x86 uarches are just like the Pentium IV they cut their teeth on, or that an M2 is just a fancy Cortex-A53, meticulously hand ordering instructions while entirely missing the big picture.
If you’re going to take the trouble of writing assembly, you should do it right; figure out the fastest you can theoretically go, and see if you can get within a few percent of that without using assembly. If you can, stop. If not, figure out why you can’t, file compiler bugs as applicable, and then write assembly where it’s necessary. Re-measure, and if you aren’t within a few percent, figure out why not, then go back to step 1.