SJS wrote:
begin  quoting Gabriel Sechan as of Tue, Jan 22, 2008 at 05:43:06PM -0600:
[snip]
No, because too many registers really slow the machine down when you
have a context switch or function call.  All those registers have to be
saved off somewhere.
No they don't.  Only the ones that will be used need to be saved on
function call.  If you have 1000 registers, and use 5, the other 95
can remain untouched and unsaved.  Context switches do become more
expensive, but they're far rarer so the cost increment isn't that much

If you're using lots of registers, you have to save lots of registers.

Sorta true.

However, most systems are now using register renaming on the hardware. This means that the programmer gets to access a smaller number (8-16-32) registers but the hardware has 256-512-etc.

This means that things don't always have to spill to memory right away. In addition, context switches can occur just by remapping the named registers. It's only when the renamed registers run out that you have to start spilling to memory.

Sparc register windows have turned out to be more annoying than helpful over the long term. Large hunks of renamable registers are far more flexible.

That can be taken care of by the CPU. No need to impose byte-alignment
constraints on memory, unless you don't want to put that logic on the
CPU.  It's not like it hasn't been done.

Sorta. However, byte alignment actually has a remarkably large cost in term of hardware and speed. Byte-alignment was one of the things that added quite a bit of complexity to the Alpha 21264 (earlier processors relied on sparse memory to handle byte alignment).

Large register stacks take a lot of chip space, and increase the
transistor count elsewhere as well.  When you have limited die space,
you can't have everything.  These days cache is more of an issue than
registers, but in the old days the registers were the big transistor
count users.  Hence the 6 register intel architecture.

Just one of the reasons I loathe the intel architecture.

Um, I thought that x86_64 had finally broken out of this?  Am I wrong?

-a

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to