Re:How many registers does an x86-64 CPU have? (2020)
by dahart on Saturday February 14, 2026 @11:09PM
(#47020974)
Are you making unstated assumptions about the code, the language, compiler and the ABI? They might be reasonable assumptions, and cover common cases, but there’s nothing about the hardware in your example that requires saving and spilling all the registers your helper function uses. That’s up to the compiler, the situation, and/or the programmer. If I have 100 registers and hand-write the assembly corresponding to your example, I don’t necessarily have to spill anything. Generally speaking, I minimize register pressure and spilling if/when I can use more registers.
[ Parent
| on HN ]
There are no comments on this comment yet.