EasyManuals Logo
Home>Intel>Processor>ARCHITECTURE IA-32

Intel ARCHITECTURE IA-32 User Manual

Intel ARCHITECTURE IA-32
568 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #100 background imageLoading...
Page #100 background image
IA-32 Intel® Architecture Optimization
2-28
In this example, a loop that executes 100 times assigns x to every
even-numbered element and
y to every odd-numbered element. By
unrolling the loop you can make both assignments each iteration,
removing one branch in the loop body.
Compiler Support for Branch Prediction
Compilers can generate code that improves the efficiency of branch
prediction in the Pentium 4 and Pentium M processors. The Intel C++
Compiler accomplishes this by:
keeping code and data on separate pages
using conditional move instructions to eliminate branches
generating code that is consistent with the static branch prediction
algorithm
inlining where appropriate
unrolling, if the number of iterations is predictable
With profile-guided optimization, the Intel compiler can lay out basic
blocks to eliminate branches for the most frequently executed paths of a
function or at least improve their predictability. Branch prediction need
not be a concern at the source level. For more information, see the
Intel® C++ Compiler Users Guide.
Example 2-10 Loop Unrolling
Before unrolling:
do i=1,100
if (i mod 2 == 0) then a(i) = x
else a(i) = y
enddo
After unrolling
do i=1,100,2
a(i) = y
a(i+1) = x
enddo

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Intel ARCHITECTURE IA-32 and is the answer not in the manual?

Intel ARCHITECTURE IA-32 Specifications

General IconGeneral
BrandIntel
ModelARCHITECTURE IA-32
CategoryProcessor
LanguageEnglish

Related product manuals