Skip to content
Features

Inside the Xbox 360, Part II: the Xenon CPU

Part II of Hannibal's series on the Xbox 360 zooms in for a closer look at the …

Jon Stokes – | 0
Story text

Introduction

Part I of this series covered Microsoft’s vision for dynamic content creation in the next generation of console games. The XBox 360’s procedural synthesis techniques were explained, and a general overview of the multicore PowerPC CPU that powers the new console was given. In the present article, we’ll zoom in for a closer look at this CPU, codenamed Xenon. We’ll cover the design of its individual parts, and we’ll talk about how each part fits with the vision outlined in Part I.

Xenon’s design philosophy

The Xenon’s triple-core design shares some DNA with the Playstation 3’s Cell processor, so it’s not surprising that it also embodies many of the same assumptions about the best way to wring performance out of the sorts of extremely large transistor counts that Moore’s Curves have given the latest generation of integrated circuits. Like the Cell processor that will power the Playstation 3, the Xenon carries on the “RISC”-style tradition of trading programmer/compiler effort for hardware. In a nutshell, software writers who develop for Xenon must take on more of the burden of optimizing their code by making it explicitly parallel, and in return they get more execution hardware to play with.

The traditional approach: a large instruction window and lots of execution units

For some time, processor architects have approached the problem of increasing performance by "widening" processors’ execution cores. By "widening" the execution core, I mean adding more execution units that can operate in parallel. An example of a very wide execution core would be IBM’s older PowerPC 970, which sports the following array of execution units:

PowerPC 970 functional units

  • Two floating-point units
  • Two integer units
  • Two load-store units
  • One branch unit
  • One vector unit

Compare the list above with the following list of the PowerPC 603e’s execution units.

PowerPC 603e functional units

  • One floating-point unit
  • One integer unit
  • One load-store unit
  • One branch unit
  • One system unit

As you can see, the PowerPC 970 has double the number of floating-point, integer, and load-store execution units as its PowerPC forerunner. This enables the 970 to execute twice as many floating-point, integer, and memory access instructions at the same time. Executing more instructions at once means that programs run faster and performance is increased.

Increasing the width of the execution core definitely has its advantages, but there’s a limit to how wide the core can be before you reach a point of diminishing returns. The code that programmers and compilers generate is serial, so it must be rearranged before it can be executed in parallel by a wide execution core. This process of rescheduling the serial instruction stream so that it can be executed in parallel, a process called dynamic execution, requires special hardware that adds complexity and size to the design of the processor.

In order to extract parallelism from the code stream, the processor must first pool instructions in a special set of buffers. These buffers make up the instruction window, which is the heart of the processor’s dynamic execution hardware. The processor then examines the instructions in the instruction window for dependencies in order to determine which instructions it can execute in parallel. The more execution units the processor’s execution core has, the larger the instruction window needs to be in order to extract even more parallelism from the code stream.


A generic single-core processor with a wide execution core

In the diagram above, the large instruction window buffers instructions, examines them for dependencies, and reschedules them to execute in parallel and out-of-order.

Unfortunately, the average amount of instruction-level parallelism (ILP) that can be extracted from the serial code stream is fairly limited, and this limit means that adding more execution units and increasing the size of the instruction window does little good beyond a certain point. Furthermore, in an extremely wide design like that of the 970, many of the execution units will sit idle for a non-trivial percentage of a program’s total execution time, because the processor can’t find enough work for them all to do on every cycle. These idle execution units are still taking up die space and drawing power, so widening a processor is therefore a relatively inefficient way to increase its performance.

Download the PDF
(This feature for Premier subscribers only.)

From ILP to TLP, from the processor to the programmer

The basic idea behind both Cell and Xenon is to make the execution core less complex by stripping out hardware that’s intended to optimize instruction scheduling at runtime. Neither the Xenon nor the Cell have an instruction window, which means that these two processor designs largely forget about instruction-level parallelism. Instead, instructions pass through the processor in the order in which they’re fetched, with the twist that two adjacent, non-dependent instructions are executed in parallel where possible.

