Glossary

A.10 Register Renaming


As it executes instructions, the processor generates a myriad of temporary register results. These temporary values are stored in register files together with permanent values. The temporary values become new permanent values when their corresponding instructions graduate.

Register renaming is used to resolve data dependencies during the dynamic execution of instructions.

To ensure each instruction is given correct operand values, the logical register numbers (names) used in the instruction are mapped to physical registers. Each time a new value is put in a logical register, it is assigned to a new physical register. Thus, each physical register has only a single value. Dependencies are determined using these physical register numbers.

An example of register renaming is shown below. The following Doubleword Shift Left Logical instruction,



has one register operand (r2) plus a 5-bit shift count of value two stored in the sa field; the value in r2 is shifted left by two and this value is stored in r3.

The physical execution of the instruction above, with register renaming, is given below:

Physical execution Rename operation

p3xac p2 shift left 2 r3 = p3

When the DSLL instruction is executed, the logical destination register r3 is assigned a new physical register, p3, from the free list.

Register renaming also allows exceptions to be handled in a precise manner. Out-of-order execution means that an instruction can change its result register even before all prior instructions have been completed. However, if any of the prior instructions cause an exception, the original register value must be restored. Since each new register value is loaded into a new physical register (physical register values are not overwritten until the physical register is placed in the free list), previous values remain unchanged in the original physical registers and these previous values can be restored.*1

An instruction can be aborted up until the time it graduates, and all register and memory values can be restored to a precise state following any exception. This state is restored by unnaming the temporary physical registers assigned to subsequent instructions.

Registers are unnamed by writing the old destination register into the mapping table and returning the new destination register to the free list. Unnaming is done in reverse program order, in case a logical register was used more than once. After renaming, the register files contain only the permanent values which were created by instructions prior to the exception.

Once an instruction has graduated, all previous values are lost.




Copyright 1995, MIPS Technologies, Inc. -- 29 JAN 96


Generated with CERN WebMaker