Skip to content
Features

The Pentium 4 and the G4e: an architectural comparison — Part II: the execution core

In my previous article on the Pentium 4 and G4e, I detailed the front ends of …

Jon Stokes – | 0
Story text

Introduction

In my previous article on the Pentium 4 and G4e, I detailed the front ends of each processor. I also gave a general overview of each processor’s pipeline, paying particular attention to the overall design philosophies embodied their respective designs. In this article, I want to look in greater detail at the back end, or execution core, of both processors. I’ll talk about the execution resources that each processor uses for crunching code and data, and how those resources contribute to overall performance on specific types of applications.

Before I begin, I should note that I’m saving a look at the memory subsystems for the next article in this series. This topic, which includes a detailed discussion of bandwidth, caching, and performance, is so crucial to understanding real-world performance that it deserves and entire article to itself.

Preliminary remarks about the ISA: operand formats

Even though this series of articles is aimed primarily at comparing the microarchitectures of the P4 and the G4e, because of the fact that a microarchitecture implements an instruction set architecture (ISA) it helps to understand a bit about the differences in each CPU’s ISA. Specifically, some background on the operand formats of arithmetic instructions in the x86 and PowerPC ISAs will help you understand some of the important design decisions that I’ll cover later in the article.?

If you’ve ever done any x86 assembly language programming, then you know that x86 uses a two-operand format for both integer and floating-point instructions. For instance, if you wanted to add two numbers in registers A and B then the instruction would be laid out as follows:

add A, B

This command adds A to B, and places the result in A. Expressed mathematically, this would look like:

A = A + B

The problem with using a two-operand format is that it can be inconvenient for some sequences of operations. For instance, if you wanted to add A to B and store the result in C then you’d need two operations to do so:


mov C, A

add C, B

The first command moves A into C in order to preserve the value of A, and the second command ands the two numbers.

With a three- or more operand format, like many of the instructions in the PPC ISA, you get a little more flexibility and control. For instance, the PPC ISA has a three-operand add instruction of the format add destination, source 1, source 2, so if you wanted to add A to B and store the result in C without erasing the values in either A or B (i.e. “C = A + B”) then you could just do:

add C, A, B

Some PPC instructions support even more than three operands, which can be a real boon to programmers and compiler writers.?

The PPC ISA’s variety of multiple-operand formats are obviously more flexible than the one- and two-operand formats of the x86, but nonetheless modern x86 compilers are very, very advanced and can overcome most of the aforementioned problems through the use of hidden microarchitectural rename registers and various algorithms. The problems with a two-operand format don’t really rear their heads in integer applications; it’s when we get to floating-point and vector code that the x86’s two-operand format gets to be a potential performance liability. We’ll talk more about this later, though.

Handling integer code: the Arithmetic Logic Units (ALUs)

Integer operations are the mainstay of business and office productivity applications, like spreadsheets, word processors, scheduling and email applications, and the like. Integer performance is essential to making these everyday sorts of office apps run well. All the basic integer operations (ADD, SUB, MUL, etc.) and logical operations (AND, OR, XOR, etc.) are handled in a processor’s arithmetic logic units, or ALU.?

Though the P4’s double-pumped ALUs have gotten quite a bit of press, you might be surprised to learn that both the G4e and the P4 embody approaches to enhancing integer performance that are really quite similar.?As we’ll see, this similarity arises from both processors’ application of that universal computing design dictum: make the common case fast. For integer applications, the common case is easy to spot. Integer instructions generally fall into two categories:

  1. Simple integer instructions. Instructions like ADD and SUB require very
    few steps to complete and are therefore very easy to implement with little overhead. These simple instructions make up the vast majority of the integer
    instructions in an average program.
  2. Complex integer instructions. While addition and subtraction are fairly
    simple to implement, multiplication and division are complex to implement
    and can take quite a few steps to complete. Such instructions involve a
    series of additions and bit shifts, all of which can take a while. These
    instructions represent only a fraction of the instruction mix for an average
    program.