This static execution scheme is pretty much the same one used in older, less complex designs, like the original Intel Pentium. Static execution is simple to implement and takes up much less die space than dynamic execution, since the processor doesn’t need to spend a lot of transistors on the instruction window and related hardware. Those transistors that the lack of an instruction window frees up can be used to put more actual execution units on the die.

Of course, you can’t just eliminate the instruction window and replace it with more execution units without doing something to make up for the lost instruction window. The whole point of an instruction window is to complement an increased number of execution units by extracting more instruction-level parallelism. So in order to take advantage of a large number of execution units without an instruction window, you have to rethink how you organize the processor.

Regrouping the execution units

Instead of spending hardware on an instruction window that looks for ILP at run-time, the Xenon instead relies on the programmer to structure the code stream at compile time so that it contains a high level of thread-level parallelism (TLP). In order to take advantage of the high level of TLP that the Xenon expects programmers to have worked into their Xbox 360 applications, the processor groups its large number of execution units into three separate cores, each of which individually contains a relatively small number of execution units. The many parallel threads out of which the programmer has woven the code stream are then scheduled to run on those separate cores.


The Xenon

The end result is that the when running a multithreaded workload, the Xbox 360’s three-core processor will contain a higher total number of execution units that are busy at any given moment than a comparable single-core processor. Each individual thread has a limited amount of ILP and each PPE has a very narrow execution core, but the combined effect of a large number of simultaneously running threads means that more total execution units are put to work at once across all three PPEs. For example, if at a particular moment each of Xenon’s PPEs has two busy execution units (one per thread) for a total of six busy execution units, then Xenon can outperform a single-core processor of similar size that had four execution units active at once.

This TLP strategy will work extremely well for tasks like procedural synthesis that can be parallelized at the thread level. However, it won’t work as well as an old-fashioned wide execution core + large instruction window for inherently single-threaded tasks. In particular, three types of game-oriented tasks are likely to suffer from the lack of a out-of-order processing and core width: game control, artificial intelligence (AI), and physics. Each of these three tasks tends to be relegated to a single thread, and each tends to have some inherent ILP that can be exploited by a large instruction window and a robust, multipipeline integer execution unit. But I’ll say more on this point in the article’s conclusion.

The PowerPC Processing Element

When Sony unveiled the Cell at this past ISSCC, the relative lack of information on the PowerPC Processing Element (PPE) that makes up the “host” processor for this network-on-a-chip was a major disappointment. Details on the PPE were scarce, but the details that were released matched up exactly with information that had already been leaked about the IBM-designed PowerPC cores that would power the next-generation Xbox. Moreover, the very fact that IBM released so few details of the Cell’s PPE at the Cell’s debut was evidence in itself that the architecture would play an important role in the yet-to-be-announced Xbox 360.

Xenon PowerPC Processing Element details

  • L1 cache: 32K instructions/32K data
  • Two-issue superscalar execution
  • In-order execution
  • Two-way simultaneous multithreading

The Xenon PPE details given above have since been officially confirmed, which makes it extremely likely that, with the very important exception of the Xenon’s VMX hardware, the Cell’s PPE shares its architecture with the three cores that make up the CPU that powers the Xbox 360. This being the case, the present discussion will rely heavily on what is known of the Cell’s PPE to describe the Xenon’s cores.

Before moving on, though, I should take a brief moment to quash a rumor that I unfortunately had a significant hand in starting last year. I originally thought that the PPE design shared by the Cell and the Xenon was derived from the PowerPC 970/POWER5 lineage. This is certainly not the case for a number of reasons, not the least of which is the fact that if IBM could produce a triple-core 970 derivative we’d certainly have seen at least a dual-core 970 derivative in a Mac by now. Some, lacking clear IBM documentation on the matter, are inclined to persist in the belief that the Xenon’s PPE may be a 970 derivative, but as far as I’m concerned the case is settled.

