Hacker News new | ask | show | jobs
by userbinator 4332 days ago
It should be noted that using 64-bit operands, even in 64-bit mode, incurs an extra penalty of 1 byte per instruction, for the REX prefix. The same applies to using the extended registers (the uncreatively-named "r8" through "r15".) This is very much not noticeable for microbenchmarks, where all the code of a loop fits in the cache, but for bigger ones, the effects of icache misses can become quite significant. A smaller instruction sequence that is slower than a larger one when microbenchmarked can become much faster once that code is benchmarked as part of a whole system.
2 comments

(the uncreatively-named "r8" through "r15".)

I'd much rather have numbered registers that can be used for anything than named registers that have usage limitations.

I suspect that aside was written tongue-in-cheek.
I'm sure, but in case anyone at a CPU design company gets any bright ideas and decides to start naming everything... ;-)
cough MIPS cough
Sometimes "uncreative" is praise.
> incurs an extra penalty of 1 byte per instruction, for the REX prefix.

Any hope to see a Thumb mode for x86-64?