Examples
Example 2-1
Assembly Code with an Unpredictable Branch ............................. 2-17
Example 2-2
Code Optimization to Eliminate Branches ..................................... 2-17
Example 2-3
Eliminating Branch with CMOV Instruction.................................... 2-18
Example 2-4
Use of pause Instruction ............................................................... 2-19
Example 2-5
Pentium 4 Processor Static Branch Prediction Algorithm.............. 2-20
Example 2-6
Static Taken Prediction Example ................................................... 2-21
Example 2-7
Static Not-Taken Prediction Example ............................................ 2-21
Example 2-8
Indirect Branch With Two Favored Targets .................................... 2-25
Example 2-9
A Peeling Technique to Reduce Indirect Branch Misprediction ..... 2-26
Example 2-15 Two Examples to Avoid the Non-forwarding Situation in
Example 2-14 ................................................................................ 2-36
Example 2-26 Spill Scheduling Example Code .................................................... 2-92
Example 3-1
Identification of MMX Technology with cpuid................................... 3-3
Example 3-3
Identification of SSE by the OS ....................................................... 3-4
Example 3-2
Identification of SSE with cpuid ....................................................... 3-4
xv
Need help?
Do you have a question about the ARCHITECTURE IA-32 and is the answer not in the manual?