Pipeline detail

As you can see from the pipeline diagram below, the PPE, like the P4, spends most of its pipeline stages getting instructions to the execution core. Unlike the P4, however, which has very low single- and half-cycle latencies for most integer instructions, the PPE seems to have at two-cycle latency for common integer instructions. This two-cycle latency isn’t so bad, though, and is the same as the latency for commonly used integer instructions on the 970.


The PPE pipeline

The pipeline diagram above comes from Kevin Krewell’s coverage of the Cell in the Microprocessor Report. It’s a bit cryptic, but here’s a breakdown of the PPE’s pipeline stages:

  • IC1-IC4: these stages are the fetch stages, wherein instructions are moved into the PPE’s front end and some early decoding is done to identify the branch instructions. If the PPE keeps in the standard PowerPC tradition, instructions are fetched into an instruction queue where branches that can be folded are folded. Note that branches that must be predicted are sent off to the branch prediction hardware after IC4.
  • IB1-IB2: this is probably some kind of alignment and/or early decoding phase, where microcode instructions are sorted from directly decoded instructions.
  • ID1-ID3: these are the main instruction decode stages. Instructions that are decoded directly in hardware are sent through this short portion of the pipeline, where they can be decoded quickly and sent along to the issue stage.
  • (MC1-MC8): this is the microcode decoding path, and it’s very slow. I’m guessing that it only supports relatively rare PPC instructions, and that the vast majority of PPC instructions go through the hardware decoder.
  • IS: after being decoded, the instructions pass into the PPE’s control unit, where they’re issued in-order to the execution core.
  • DLY: these are the same as the Xfer stages on the 970. They’re included solely to keep wire delay from slowing the clock speed down.
  • RF1-RF2: during these two register file read stages, operands move from the registers into the appropriate execution unit.
  • EX: Instruction execution takes place during these stages, the number of which varies depending on the pipeline and on the instruction.

The PPE’s execution core

The exact number and nature of the execution units that make up the PPE’s execution core are not publicly known. However, judging from the pipeline diagram on the previous page, as well as the general approach to the PPE as described in public IBM presentations and as outlined above, the following execution unit breakdown seems likely

The PPE’s execution units

  • 1 integer unit
  • 1 floating-point unit
  • 1 branch unit
  • 1 load-store unit
  • 2 VMX-128 units

We know that the PPE will have at least one of each of the above, and given the fact that it’s a static, two-issue machine, it’s not likely that there are two of anything except the VMX unit and possibly the load-store unit. The Xenon’s VMX unit is worth talking about in detail, so let’s take a look at that now.

VMX-128

The most noteworthy and baffling feature of the Xenon’s PPE is its vector (or SIMD) execution unit. This unit is the workhorse of the Xenon, and will be primarily responsible for the kind of procedural synthesis described in the first article.

As is widely known by now, the Xenon’s VMX unit features 128 registers, each 128 bits in length. This so-called “VMX-128” unit allows for each running thread to use 128 vector registers, which means that Xenon has a total of 256 physical vector registers on the die (128 registers x 2 threads). This 128-entry register file is much larger than the standard VMX/Altivec 32-entry register file, a fact that has occasioned much speculation as to what exactly Microsoft means when the claim that the Xenon’s VMX unit has “128 registers.” There are tantalizing clues, but little hard evidence to go on.

It may be significant that the number of registers in VMX-128 matches the number of vector registers in the Cell’s SPEs. Furthermore, both the Xenon’s VMX unit and the Cell’s SPEs implement a specialized subset of the VMX/Altivec instruction set, with some VMX instructions removed and other new instructions added in to help with 3D rendering. However, from what I’ve been able to discern it’s highly unlikely that the Cell’s SPEs and the Xenon’s VMX unit implement the exact same instruction set. More on this below, though.

