From: Brian Hurt <bhurt@janestcapital.com>
To: Chris King <colanderman@gmail.com>
Cc: Tom <tom.primozic@gmail.com>, Caml-list List <caml-list@inria.fr>
Subject: Re: [Caml-list] More registers in modern day CPUs
Date: Thu, 06 Sep 2007 11:17:59 -0400 [thread overview]
Message-ID: <46E01A27.1070207@janestcapital.com> (raw)
In-Reply-To: <875c7e070709060755r1d0d099ds30a25ea78d0fd85a@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1824 bytes --]
Chris King wrote:
>On 9/6/07, Tom <tom.primozic@gmail.com> wrote:
>
>
>>However, would it be possible to "emulate" cpu registers using software? By
>>keeping registers in the main memory, but accessing them often enough to
>>keep them in primary cache? That would be quite fast I believe...
>>
>>
>
>This makes me wonder... why have registers to begin with? I wonder
>how feasible a chip with a, say, 256-byte "register-level" cache would
>be.
>
>
Such chips exist. The Itanium is one example.
The problem is gate delays. The purpose of registers is to be faster
than L1 cache (which typically has a 2-3 clock delay associated with
it). But the more registers you have, the more gate delays you need to
read or write registers- the naive implementation takes O(log N) gate
delays to access O(N) registers- reality is more complicated than this.
But the rule more registers = more gate delays holds true. And these
gate delays translate into a slower chip (one way or another- either you
have to lower your clock rate or add more pipeline stages or both to
deal with the larger register cache). Of course, more registers make
compilers happy, and lowers pressure on the cache bandwidth (as the
compiler doesn't need to spill/refill registers quite so often). This
is why the 64-bit x86 is generally faster than the 32-bit x86- going
from 8 (6 in practice) to 16 (14 in practice) registers was a big step
up. The Itanium has a large enough register set that it's performance
is probably getting hurt by it, but it's hard to tell with the
everything else going on.
The sweet spot for register sets seems to be in the 16-64 range- less
than that, and you're being hurt by the increased memory pressure, more
than that and you're probably being hurt by the slower register addressing.
Brian
[-- Attachment #2: Type: text/html, Size: 2396 bytes --]
next prev parent reply other threads:[~2007-09-06 15:18 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-06 6:20 Tom
2007-09-06 7:17 ` [Caml-list] " skaller
2007-09-06 9:07 ` Richard Jones
2007-09-06 14:55 ` Chris King
2007-09-06 15:17 ` Brian Hurt [this message]
2007-09-06 15:54 ` Harrison, John R
2007-09-06 17:10 ` David MENTRE
2007-09-06 18:27 ` Harrison, John R
2007-09-06 18:28 ` Christophe Raffalli
2007-09-06 18:48 ` Brian Hurt
2007-09-06 18:48 ` Pal-Kristian Engstad
2007-11-20 15:32 ` [Caml-list] OCalm on Sony PS3 (was Re: More registers in modern day CPUs) Mike Hogan
2007-11-21 17:20 ` Richard Jones
2007-11-21 19:05 ` [Caml-list] OCaml " Mike Hogan
2007-11-23 6:44 ` Mike Hogan
2007-12-02 10:14 ` [Caml-list] OCalm " Xavier Leroy
2007-12-02 16:22 ` Mike Hogan
2007-12-02 22:19 ` Konrad Meyer
2007-12-03 0:09 ` [Caml-list] OCaml " Mike Hogan
2007-12-03 20:16 ` minithread (was OCaml on Sony PS3) Christophe Raffalli
2007-12-04 14:25 ` [Caml-list] " David MENTRE
2007-12-04 14:37 ` Basile STARYNKEVITCH
2007-12-04 16:25 ` Mattias Engdegård
2007-12-04 17:33 ` Gerd Stolpmann
2007-12-04 18:00 ` Mike Hogan
2007-12-04 2:29 ` [Caml-list] OCalm on Sony PS3 (was Re: More registers in modern day CPUs) Gordon Henriksen
2007-09-06 20:48 ` [Caml-list] More registers in modern day CPUs Richard Jones
[not found] ` <20070906204524.GB10798@furbychan.cocan.org>
2007-09-06 20:59 ` Chris King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46E01A27.1070207@janestcapital.com \
--to=bhurt@janestcapital.com \
--cc=caml-list@inria.fr \
--cc=colanderman@gmail.com \
--cc=tom.primozic@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox