An Early Christmas present from AMD: More Registers

In our coverage of the Opteron we focused primarily on the major architectural enhancements the K8 core enjoyed over the K7 (Athlon XP) - the on-die memory controller, improved branch predictor and more robust TLBs. For information on exactly what these improvements are for and why we'll direct you back to our Opteron coverage; the same information applies to the Athlon 64 as we are talking about the same fundamental core.

What we didn't spend much time talking about in our Opteron coverage was the benefit of additional registers, a benefit that is enabled in 64-bit mode. To understand why this is a benefit let's first discuss the role registers play in a microprocessor.

Although we think of main memory and cache as a CPU's storage areas, the often overlooked yet very important storage areas that we don't talk about are registers. Registers are individual storage locations that can hold numbers; these numbers can be values to add together, they can be memory addresses where the CPU can find the next piece of information it will need or they can be temporary storage for the outcome of one operation. For example, in the following equation:

A = 2 + 4

The number 2, the number 4 and the resulting number 6 will all be stored in registers, with each number taking up one register. These high speed storage locations are located very close to the processor's functional units (the ALUs, FPUs, etc…) and are fixed in size. In a 32-bit x86 processor like the Athlon XP or Pentium 4, the majority of registers will be 32 bits in width, meaning they can store a single 32-bit value. In 32-bit mode, the Athlon 64's general purpose registers are treated as being 32-bits wide, just like in its predecessor. However, in 64-bit mode all of the general purpose registers (GPRs) become 64-bits wide, and we gain twice as many GPRs. Why are more registers important and why haven't AMD or Intel added more registers in the past? Let's answer these two questions next.

Take the example of A = 2 + 4 from before; in a microprocessor with more than 3 registers, this operation could be carried out successfully without ever running out of registers. Internal to the microprocessor, the operation would be carried out something like this:

Store "2" in Register 1
Store "4" in Register 2
Store Register 1 + Register 2 in Register 3

After the operation has been carried out, all three values are able to be used, so if we wanted to add 2 to the answer, the processor would simply add register 1 and register 3.

If the microprocessor only had 2 registers however, if we ever needed to use the values 2 or 4 again, they would have to be stored in main memory before being overwritten by the resulting value of A. Things would change in the following manner:

Store "2" in Register 1
Store "4" in Register 2
Store Register 1 + Register 2 in a location in main memory

Here you can see that there is now an additional memory access that wasn't there before, and what we haven't even taken into account is that the location in main memory the CPU will store the result in will also have to be placed in a register so that the CPU knows where to tell the load/store unit to send the data. If we wanted to use that result for anything the CPU would have to first go to main memory to retrieve the result, evict a piece of data from one of the occupied registers and put it in main memory, and then store the result in a register. As you can see, the number of memory accesses increases tremendously; and the more memory accesses you have, the longer your CPU has to wait in order to get work done - thus you lose performance. Simple enough? Now here's where things get a little more complicated, why don't we just keep on adding more registers?

The beauty of the x86 Instruction Set Architecture (ISA) is that there are close to two decades of software that will run on even today's x86 microprocessors. One way this sort of backwards compatibility is maintained is by keeping the ISA the same from one microprocessor generation to the next; while this doesn't include things like functional units, cache sizes, or anything of that nature, it does include the number and names of registers. When a program is compiled to be run on an x86 CPU, the compiler knows that the architecture has 8 general purpose registers and when translating the programmer's code into machine code that the CPU can understand it references only those 8 general purpose registers. If Intel were to have 10 general purpose registers, anything that was compiled for an Intel CPU would not be able to run on an AMD CPU as the extra 2 general purpose registers would not be found on the AMD processor.

Microprocessor designers have gotten around this by introducing a technique known as register renaming, which makes only the allowed number of registers visible to software, however the hardware can rename other internal registers to juggle data around without going to main memory. Register renaming does fix a large percentage of the issues associated with register conflicts, where a CPU simply runs out of registers and must start swapping to main memory, however there are some cases where we simply need more registers.