The most puzzling aspect of VMX-128 has to do with how it might fit into the PPC instruction format. Without going into mind-numbing detail, it suffices to say that it would be very tricky to find a way to fit a decent-sized set of 128-register, three-operand instructions into the PPC’s 32-bit instruction format. This isn’t to say that it can’t be done somehow, but the problem is that nobody knows what sorts of hacks IBM has used to do it. What is almost certain is that any hack(s) that enables the VMX-128 extensions to be appended onto the PPC ISA will be neither necessary nor attractive for use with Cell’s SPEs. The SPEs implement their own custom VMX-like ISA, which will have been designed from the ground up to cleanly support a 128-entry unified register file.

One bit of information that I do have about VMX-128 is that it is possible to carve out a pool of registers in the large register file and to keep them persistent across multiple function calls. This allows separate functions within a thread to share and work on a common, global set of matrices. This should give a solid boost to performance on matrix-intensive code that is designed to take advantage of this feature.

In general, it’s useful to think of VMX-128 as yet another way in which Xenon takes storage from under the control of the hardware and places it in the control of the programmer. The Pentium 4, for example, has 128 floating-point/vector rename registers that are invisible to the programmer and managed by the P4’s dynamic execution hardware. The P4 uses these rename registers to eliminate false dependencies brought on by x86’s very small number of architected registers. The 970 likewise has a larger number of rename registers than it does architected VMX registers, and it too uses those extra rename registers to alleviate false dependencies. The Xenon, in contrast, places its large physical register file under the control of the programmer/compiler, which can decide at compile time how best to use those registers so as to eliminate data dependencies.

The VMX-128 execution unit

The exact number of VMX-128 execution units is not yet known, but it’s probably at least two, and possibly three. There is probably one VMX ALU that handles most vector arithmetic operations (add, multiply, multiply-add, etc.). There is also probably a separate unit for handling vector permutes and pack/unpack operations. This unit would also handle VMX-128’s new, 3D-oriented, single-cycle dot product instruction(s), which allows programmers to perform dot products on arrays in a much more efficient and programmer-friendly manner. This new vector unit functionality is described quite well in the following portion of the Microsoft patent application referenced in Part I of this series:

[0079] FIG. 8 provides other logic for providing a dot product operation in an intuitive and user friendly manner. A conventional dot product of two graphics-related vectors, V.sub.1 (X.sub.1, Y.sub.1, Z.sub.1, W.sub.1) and V.sub.2 (X.sub.2, Y.sub.2, Z.sub.2, W.sub.2), is formed as follows: Dot product=V.sub.1.multidot.V.sub.2=X.sub.1X.sub.2+Y.- sub.1Y.sub.2+Z.sub.1Z.sub.2+W.sub.1W.sub.2.

[0080] More specifically, to achieve best performance, many current CPU instruction sets require a user to perform a dot product using the Structure of Arrays (SOA) approach, as opposed to the more intuitive and user friendly Array of Structure (AOS) approach. In the former approach, the operand data used to perform the dot product is loaded into appropriate registers provided by the CPU. Then, this operand data is manipulated by “rotating” it in such a manner to accommodate the SOA approach used by the CPU. Namely, to perform a multiplication of one vector by another, this SOA technique effectively turns a 1 x 4 vector on its side to provide a 4 x 1 vector. This results in an inefficient use of register capacity, as only one lane of each register is now used to store vector data. Further, the operation of rotating a vector on its side (accomplished in a so-called “swizzling” operation) requires execution cycles that are “empty” in the sense of not performing any meaningful conversion of the vector data (that is, not performing any mathematical operations on the data). Allowing programmers to keep their data in AOS format greatly simplifies optimization efforts; by contrast, SOA is at odds with natural data structure design, and Application Program Interface (API) parameter passing. Further, SOA generally complicates the programmer’s use of SIMD vector math instruction usage. The logic overcomes these drawbacks by using the aforesaid AOS approach. (However, the CPUs employed in the present system can be configured to perform the dot product using the SOA approach too; the user is thus afforded the option of performing the dot product using either the AOS approach or the SOA approach.)

