Improving register assignment on x64 #792
Labels
code size
enhancement
low effort
May still assume familiarity
medium reward
Easy to measure but may not be noticed by itself
r12 and r13 do not need to be avoided, but they are less efficient to use under some circumstances: memory accesses relative to r12 with no (register) index, or accesses relative to r13 with an (immediate) displacement of zero, need one extra byte than comparable operations with a different base.
Currently r12 is the stack pointer (bad, since the stack generates lots of displacement-only accesses) and r13 is the stack limit/store pointer (fine, displacement 0 from r13 is beyond the stack top). I propose to swap r12 and r14.
The text was updated successfully, but these errors were encountered: