Example 2-6 Static Taken Prediction Example; Example 2-7 Static Not-Taken Prediction Example - Intel ARCHITECTURE IA-32 Reference Manual

Architecture optimization
Table of Contents

Advertisement

Examples 2-6, Example 2-7 provide basic rules for a static prediction
algorithm.
In Example 2-6, the backward branch (
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.
Example 2-6
Static Taken Prediction Example
Begin: mov
The first branch instruction (
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
Convert
branch history in the BTB.
Example 2-7
Static Not-Taken Prediction Example
Begin: call
eax, mem32
and
eax, ebx
imul
eax, edx
shld
eax, 7
jc
Begin
instruction will be taken, even before the branch has any
mov
eax, mem32
and
eax, ebx
imul
eax, edx
shld
eax, 7
jc
Begin
mov
eax, 0
Convert
General Optimization Guidelines
JC Begin
) in Example 2-7 segment is a
JC Begin
) is not in the BTB the
Call
2
2-21

Advertisement

Table of Contents
loading

Table of Contents