[0081] More specially, the logic includes receiving operands that will be used to perform the dot product… performing the dot product using the AOS approach… and then outputting the dot product result.

This same patent application also discusses a specialized type of memory access instruction, which incorporates a form of data compression (packing vertex data in vectors) into stores and data decompression (unpacking vertex data from vectors) into loads. (I won’t quote the relevant section, but you can check this post for it.)

Microsoft’s Direct3D commonly uses vertex data in packed formats, so VMX-128’s specialized load and store instructions that efficiently and automatically handle packing and unpacking will help save on bus bandwidth and memory space. This is yet another form of data compression that the Xenon uses, sort of like the procedural synthesis described in Part I. Interestingly, the IBM-designed Gekko also has a special set of load and store instructions that pack and unpack vertex data automatically. So as was the case with the locked cache sets in Xenon’s L2 there is precedent for this particular feature in an IBM game console design.

Because of its special load and store instructions, I think it’s possible that the VMX-128 unit has its own load-store pipeline. It’s common in both PPC and x86 designs to have a separate vector load-store pipe, and I think that the load-unpack and store-pack instructions make a good case for the Xenon having this sort of vector load-store implementation as well.

Simultaneous multithreading and performance

The Xenon’s SMT implementation is probably much, much simpler than that of the Pentium 4 with hyperthreading. SMT on the Xenon will probably look a lot like SMT on the POWER5, where the hardware support comes mainly in the form of duplicated registers. The Pentium 4 contains a number of partitioned buffers that are there to ensure that the threads play nice with each other and don’t hog shared resources. The POWER5, in contrast, contains no such hardware. Furthermore, the POWER5 allows programmers to set thread priorities by simply controlling the decode rate of each thread.

POWER5 actually gets better SMT performance for less hardware because, unlike Intel systems that are made to run a huge variety of OSes and application mixes, IBM controls the entire POWER5 hardware-software stack. The POWER5’s OS can monitor the behavior of simultaneously running threads on each core and throttle threads that are overusing shared resources.

Because the Xbox 360’s programmers will have similarly low-level access to the Xenon hardware, it’s likely that this processor also relies on a combination of software monitoring and decode rate throttling to ensure that threads are scheduled optimally and get along with one another. It will be up to programmers to use the monitoring capabilities that are built into the PPE to ensure that threads are scheduled to run on the three PPE cores in the right combinations, so that they don’t conflict over execution hardware, registers, etc.

The PPE’s pipeline and performance

In its overall design approach the PPE shares a surprising number of similarities with the Netburst architecture that powers Intel’s P4. In particular, I once described the P4’s overall design philosophy as “narrow and deep,” as opposed to the “wide and shallow” approach of the G4 and its kin. The PPE shares the P4’s “narrow and deep” approach to performance, but with a few very important differences.

The PPE’s pipeline is 21 stages deep, the same number of pipeline stages as the Pentium 4 Northwood core. This 21-stage pipeline looks like a relic of an age prior to the recent multicore revolution, when clockspeed was still king. Still, it makes a certain amount of sense given the fact that the core was obviously designed to pack a lot of streaming media performance into a small on-die footprint. How can deep pipelines pack a lot of performance into a small die size? Let me explain.

Deep pipelines are well suited to high-bandwidth streaming media processors, where the code stream is fairly compact and serial at the individual thread level and the datasets are large, uniform, and data-prefetch-friendly. So the PPE’s general approach to performance is to execute serial instructions twice as fast instead of parallel instructions two at a time. This rapid-fire, serial execution approach means that each PPE takes up less space than it would if it were designed with ILP (and execution core width) in mind, but it also means that code stream parallelism must come from running multiple threads at once (as described in the previous section).