When AMD introduced their AMD64 architecture, they had a unique opportunity at their hands. Because no other x86 processor would be able to run 64-bit code anyways, they decided to double the number of general purpose and SSE/SSE2 registers that were made available in 64-bit mode. Since AMD didn't have to worry about compatibility, doubling the register count in 64-bit mode wasn't really a problem, and the majority of the performance increases you will see for 64-bit applications on the desktop will be due to the additional registers.

What is important to note is that although AMD has increased the number of visible registers in 64-bit mode, the number of internal registers for renaming has not increased - most likely for cost/performance ratio constraints.

Index Where does 64-bit help?
Comments Locked

122 Comments

View All Comments

  • Anonymous User - Tuesday, September 23, 2003 - link

    #10 Without XP64 only Linux apps can give great performance boost over 32 bits apps. Yes, I'm not a gamer, I don't care about UT2K3 or DX9 benchmarks.
  • Anonymous User - Tuesday, September 23, 2003 - link

    #19

    i agree. good review, and how anyone could see an AMD bias in that article, i have no idea. he fvcking said repeatedly that AMD isn't really cutting it with the A64/FX. the worst type of fanboy is one that cant read.

    its sad to see AMD lagging like this... if they fall too far behind, they wont be able to compete with Intel on a high-end level at all - which sucks for competition.
  • Anonymous User - Tuesday, September 23, 2003 - link

    That was a well written review.
  • Anonymous User - Tuesday, September 23, 2003 - link

    #15, doesn't the fact that you can buy an FX51 along with an Athlon64 3200+ at a variety of stores now contradict that statement? I mean someone even said they sighted them in retail stores and the sort across the world before even launch.
  • Anonymous User - Tuesday, September 23, 2003 - link

    For the non-fanboys out there, I have a couple questions.

    1. Is dual-channel really necessary for the Athlon 64? What is the bandwidth of the Hypertransport bus?

    2. Anand contends: "Ignoring the performance boost Intel gains by going to dual-channel, OEMs demanded a dual-channel solution from AMD simply as a checkbox feature." Do you buy this? I thought CPU manufacturers pushed the mobo guys around, not vice versa.

    3. After launching on two different Sockets (754 & 940) - is AMD going to convert everything over to 939 in '04, or are we going to see high-end on 940 and low-end on 754?

    4. Where are the UT2K3 64-bit version benches?

    5. I know it's kind of hard to judge, but how is the driver support for 64-bit coming along? (As a measure, does anyone know if nvidia and/or ATI will be ready with 64-bit drivers by the new WinXP64 launch?)

    6. This is more of a mobo/chipset questions, but where does PCI Express/3GIO fit into AMD's hypertransport plans?
  • Anonymous User - Tuesday, September 23, 2003 - link

    What i really dont understand is this: "AMD has lost a considerable amount of credibility" and again : "AMD has also priced the Athlon 64 and Athlon 64 FX very much like the Pentium 4s they compete with, which is a mistake for a company that has lost so much credibility"

    What exactly do you mean by that Anand?

  • Anonymous User - Tuesday, September 23, 2003 - link

    #13

    The FX-51 will not be avaiable in any reasonable quanitities until next year. The availability of any succeeding products is pure speculation.
  • Anonymous User - Tuesday, September 23, 2003 - link

    I think we'll see the athlon 64 outpacing the p4's in divx encoding once we see a 64bit enabled codec.
  • Anonymous User - Tuesday, September 23, 2003 - link

    All reviews (with exception of Toms Hardware and x86secret, go figure) show the FX51 outpacing the P4 Emergency Edition in the gross majority of benches. That's not even counting the fact the P4EE isn't even going to be available until November (making this a paper launch) and by it's availability the FX53 and Athlon64 3400+ will have already been out in the market with us looking forward to the FX55 in late 2003 or early 2004.
  • Anonymous User - Tuesday, September 23, 2003 - link

    #4 & #7. Please give me a couple of URLs (not thg) so i can validate your inspired response.

Log in

Don't have an account? Sign up now