Unit 1 Modern Processors
Unit 1 Modern Processors
Modern processors
Objectives of Chapter 1
For simplicity, let us suppose every instruction has five stages, each
taking one cycle.
The following picture shows the situation of no pipelining:
The situation with instruction pipelining
More about pipelining
f o r ( i = 0 ; i<N; i++)
A[i] = B[i] * C[i];
Tseq N·m
= N+m−1
Tpipe
dependencies
memory latencies
insufficient loop length,
branch mispredictions
f o r ( i = 0 ; i<N; i++) {
i f ( y [ i ] < 0.)
x[ i] = s*y[i];
else
x[i] =
y[i]*y[i];
}
Mask registers
f o r ( i = 0 ; i<N; i++) {
i f ( y [ i ] > 0.)
x[ i] = sqrt(y[i]);
}
There is only the i f branch (no else branch). Also, the sqrt
calculation is expensive. Execution for all loop indices can be a
huge waste of resource. What should be done in such a case?
The gather/scatter method