Deep pipelining also allows a computer architect to increase the number of instructions that the processor can hold and simultaneously execute by stacking more instructions into the same amount of hardware. So a machine with deeper pipelines may have fewer execution units, but it can have more instructions in various stages of execution simultaneously. Thus the more deeply pipelined processor could theoretically be smaller than a comparable “wide and shallow” design while holding a greater number of instructions, because it does more with less. I say “theoretically,” because more deeply pipelined processors usually aren’t any smaller in real life than their less deeply pipelined counterparts.

This brings me back to a statement I made at the beginning of this section, where I said that the PPE’s deep pipeline was designed to pack a lot of streaming media performance into a small amount of die space. At that point, you were probably thinking that deeply pipelined processors like the Pentium 4 tend to have large die sizes, and if you were thinking so then you were right. However, a deep pipeline doesn’t have to spell a large die size, if you throw out the instruction window along with most of the hardware that’s intended to help the deep pipeline work well with branchy code.

The costs of deep pipelining: caching and branch prediction on the Xenon’s PPEs

Pipelining isn’t free, because increased pipeline depths normally increase die sizes in other ways. There’s the added control logic overhead associated with deeper pipelining, but this is minor compared to the amount of logic taken up by those other two hallmarks of a deeply pipelined machine: elaborate branch prediction logic and large caches.

For reasons I’ve explained in detail here, the more deeply a machine is pipelined, the greater an impact branch mispredicts and cache misses have on performance. Branch mispredicts and cache misses cause the pipeline to stall, thereby eliminating pipelining’s performance-enhancing advantages. Deeply pipelined processors invariably include fairly large caches and very elaborate, highly accurate branch prediction schemes aimed at preventing pipeline stalls. Large caches take up large amounts of die space and draw a correspondingly large amount of power. Similarly, complex branch prediction schemes like that of the PPC 970, which use multiple tables to store branch histories and branch targets, also carry a high cost in terms of die space and power consumption. All of these factors can contrive to make deep pipelining just as inefficient as a wide execution core.

Caching

The Xenon’s PPE’s have 32K instruction cache size and data cache sizes, both of which seem a bit small for a dual-threaded, deeply pipelined core. For instance, compare the Xenon’s cache sizes with the 64K instruction and data caches of the PowerPC 970, which as a 23-stage pipeline, or with the 32K instruction cache of the PowerPC G4, which has a 7-stage pipeline. The Xenon’s 32K/32K split L1 isn’t a disaster by any means, and 32K/32K is a fairly common L1 cache size. Still, you might expect more L1-cache at least on a core with a 21-stage pipeline. This small L1 size probably will not affect the Xenon’s performance too much as a game console chip, since Xbox 360 programmers will have a very fine level of control over the hardware and the cache hierarchy, but this may be a problem for the PPE if it’s going to be used in more general-purpose computing applications (e.g., an Apple machine).

The Xenon’s 1MB L2 cache is much smaller than what you’d expect for a three-core CPU; ideally, the more cores you have sharing a cache the larger you’d like it to be. In fact, it’s even more accurate to say that the more simultaneously running threads you have sharing a cache the larger you’d like it to be, and in this respect the Xenon’s 1MB L2 looks even worse. Each of the Xenon’s cores is two-way multithreaded, which means that up to six threads will have to share the same 1MB L2 cache. However, there are two good reasons for the relatively small size of the Xenon’s L2.

First, the practical die size constraints of building a three-core CPU meant that IBM didn’t have a whole lot of die area to spend on cache. The Xenon is already so big that it must be water cooled, so making it bigger wasn’t an option. The second, more important reason has to do with the way that streaming media applications in general, and the Xenon in specific, uses the cache.

If you read my PS2 vs. PC comparison and/or my article on caching, you know that the types of media applications that the Xenon is designed to run tend not to use the cache very efficiently. Media applications stream data through at a rapid rate, so data that’s placed in the cache is not reused. Since the whole point of a cache is that you reuse the data that it’s storing, this makes large caches pointless for data-intensive applications like games. A perfect example of this phenomenon was the original cacheless Celeron, which ran Quake just as fast its cache-endowed counterpart, the Pentium II.

