General Optimization Guidelines
2
2-19
Static Prediction
Branches that do not have a history in the BTB (see the “Branch
Prediction” section) are predicted 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
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...