Since simple integer instructions are by far the most common type of integer instruction, both the P4 and G4e devote most of their integer resources to executing these types of instructions very rapidly.

The G4e’s ALUs: making the common case fast

As you can see from the large G4e architecture/pipeline diagram in the previous article, the G4e has a total of four ALUs. (They’re labeled “IU” in the diagram, for “integer unit.” This is just another way of saying “ALU.”) The ALUs are divided up into two types: three fast, simple ALUs and one slower, complex ALU. The complex ALU handles complex integer instructions like multiply, divide, and some special-purpose register instructions. Instructions sent to this ALU generally take four cycles to complete.?

All of the other integer instructions (i.e. ADD, SUB, logical instructions, etc.) go to the three simple, fast ALUs. Instructions sent to these ALUs take only one cycle to complete. By dedicating three of its four ALUs to the fastest, simplest, and most common instructions, the G4e is able to make the common case quite fast.?


?

One nice thing that the PPC ISA has going for it is its large number of General Purpose Registers (GPRs) for storing integers and addresses. This large number of architectural registers (32 to be exact) gives the compiler plenty of flexibility in scheduling integer operations and address calculations.?

In addition to the PPC ISA’s 32 GPRs, the G4e provides 16 microarchitectural general purpose rename registers for use by the on-chip scheduling logic. These additional registers, not visible to the compiler or programmer, are used by the G4e to augment the 32 GPRs thereby providing more flexibility for scheduling the processor’s execution resources and keeping them supplied with data.

The P4’s ALUs: make the common case twice as fast

The P4 takes a very similar strategy to the G4e for speeding up integer performance. It contains one complex, slow ALU and two simple, fast ALUs. By just looking at the number of integer functional units, you might think that the P4 has less integer horsepower than the G4e. This isn’t quite the case, though, because the P4’s two simple ALUs operate at twice the core clock speed, a trick that allows them to look to the outside world like four simple ALUs.?

The P4 can issue two integer instructions per cycle in rapid succession to each of the two fast ALUs, one on the rising edge of the clock and one on the falling edge. The each fast ALU can process an integer instruction in 0.5 cycles, which means that it can process a total of two integer instructions per cycle. This gives a total peak throughput of four simple integer instructions per cycle for the two fast ALUs together.

?

Does this mean that the P4’s two double-speed integer units are twice as powerful as two single-speed integer units? No, not quite.?See, integer performance is about much, much more than just a powerful ALU. You can’t squeeze peak performance out of an ALU if you can’t keep it fed with code, and the P4 seems to have some problems in this area when it comes to integer code. We talked in the first article about how, due to the P4’s “narrow and deep” design philosophy, branch mispredicts and cache misses can wreak havoc on performance by introducing pipeline bubbles into the instruction stream. This is especially a problem for integer performance, because integer-intensive applications often contain branch-intensive code that exhibits poor locality of reference. As a result, branch mispredicts in conjunction with cache latencies can kill integer performance. (I’ll say more on this when I talk about the P4’s cache and memory subsystem.)

As most benchmarks of the P4 bear out, in spite of its double-pumped ALUs the P4’s “narrow and deep” design is much more suited floating-point applications than it is to integer applications. This floating-point bias was a very deliberate design choice on the part of the P4’s designers–the P4 is designed to give not maximum but acceptable performance on integer apps. This strategy works because most modern processors (at least since the PIII, if not the PII or PPro) are able to offer perfectly workable performance levels on integer-intensive applications like spreadsheets, word processors, and the like. With the possible exception of reducing compile times (compilers are integer-intensive), the demand for ever increasing integer performance just isn’t there in the mass market.

Before we move on to another topic, I should note that one aspect of the P4 that bears mentioning is its large number of microarchitectural rename registers. The x86 ISA has only 8 GPRs, but the P4 augments these with the addition of a large number of rename registers: 128 to be exact. Since the P4 keeps so many instructions on-chip for scheduling purposes, it needs these added rename resources to prevent the kinds of register-based resource conflicts that result in pipeline bubbles.

