5.3.4 · D1Advanced Microarchitecture

Foundations — Register renaming

2,017 words9 min readBack to topic

This page assumes nothing. Before you can read the parent note Register renaming, you must be able to see what a register is, what a "dependency" really is, and what every arrow and bracket in its formulas mean. We build each piece, anchor it to a picture, and only then use it.


1. What is a register?

Picture a row of labelled cups. Each cup holds exactly one value. The processor can only do arithmetic on values sitting in cups — never on values still out in main memory.


2. Architectural vs physical registers

The parent note constantly splits registers into two kinds. This split is the whole heart of the topic, so we define both from zero.

The notation just means "some architectural register", and means "some physical register". The subscript is a label on the label telling you which world you're in: the visible naming world, or the hidden storage world.


3. Reading the arrow: (the "points to" relation)

The parent note writes things like . Before you can read a single formula, you must know what that arrow means here.

So reads out loud as: "the name R1 is currently pointing at physical box P10; if you want R1's value, look inside P10."


4. What is a dependency?

Instructions form a sequence. Sometimes a later instruction must wait for an earlier one; sometimes it only appears to. The parent note calls these RAW, WAR, WAW. Let's earn each name.

The letters stand for Read and Write applied to the same register, in a time order. Read the name as "X-After-Y":

Here is the picture that makes the difference obvious:


5. op and the instruction shape Rdest ← Rsrc1 op Rsrc2

Every arithmetic instruction the parent note renames has this shape. Decode it symbol by symbol:

So ADD R1, R2, R3 means : read R2 and R3, add them, store into R1.


6. The bookkeeping structures: RAT, Free list, ROB

These three appear in every formula. They are just three simple containers.

The square-bracket notation is just table lookup — like reading cell "R1" of a spreadsheet. If , then R1 lives in P10 right now.


7. The in the sizing formula

The parent ends with . Decode:


The prerequisite map

Register = fast storage box

Architectural vs Physical registers

Instruction shape dest gets src op src

Mapping arrow points to

RAT ledger of pointers

Dependencies RAW WAR WAW

False vs True dependency

Register Renaming

Free list of empty boxes

ROB waiting line log

Everything on the left of an arrow is a thing you must already picture before the thing on its right makes sense. Renaming (bottom right) sits on top of all of it.


Connections


Equipment checklist

A register is a
a tiny fast storage box inside the CPU that holds exactly one number.
The difference between an architectural and a physical register is
architectural = a name the program is allowed to say (fixed, few); physical = an actual storage box in silicon (hidden, many).
The arrow in means
"the name R1 currently points at box P10" — a lookup/pointer, NOT equality.
RAW stands for and means
Read After Write — a later instruction reads a value an earlier one wrote; a TRUE dependency.
WAR and WAW are called false dependencies because
they are only clashes over the same name; giving the later writer a different box removes them, since no real data flows.
means
look up R2's row in the alias table and read which physical box it points to right now.
FreeList.pop() does
takes one currently-empty physical box off the pile so it can be assigned to a new destination.
The ROB records the old physical mapping so that
if an exception cancels the instruction the pointer can be restored, and so we know which box to free once it commits.
In Rdest ← Rsrc1 op Rsrc2, the means
"gets the value of" — compute the right side, then store it into the destination.
says
you need at least one box per committed name plus one per in-flight instruction, or decode stalls (register pressure).