3 ms·
One register is a big deal on x86-64. Even bigger deal on x86-32. I recently wrote a x86-64 backed (as in like 4 years ago) and I recall that if address patte
by pizlonator 6y ago
One register is a big deal on x86-64.
Even bigger deal on x86-32.
I recently wrote a x86-64 backed (as in like 4 years ago) and I recall that if address pattern matching (which is now very complete) was not there, you’d lose >1% perf across the board.
I wrote a pretty good x86-32 backend - for a totally different compiler (a whole program PTA-based AOT for JVM bytecode) a long ass time ago and vaguely remember it being like 10-15% there.
Note I’m talking about macrobenchmarks in both cases. And not individual ones - the average over many.
Also don’t forget those functions that sit on the ledge of caller saves. Having any caller saves is more costly than having none. So if a function is using all of the volatile regs, makes no calls (so no need to promote to caller save), and you cause it to use one more register, then it’s prologue/epilogue slows down.
Registers matter a lot. :-)
And about your point about freeing up ports or other things: that may be a cool theory, but I’m just saying that it’s hard to show that using those addressing modes is a speedup if register allocation doesn’t care either way (I.e the use of addressing modes doesn’t help spills or prologues). Meaning, most of the reason why compilers emit these is for regalloc, and it is the only reason that I’ve been able to detect as being the one that changes perf across two different back ends.
- pizlonator 6y agoStupid autocorrect of course turned most of my attempts to say callee save with caller save.
- SAI_Peregrinus 6y agoCan't you add "callee" to the autocorrect dictionary? I know I've done that on Android with the AnySoftKeyboard app, not sure about others.