Handling floating-point code: the Floating-Point Units (FPUs)

While the mass market’s demand for integer performance may not be picking up, its demand for floating-point seems insatiable. Games, simulations, 3D rendering, audio processing, and almost all other forms of multimedia- and entertainment-oriented computing applications are extremely floating-point-intensive.?With floating-point apps in many ways driving the home PC market, it’s no wonder that the P4’s designers made their design tradeoffs in favor of FP performance over integer performance.

In terms of the way they use the processor and cache, floating-point applications are in many respects the exact opposite of the integer applications described above. For instance, the branches in floating-point code are few and extremely predictable. Most of these branches occur as exit conditions in small chunks of loop code that iterate through a large dataset (i.e. a .WAV file or a JPEG) in order to modify it. Since these loops iterate many thousands of times as they work their way through a file, the branch instruction that is the exit condition evaluates to “taken” many thousands of times; it only evaluates to “not taken” once, when the program exits the loop. So if for a piece of floating-point code the branch prediction unit (BPU) guesses that all branches will be “taken” every time, then the vast majority of the time it’ll be correct.

The above description also points out two other ways in which FP code is the opposite of integer code. First, FP code has excellent locality of reference with respect to the instruction cache. An FP-intensive program, as I’ve noted, spends a large part of its execution time in relatively small loops, and these loops often fit in one of the processor caches. Second, since FP-intensive apps operate on large data files that are streamed into the processor from main memory, memory bandwidth is extremely important for floating-point performance. So while integer programs need good branch prediction and caching to keep the ALUs fed with instructions, floating-point programs need good memory bandwidth to keep the FPUs fed with data.?

Now that we understand how floating-point code tends to operate, let’s take a look at the FPUs of the G4e and P4 to see how they tackle the problem.

The G4e’s FPU

Since the G4e’s designers are betting on AltiVec to do most of the serious FP number crunching, they made the G4e’s FPU is fairly simple and straightforward. It has a single pipeline for all floating-point instructions, and both single-and double-precision operations take the same number of cycles. (This ability to do double-precision FP is important mostly for scientific applications like simulations.) Also, one single- or double-precision operation can be issued per cycle.

Almost all of the G4e’s floating-point instructions take five cycles to complete. There are a few instructions, however, that can take longer (i.e. fdivs, fres, fdiv, and some others). These longer instructions can take from 14 to 35 cycles to complete, and while they’re executing they hang up the FP pipeline, meaning that no other instructions can be done during that time.

It could plausibly be said that the PPC ISA gives the G4e a slight advantage over the P4 in terms of floating-point performance, but a better way of phrasing this would be to say that the x86 ISA (or more specifically, x87) puts the P4 at a slight disadvantage with respect to the rest of the world. In other words, the PPC’s floating-point implementation, which I’ll describe below, is fairly normal and unremarkable, whereas the x87 has a few quirks that can make life difficult for FPU designers and compiler writers.

As I mentioned at the outset of this article, the PPC ISA has instructions with one-, two-, three-, and four-operand formats. This puts a lot of power in the hands of the compiler as far as scheduling FP ops to minimize dependencies and increase throughput and performance. Furthermore, this instruction format flexibility is augmented by the combination of a 32-entry FP register file and 16 FP rename registers, which together yield even more scheduling flexibility and even more performance.

It’s also important to note that the PPC ISA has a flat floating-point register file. All the term flat register file means is that all 32 of the PPC’s floating-point registers can be read from and written to arbitrarily. To go back to our addition example from the beginning of the article, you can add the values of any two registers and place the result in any other register, without restriction. Now, the GPRs in both PPC and x86 are flat file, as are the SIMD registers. In fact, if it weren’t for the fact that the P4’s x87 FPU is not a flat file, then I wouldn’t even have to discuss this issue.

The P4’s FPU

