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.

FIGURE B. Terms relating to data dependencies occurring in straight line code (Instruction semantics is r 1 ← r 2∗r 3<br />

etc.).<br />

arise in scenarios when an instruction uses a register operand, which needs to have been loaded by a<br />

preceding load instruction from the memory, as shown in the example in Fig. B. If, however, the requested<br />

operand is produced by a preceding operational instruction, the arising dependency is called define-use<br />

dependency, as illustrated in Fig. B.<br />

WAR dependencies or anti-dependencies arise between instructions if a given instruction reads an<br />

operand from a particular register and a subsequent instruction writes the same register, as depicted in<br />

Fig. B. If, for any reason, the subsequent instruction (i 2) would have written this register before it is read<br />

by the previous one (i 1), then the subsequent instruction would pick up an erroneous operand value.<br />

Finally, two instructions are said to be WAW dependent, or output dependent, if they both write the<br />

same destination.<br />

WAR and WAW dependencies are designated as false dependencies, since they can be removed by<br />

appropriate techniques (that is register renaming in the case of register operands). By contrast, RAW<br />

dependencies are true dependencies, since they cannot be eliminated.<br />

Data dependencies may also occur in loops. This is the case if an instruction of the loop body is<br />

dependent on an instruction belonging to a previous loop iteration, as exemplified in Fig. A. This type<br />

of dependency is called recurrence, designated also as inter-iteration data dependency or loop carried<br />

dependency. In the above example the value of X(I) depends on the value that is computed in the previous<br />

iteration. The recurrence shown is a first-order linear one.<br />

Appendix B: The Principle of Instruction Shelving<br />

Instruction shelving (also known as indirect issue or dynamic instruction scheduling) 1–3,49 removes the<br />

issue bottleneck caused by control and data dependencies and by busy execution units. Its main idea is<br />

to “shelve” issued instructions and defer dependency checking until a subsequent processing step, designated<br />

as dispatching.<br />

Without shelving (see Fig. C) the processor issues instructions from the so called issue window (instruction<br />

window), to the execution units (EU). Actually, the issue window comprises the last n entries of the<br />

instruction buffer (I-buffer), where n is the issue rate. The processor decodes the instructions kept in the<br />

window and checks for dependencies between the instructions in the window and those in execution,<br />

and also among the instructions held in the window. Dependent instructions are not issued, moreover,<br />

depending on the issue policy of the processor, 36 they can even block the issue of subsequent not<br />

dependent instructions. Occurring blockages heavily restrict the average number of instructions issued<br />

per cycle and thus also processor performance.<br />

© 2002 by CRC Press LLC<br />

Load-use<br />

dependency<br />

i1: load r1, var<br />

i2: add r3, r1, r2<br />

RAW<br />

Read-after-Write<br />

dependency<br />

(Flow dependency)<br />

Define-use<br />

dependency<br />

i1: mul r1, r2, r3<br />

i2: add r5, r1, r4<br />

True dependencies<br />

Cannot be<br />

abandoned<br />

Inter-instruction<br />

data dependencies<br />

WAR<br />

Write-after-Read<br />

dependency<br />

(Anti dependency)<br />

i1: mul r1, r2, r3<br />

i2: add r2, r4, r5<br />

False dependencies<br />

Can be eliminated<br />

by register renaming<br />

WAW<br />

Write-after-Write<br />

dependency<br />

(Output dependency)<br />

i1: mul r1, r2, r3<br />

i2: add r1, r4, r5

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

Saved successfully!

Ooh no, something went wrong!