As I described in detail in Part I of this series, the Xenon’s architects designed its cache with streaming media applications in mind. In write streaming mode, data generation threads can carve out a small, private portion of the cache for use as a kind of conduit to the GPU, which reads the vertex data produced by these threads from the Xenon’s L2. In read streaming mode, the cache can be bypassed entirely, so that data which won’t be reused is not needlessly fetched into the cache.

Read streaming and write streaming allow the triple-core, six-threaded Xenon CPU to get by on much less cache than one would need for a multicore CPU with similar stats that is intended for standard server applications. So the Xenon saves on cache real estate by asking programmers to use the cache in a smarter, very application-specific manner and by giving them the tools to do so.

Because the Xenon’s caches are tuned for streaming media applications, when it comes to streaming media code they should perform quite well. Unfortunately, however, the “streaming media” application profile doesn’t fit every part of the average game engine. In spite of the mitigating factors I’ve discussed above, the small size of Xenon’s L2 is going to hurt branch-intensive game logic, AI, and physics code. Just how much it’ll hurt is open to dispute, but I’ll take up this topic in more detail in my conclusions.

Branch prediction

Large enough caches are only one part of what it takes to keep deep pipelines fed, with the other part being branch prediction. The PPE does have branch prediction capabilities, but there’s some question as to how robust these are. Here is IBM’s Peter Hofstee discussing the role of branch prediction in the Cell architecture:

Modern branch prediction structures rely on large tables to store branch histories and cache branch target addresses or instructions for incremental increases in performance and thus tend to degrade performance per transistor.

[…]

Whereas modern hardware branch prediction structures do not do well on performance per transistor, software branch prediction tends to be an inexpensive means to gain a substantial performance improvement. In order to support high-frequency deeply pipelined designs efficiently, a branch hint instruction, present in the code well before the actual branch instruction allows for “just in time” prefetching of the instructions at the branch target. In combination with loop unrolling and interleaving, compilers can achieve near optimal performance even on deeply pipelined high-frequency processors.

Before taking this to apply directly to the Xenon’s PPE, it’s important to include the caveat that the context of the quote above and the reference to “loop unrolling and interleaving"—presumably using a very large register file—suggest that Hofstee is talking more about Cell’s SPEs than the PPE. Nonetheless, the quote does suggest that the Cell’s designers (remember that the Xenon shares the majority of its PPE architecture with the Cell) don’t consider branch prediction to be a good place to spend scarce transistor resources. It therefore seems likely that the PPE does not include the same level of branch prediction hardware as the PowerPC 970, despite its longer pipeline. (I’d be happy to be proven wrong on this count, though.)

So it’s probable that the PPE’s branch mispredict rate is higher than that of the 970, and that this higher mispredict rate, when combined with the PPE’s relatively small caches, will hurt performance on branch-intensive code. However, the same article that possibly suggests that the PPE skimps on branch prediction logic also suggests that software branch hints can take up the slack. These branch hints, which from what I’ve read have given mixed results in the past, are a way for programmers to tell the processor which branches are more likely to be taken. Thus the Xenon and the Cell will expect programmers to use branch hints to get optimal performance out of branch-intensive AI, game control, and physics code.

Conclusion

Like the Playstation 3’s Cell processor, the Xbox 360’s Xenon processor represents a fundamentally different approach to performance than that which characterized the previous generation of consoles—and the previous generation of PCs for that matter. The Xbox 360 will rely on multithreading and procedural synthesis to make visual environments that are more immersive than anything that’s possible on the present generation of either game consoles or PCs. Still, with all that pixel-pushing power at its disposal, there are a few probable flies in the Xbox 360 ointment.

