r/programming • • Apr 19 '21

Visual Studio 2022

https://devblogs.microsoft.com/visualstudio/visual-studio-2022/
1.9k Upvotes

475 comments sorted by

View all comments

Show parent comments

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.

1

u/screwthat4u Apr 19 '21

Modern CPUs have many registers that shadow the “public” registers based on data access patterns

2

u/nikomo Apr 19 '21

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.