The P4’s FPU hardware is a little beefier than that of the G4e, but a little less beefy than that of the PIII or the Athlon. The P4’s designers slimmed down the FPU and weakened it a bit, banking on increasing clock rates and the widespread replacement of x87 code for SSE2-optimized code to take up the resulting performance slack. A closer look at the P4’s FPU will show just how it has been weakened.

As you can see from the above image, there are two, fully independent FPU pipelines on the P4, one of which is strictly for floating-point memory operations (i.e. loads and stores). Since floating-point applications are extremely data- and memory-intensive, separating out the memory operations and giving them their own unit helps a bit with performance.

The other FPU pipeline is for all floating-point arithmetic operations, and except for the fact that it doesn’t execute memory instructions it’s very similar to the G4e’s single FPU. Most simple FP operations take a fixed number of cycles, with a few more complicated operations (like floating-point division) tying up the pipeline for a significantly longer time. Single- and double-precision operations take the same number of cycles, with both single- and double-precision floating-point numbers being converted into the x87’s internal 80-bit temporary format. (This conversion is done for overflow reasons, and doesn’t concern us here). So far, then, there’s nothing too new or interesting, here.

The real important distinctions between the P4’s FPU and that of G4e (apart from the P4’s dedicated FP load/store unit) don’t surface until we look more closely at those quirks of the x87 floating-point ISA at which I hinted earlier. The first quirk, an instruction format that takes a maximum of only two operands, isn’t necessarily always a problem in itself. It gets to be a problem, however, when it’s combined with the P4’s second quirk: the x87’s stack-based register file.

In contrast to the PPC’s 32-entry, flat register file, the x87’s register file contains eight, 80-bit registers arranged in the form of a stack. This stack can be pushed and popped just like any other stack, but unlike a strict stack structure its elements can also be accessed arbitrarily through the use of indexes. To read from or write to a specific register in the stack, you can just use the form ST(i), where “i” is the number of registers from the top of the stack.

Below is an image I adapted from the IA-32 Software Developer’s Manual, Vol. 1.

Programming purists might suggest that since you can access its stack elements arbitrarily it’s kind of pointless to still call the x87 register file a “stack.” This would be true except for one catch: for every floating-point arithmetic instruction, at least one of the operands must be the stack top (ST). So for instance, if you want to add two floating-point numbers, one of the numbers must be in the stack top and the other can be in any of the other registers. So if you wanted to add A and B and store the result in A, then either A or B would have to be the stack top. For example, assuming that register A is the stack top, the code

FADD ST, B

performs the operation

ST = ST + B or
A = A + B

So is it a problem that for every floating-point arithmetic instruction one of your (at most) two operands must be ST? Yeah, it is if you’re dependent solely on the compiler to fix things for you. While compiler tricks were enough to make up for the two-operand limit, they’re not quite able to overcome both the two-operand limit and the stack-based limit. So compiler tricks alone won’t eliminate the performance penalties associated with both of these misfeatures combined. The stack-based register file stinks bad enough that a microarchitectural hack is needed in order simulate a flat register file and thereby keep x87’s bad design from hobbling floating-point performance.

This microarchitectural hack involves turbocharging a single instruction: FXCH. The FXCH instruction is an ordinary x87 instruction that allows you to swap any element of the stack with the stack top. For example, if you wanted to calculate ST(2) = ST(2) + ST(6), you might execute the following sequence of instructions

FXCH ST(2)
FADD ST, ST(6)
FXCH ST(2)

The first instruction places the value of ST(2) into ST and the value of ST into ST(2). The second instruction then adds ST and ST(6), giving the desired sum. The third instruction again swaps the values in ST and ST(2), placing the sum in ST(2).

Now, here’s where the microarchitectural hack comes in. On both the PIII and the Athlon, the FXCH instruction can be executed in zero cycles. This means that for all intents and purposes FXCH is “free of charge” and can therefore be used when needed without a performance hit. (Note however that the FXCH instruction still takes up decode bandwidth, so even when it’s “free” it’s not entirely “free.”) If you stop and think about the fact that, before executing any FP instruction (which has to involve the stack to) you can instantaneously swap ST with any other register, then you’ll realize that a zero-cycle FXCH instruction gives you the functional equivalent of a flat register file.

