General Optimization Guidelines
2
2-21
Examples 2-6, Example 2-7 provide basic rules for a static prediction
algorithm.
In Example 2-6, the backward branch
(
JC Begin
) is not in the BTB the
first time through, therefore, the BTB does not issue a prediction. The
static predictor, however, will predict the branch to be taken, so a
misprediction will not occur.
The first branch instruction (
JC Begin
conditional forward branch. It is not in the BTB the first time through,
but the static predictor will predict the branch to fall through
.
The static prediction algorithm correctly predicts that the
Call
Convert
instruction will be taken, even before the branch has any
branch history in the BTB.
Example 2-6
Static Taken Prediction Example
Begin:
mov
eax, mem32
and
eax, ebx
imul
eax, edx
shld
eax, 7
jc
Begin
Example 2-7
Static Not-Taken Prediction Example
mov
eax, mem32
and
eax, ebx
imul
eax, edx
shld
eax, 7
jc
Begin
mov
eax, 0
Begin:
call
Convert
Summary of Contents for ARCHITECTURE IA-32
Page 1: ...IA 32 Intel Architecture Optimization Reference Manual Order Number 248966 013US April 2006...
Page 220: ...IA 32 Intel Architecture Optimization 3 40...
Page 434: ...IA 32 Intel Architecture Optimization 9 20...
Page 514: ...IA 32 Intel Architecture Optimization B 60...
Page 536: ...IA 32 Intel Architecture Optimization C 22...