Static prediction, Static prediction -19, Example 2-4 – Intel ARCHITECTURE IA-32 User Manual

Page 91: Use of

Advertising
background image

General Optimization Guidelines

2

2-19

Static Prediction

Branches that do not have a history in the BTB (see the “Branch
Prediction” section) are predicte
d using a static prediction algorithm.
The Pentium 4, Pentium M, Intel Core Solo and Intel Core Duo
processors have similar static prediction algorithms:

Predict unconditional branches to be taken.

Predict indirect branches to be NOT taken.

In addition, conditional branches in processors based on the Intel
NetBurst microarchitecture are predicted using the following static
prediction algorithm:

Predict backward conditional branches to be taken. This rule is
suitable for loops.

Predict forward conditional branches to be NOT taken.

Pentium M, Intel Core Solo and Intel Core Duo processors do not
statically predict conditional branches according to the jump direction.
All conditional branches are dynamically predicted, even at their first
appearance.

Example 2-4

Use of

pause

Instruction

lock:

cmp eax, A

jne loop

; code in critical section:

loop:

pause

cmp eax, A

jne loop

jmp lock

Advertising