To revisit the previous example, the fact that the first instruction executes “instantaneously,” as it were, means that the series of operations effectively looks as follows:

FADD ST(2), ST(6)

There are in fact some limitations on the use of the “free” FXCH instruction, but the overall result is that by using this trick both the PIII and the Athlon get the effective benefits of a flat register file (but with the aforementioned hit to decode bandwidth).

So what about the P4? Here’s the the kicker in the P4’s x87 design, which threw analysts for a loop when it was first revealed: on the P4, FXCH is no longer free. That’s right; the P4 takes us back to the bad old days of stack-based floating-point.

Why would Intel take a step backwards and weaken the FPU this way, especially considering the fact that the P4 is quite clearly designed from the ground up for floating-point intensive media applications? The most obvious answer and the one that many seem to agree on is that they intend for programmers to use SSE2 for floating-point.

Note: Neither I nor anyone else seems to be able to find out how many floating-point and vector rename registers the P4 has. If you find any Intel documents that give these numbers, please point me to them.

Concluding remarks on the G4e’s and P4’s FPUs

The take-home message in the above discussion could be summed up as follows. While the G4e has fairly standard, fairly unremarkable floating-point hardware, the PPC ISA does things the way they’re supposed to be done–with three- or more operand instructions and a large, flat register file. The P4, on the other hand, has slightly better hardware but is hobbled by the legacy x87 ISA. The exact degree to which the x87’s misfeatures affect performance has been debated for as long as x87 has been around, but seems to be a consensus that the situation is significantly less than ideal.

The other thing that’s extremely important to note is that, when it comes to floating-point performance, a good memory subsystem is absolutely key. It doesn’t matter what kind of crazy floating-point hardware you’ve got, if you can’t keep it fed then it won’t be doing much work. Although I’m saving a detailed comparison of both processors’ memory and caching subsystems for a later article, I’ll jump the gun a bit by saying that the G4e’s reliance on PC133 SDRAM is its Achilles heel. The dual-channel RDRAM subsystem with which the P4 is usually coupled is miles ahead of anything that Apple has released.

Just as an aside, if you want to understand just how crucial memory bandwidth is for floating-point performance then you should look at the architecture of an entire machine designed almost exclusively for floating-point applications: the Playstation2. The PS2 has bandwidth everywhere: in its main memory, its disk I/O, its chip-to-chip interconnects, and its on-chip datapaths.

Handling SIMD code: the Vector Processing Unit (VPU)

One key technology on which both the P4 and the G4e rely for performance on their most important type of application–media apps–is SIMD. (If you’re not familiar with SIMD, or “Single Instruction, Multiple Data” computing, then you should read at least the first few pages of my article on the subject before diving into this section.) Many of the media apps whose characteristics I profiled in the previous section on the FPU can make excellent use of SIMD. I described media apps as applications that use small, repetitious chunks of code to operate on large, uniform datasets. Since these small chunks of code apply the same sequence of operations to every element of a large dataset, and these datasets can often be processed out-of-order, it makes sense to use SIMD to apply the same instructions to multiple elements at once.

In the following illustration, the white pixels of an image are inverted to black using both a traditional, scalar approach (on the right) and a SIMD, vector approach (on the left). In the SIMD approach, the pixels are grouped into 4-element vectors and processed.

Regular,
scalar approach
SIMD
approach

This technique of applying a single instruction to multiple data elements at once is quite effective in effecting significant speed-ups for many types of applications, especially streaming media, image processing, and 3D rendering. In fact, many of the floating-point intensive applications that I described previously can benefit greatly from SIMD, which is why both the G4e and the P4 skimp on the traditional FPU in favor of beefing up their SIMD units.