Rumors and some game developer comments (on the record and off the record) have Xenon’s performance on branch-intensive game control, AI, and physics code as ranging from mediocre to downright bad. Xenon will be a streaming media monster, but the parts of the game engine that have to do with making the game fun to play (and not just pretty to look at) are probably going to suffer. Even if the PPE’s branch prediction is significantly better than I think it is, the relatively meager 1MB L2 cache that the game control, AI, and physics code will have to share with procedural synthesis and other graphics code will ensure that programmers have a hard time getting good performance out of non-graphics parts of the game.

Furthermore, the Xenon may be capable of running six threads at once, but the three types of branch-intensive code listed above are not as amenable to high levels of thread-level parallelization as graphics code. On the other hand, these types of code do benefit greatly from out-of-order execution, which Xenon lacks completely, a decent amount of execution core width, which Xenon also lacks; branch prediction hardware, which Xenon is probably short on; and large caches, which Xenon is definitely short on. The end result is a recipe for a console that provides developers with a wealth of graphics resources but that asks them to do more with less on the non-graphical side of gaming.

Still, there is some hope on that front. In the PC market where there are multiple processors to support, developers can’t fine-tune games for a specific CPU. This heterogeneity of hardware especially hurts with platform-sensitive optimizations like branch hints, which is one reason they don’t get used much. In contrast, with the Xenon, the hardware will be fixed, which means that programmers can go all-out in profiling and optimizing branchy game control, AI, and physics code using every trick in the book. Furthermore, console coders can also take heavy advantage of prefetching to overcome the Xenon’s cache size limitations. So it’s quite possible that as time goes on developers will find ways to get much better branch-intensive code performance out of the hardware. Just don’t count on it in the first generation of games, though.

At any rate, Playstation 3 fanboys shouldn’t get all flush over the idea that the Xenon will struggle on non-graphics code. However bad off Xenon will be in that department, the PS3’s Cell will probably be worse. The Cell has only one PPE to the Xenon’s three, which means that developers will have to cram all their game control, AI, and physics code into at most two threads that are sharing a very narrow execution core with no instruction window. (Don’t bother suggesting that the PS3 can use its SPEs for branch-intensive code, because the SPEs lack branch prediction entirely.) Furthermore, the PS3’s L2 is only 512K, which is half the size of the Xenon’s L2. So the PS3 doesn’t get much help with branches in the cache department. In short, the PS3 may fare a bit worse than the Xenon on non-graphics code, but on the upside it will probably fare a bit better on graphics code because of the seven SPEs.

In sum, the Xenon will certainly make the Xbox 360 a 3D graphics powerhouse. Though history suggests that the Xbox 360’s games will probably never attain the level of graphical realism promised by Microsoft’s pre-launch hype and portrayed in the pre-rendered “game demos” that were shown off at E3, gamers can nonetheless expect a significant advance in levels of graphical realism and visual immersiveness.

Bibliography and Suggested Reading

  • Peter Hofstee, Power Efficient Processor Architecture and The Cell Processor
  • Kevin Krewell, “Cell Moves Into the Limelight,” Microprocessor Report
  • Jon Stokes, Inside the Xbox 360, part I: procedural synthesis and dynamic worlds, Ars Technica.
  • Jon Stokes, The Xbox 360 Makes its Debut, Ars Technica
  • Jon Stokes, Introducing the IBM/Sony/Toshiba Cell Processor — Part I: the SIMD processing units, Ars Technica
  • Jon Stokes, Introducing the IBM/Sony/Toshiba Cell Processor — Part II: The Cell Architecture, Ars Technica
  • David T. Wang, ISSCC 2005: The CELL Microprocessor, Realworldtech.com
  • David T. Wang, CELL Microprocessor Revisited, Realworldtech.com
  • Scott Wasson, Details of ATI’s Xbox 360 GPU unveiled — A peek inside the monster new console GPU, Tech Report
  • Perpetual Current/Future Apple CPU thread: Episode III
0 Comments