Parallelism Via Instructions: Instruction-Level Parallelism (ILP)
Parallelism Via Instructions: Instruction-Level Parallelism (ILP)
2
SPECULATION
Speculation is an approach that allows the compiler or
the processor to guess about the properties of an
instruction.
Check whether guess was right
If so, complete the operation
If not, roll-back and do the right thing
4
STATIC MULTIPLE-ISSUE
5
STATIC MULTIPLE-ISSUE
6
STATIC MULTIPLE-ISSUE
8
HAZARDS IN THE TWO-ISSUE MIPS
Data hazard
Load-use hazard
Still we have only one cycle use latency, but now two
instructions.
So More aggressive scheduling required
10
SCHEDULING EXAMPLE
11
LOOP UNROLLING
12
LOOP UNROLLING
Antidependence :
Also called name dependence.
i2 tries to write a destination before it is read by i1
For example:
i1. R4 <- R1 + R5
i2. R5 <- R1 + R2
In any situation with a chance that i2 may finish
before i1 (i.e., with concurrent execution), it must be
ensured that the result of register R5 is not stored
before i1 has had a chance to fetch the operands.
13
LOOP UNROLLING
Output dependency
(i2 tries to write an operand before it is written by i1)
A write after write (WAW) data hazard may occur in
a concurrent execution environment.
For example:
i1. R2 'R2 <- R4 + R7
i2. R2 <- R1 + R3
The write back (WB) of i2 must be delayed
until i1 finishes executing.
Register renaming:
15
LOOP UNROLLING
16
DYNAMIC MULTIPLE ISSUE
These are Superscalar processors
Example
lw $t0, 20($s2)
addu $t1, $t0, $t2
sub $s4, $s4, $t3
slti $t5, $s4, 20
19
DYNAMICALLY SCHEDULED CPU
Instruction Fetch and Decode Unit: fetches instructions,
decodes them, and sends each instruction to a
corresponding functional unit for execution.
Each functional unit has buffers, called reservation
stations, which hold the operands and the operation.
When the buffer contains all its operands and the
functional unit is ready to execute, the result is
calculated and is sent to any reservation stations waiting
for this particular result as well as to the commit unit.
Commit unit buffers the result until it is safe to put the
result into the register file or, for a store, into memory.
The buffer in the commit unit - the reorder buffer.