The G4e’s VPU: SIMD done right

The G4e’s Altivec implementation is by far its most compelling feature. The processor boasts four independent Altivec units, three of which are fully pipelined and can operate on multiple instructions at once. These units are as follows:

  • Vector Permute Unit. This unit handles the instructions that rearrange the
    operands within a vector. Some examples are permute, merge, splat, pack, and
    unpack.
  • Vector Integer Unit 1. This unit handles all of the fast and simple vector
    integer instructions. It’s basically just like one of the G4e’s three simple
    ALUs, except vectorized. This unit has only one pipeline stage, which means
    that it can only operate on one instruction at a time.
  • Vector Integer Unit 2. This is the vector equivalent of the G4e’s one
    complex ALU. It handles the slower instructions, like multiplication, multiplication-addition,
    etc.
  • Vector Floating-point Unit. This unit handles all vector floating-point
    instructions.

The G4e can issue up to two Alitvec instructions per clock cycle, with each instruction going to any one of the four units. And as I noted just now, all of the units with the exception of Vector Integer Unit 1 are pipelined and can operate on multiple instructions at once.

All of this SIMD execution hardware is tied to a generous register file that consists of thirty two, 128-bit architectural registers and 16 additional vector rename registers.

The excellent design of the AltiVec instruction set is another bonus for G4e’s SIMD capabilities. Unlike any of the Intel SIMD instructions, most AltiVec instructions have four operands. These operands are: source 1, source 2, modifier, and destination. You’ll notice that this is basically the same as the three-operand format I described above, but with the addition of a mod register that allows you to use a vector for masking or other purposes. This four-operand format is much more flexible than the two-operand format available to Intel’s SIMD instructions. For more on this issue, see my SIMD article.

The P4’s VPU: alphabet soup done quickly

SIMD on Intel’s x86 family of processors has a long and acronym-filled history, which I’ll only briefly summarize here because I’ve traced it in more detail elsewhere. Intel introduced SIMD to the PC market with MMX on the Pentium. (Yes, I know about Sun and VIS. Notice I said “the PC market” and not “the Unix workstation market.”) MMX brought to the Pentium the ability to do 64-bit SIMD integer operations via the 57 new MMX instructions added to the x86 ISA. There was no SIMD floating-point, and for various reasons Intel opted to have MMX instructions use the first 64 bits of the 8, 80-bit floating-point registers for storing SIMD vectors. So FP instructions shared a register file with MMX instructions, and to do SIMD you had to first save the values in the x87 registers because the MMX instructions would overwrite them.?

?

MMX retained x87’s two-operand format, but it did treat the 8 MMX registers as a flat file and not a stack.?

Intel knew when they released MMX that it was seriously limited by its 64-bitness and its integer-only nature, so as the first PIIs were rolling off the lines they were already hard at work on the sequel: SSE (a.k.a. KNI a.k.a. MMX2).

SSE (Streaming SIMD Extensions), introduced with the PIII, was a vast improvement over MMX. The new SSE instructions enabled the PIII to do 128-bit SIMD floating-point operations. The SIMD FP ops were limited to single-precision, but were still far better than nothing. To allow these new capabilities, Intel had to add 8 new 128-bit registers to the ISA. These new registers, called XMM registers, were for floating-point SIMD operations only. SIMD integer operations were still limited to 64 bits because they had to use the old MMX/x87 registers.

With the introduction of SSE2 on the P4, Intel finally got its SIMD act together. (Or, at least, it got its act together about as well as you can expect for SIMD on the IA-32 architecture. IA-64, on the other hand, is another matter… but that’s for another article). On the integer side, SSE2 finally allows the storage of 128-bit integer vectors in the XMM registers, and it modifies the ISA (by extending old instructions and adding new ones) to support 128-bit SIMD integer operations. For floating-point, SSE2 now supports double-precision SIMD floating-point operations. All told, SSE2 adds 144 new instructions, some of which are cache control instructions about which we’ll talk in the next article.

