I think the discussion also keeps missing the point that we're not talking about 32bit vs 64bit, we're talking about x86 vs AMD64.
Unless I missed something incredibly fundamental, the compiler doesn't get to access the extra registers if you're compiling for x86. The CPU still has its own internal registers, and it'll do its best to use those, but it'd rather have the compiler helping the CPU do its job, rather than hamstringing it.
That is what I said, yes. But the guessing inside the CPU isn't going to be perfect, it makes more sense to let the compiler handle it, or at least provide better hinting to the CPU.
8
u/nikomo Apr 19 '21
I think the discussion also keeps missing the point that we're not talking about 32bit vs 64bit, we're talking about x86 vs AMD64.
Unless I missed something incredibly fundamental, the compiler doesn't get to access the extra registers if you're compiling for x86. The CPU still has its own internal registers, and it'll do its best to use those, but it'd rather have the compiler helping the CPU do its job, rather than hamstringing it.