15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In this case, however, during instruction execution a rename buffer becomes an architectural register<br />

and reclaiming is related to no longer used architectural registers, as discussed in the section on “Types<br />

of Rename Buffers.” This method relies on keeping track of the most recent prior instance of the same<br />

architectural register, and on reclaiming it when the instruction giving rise to the new instance completes. 28<br />

Renaming of Destination and Source Registers if Inter-Instruction Dependencies Exist<br />

between the Instructions Issued in the Same Cycle<br />

As we know, shelving relieves the processor of the need to check for data- and control dependencies as<br />

well as for busy EUs during instruction issue. Nevertheless, despite shelving, instructions issued in the<br />

same cycle must still be checked for inter-instruction dependencies, and, in the case of dependencies,<br />

the rename logic must be modified accordingly. Let us assume, for instance, that there are RAW dependencies<br />

between two subsequent instructions issued in the same cycle, as in the following example:<br />

© 2002 by CRC Press LLC<br />

i 1: mul r 2,…,…<br />

i 2: add …,r 2,…<br />

Here, i 2 needs the result of i 1 as r 2 is one of its source operands. We will also assume that the destination<br />

register of i 1 (r 2) will be renamed to r 33 as follows:<br />

i1′ : mul r33,…,… In this case the RAW-dependent source operand of i 2 (r 2) has to be renamed to r 33 rather than to the<br />

rename buffer allocated before renaming of i 1 to r 2.<br />

Similarly, if WAW dependencies exist among the instructions issued in the same cycle, as for instance,<br />

between the instructions<br />

i 1: mul r 2,…,…<br />

i 2: add r 2,…,…<br />

obviously, different rename buffers need to be allocated to the destination registers of i 1 and i 2, as shown<br />

below:<br />

i1′ : mul r34,…,… i2′ : add r35,…,… Recovery of the Rename Process from Wrongly Executed Speculation<br />

and Handling of Exceptions<br />

If the processor performs speculative execution, for instance due to branch prediction, it may happen<br />

that the speculation turns out to be wrong. In this case the processor needs to recover from the misspeculation.<br />

This involves essentially two tasks: (i) to undo all register mappings set up, and (ii) to reclaim<br />

rename buffers allocated, as already discussed. To invalidate established mappings there are two basic<br />

methods to choose from, independently of the actual implementation of renaming. The first option is<br />

to roll back all register mappings made during speculative execution, by using the identifiers of the faulty<br />

instructions, supplied by the ROB. While using this alternative, the recovery process lasts several cycles,<br />

since the processor can cancel only a small number of instructions (two to four) per cycle. A second<br />

alternative is based on checkpointing. In this method, before the processor begins with speculative<br />

execution, it saves the relevant machine state, including also the actual mapping, in shadow registers. If<br />

the speculative execution turns out to be wrong, the processor restores the machine state in a single cycle<br />

by reloading the saved state. For instance, both the PM1 (Sparc64) and the R10000 use checkpointing

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!