Now that we know something about SSE2, let’s look at how it’s implemented on the P4. In keeping with the P4’s “narrow, deep, and fast” approach, the P4 does not sport any dedicated SSE2 pipelines. Rather, both FPU pipes double as VPU pipes, meaning that the FPU memory unit also handles vector memory operations and the FPU arithmetic unit also handles vector arithmetic operations. So in contrast to the G4e’s four vector arithmetic units, the P4 has one vector arithmetic unit that just does everything–integer, floating-point, permutes, etc.?

So with only one execution pipeline to handle all vector and floating-point operations, you’re probably wondering how the P4’s designers expect it to perform competitively on the media applications for which it was obviously designed. This is a good question, and it’s one that I don’t have definite answers to. I can, however, offer some tentative answers.

After looking through the P4 optimization manual and thinking about the overall design of the P4 as I’ve described it in these two articles, my conclusion is that the P4 will offer competitive SIMD performance based on a combination of three factors:

  • Relatively low instruction latencies
  • Extremely high clock speeds
  • A high bandwidth caching and memory subsystem

Let’s take a look at these factors and how they work together.

The P4 optimization manual lists in section C the average latencies of the most commonly used SIMD instructions. A look through the latency tables reveals that the majority of single- and double-precision arithmetic operations have latencies in the 4- to 6-cycle range. In other words, most vector floating-point instructions go through four to six pipeline stages before leaving the P4’s VPU. This number is relatively low for a 20-stage pipeline design like the P4, especially considering that vector floating-point instructions on the G4e go through 4 pipeline stages on average before leaving the G4e’s vector FPU.

Now, considering the fact that the P4’s clock speed is now more than double that of the G4e’s (and this gap is rapidly increasing), the P4’s ability to execute single- and double-precision vector FP ops in almost the same number of clock cycles as the G4e means that the P4 executes these ops over twice as fast in real-world, “wall clock” time. So the P4 can get away with having only one VPU because that VPU is able to grind through SIMD ops very, very quickly.?Furthermore, as the P4’s clock speed increases its vector crunching power grows.

Another piece that’s crucial to the whole performance picture is the P4’s RDRAM-based memory subsystem and low-latency caching subsystem. I’ll won’t cover these features here, but as I’ve noted earlier the P4 has large amounts of bandwidth at its disposal. All this bandwidth is essential to keeping the very fast VPU fed with data, and as the P4’s clock speed increases bandwidth will play an even larger role in vector processing performance.

Increasing floating-point performance with SSE2

I had mentioned earlier that MMX uses a flat register file, and the same is true of both SSE and SSE2. The 8, 128-bit XMM registers are arranged as a flat file, which means that if you’re able to replace an x87 FP operation with an SSE or SSE2 operation then you can use clever resource scheduling to avoid the performance hit brought on by the P4’s combination of a stack-based FPR and a non-free FXCH instruction. Evidence suggests that a highly advanced compiler that is able to convert large amounts of x87 code to SSE2 code can yield a remarkable performance boost.?

Conclusions

The preceding discussion should make it clear that the overall design approaches I outlined in the first article can be seen in the execution cores of each processor. The G4e continues its “wide and shallow” approach to performance, counting on instruction-level parallelism to allow it to squeeze the most performance out of code. The P4’s “narrow and deep” approach, on the other hand, uses fewer execution units, eschewing ILP and betting instead on increases in clock speed to increase performance.

Each of these approaches has its benefits and drawbacks, but as I’ve stressed repeatedly throughout both of these articles microarchitecture is by no means the only factor in the application performance equation. In this article, I’ve talked a bit about how the ISA can influence performance, and in the next article I’ll discuss the performance impact of the caching and memory subsystems.???

?

Revision History

Date Version Changes
11/6/2001 1.0 Release
11/7/2001 1.1 -Fixed a bug in the
assembly code on page 1.
-Corrected the mistype that had MMX introduced with the PII instead of
the Pentium.
0 Comments

Comments are closed.