News for hackers. Stuff that matters.
Re:The Art of Picking Intel Registers (2003) by aetherspawn on Monday April 23, 2018 @05:40AM (#16901898)
Don’t get any ideas though. Whilst these instructions might make the output code smaller, it will probably make the program slower (1). Processors are optimised to run code generated by compilers fast, and compilers stopped outputting these a long time ago.

1/ There are edge cases like when the code is very big then less code might fit in the cache better or perhaps dispatch better .. but probably not many.

Re:The Art of Picking Intel Registers (2003) by userbinator on Monday April 23, 2018 @07:02AM (#16902247)
In my experience, cache matters a lot and compilers aren't smart enough to figure out what parts of the code are time-critical and what parts aren't, so they just use the fastest (and sometimes significantly bigger) instruction sequences everywhere. Optimising non-critical-path code by making it smaller even if it's somewhat slower can actually make the program as a whole faster, since the cache misses decrease.
Re:The Art of Picking Intel Registers (2003) by rwmj on Monday April 23, 2018 @12:42PM (#16905051)
On Ivybridge and later the string instructions are actually faster than the equivalent unrolled instructions. https://news.ycombinator.com/item?id=12353455