Chapter 6 Branch Optimizations 125
Software Optimization Guide for AMD64 Processors
25112 Rev. 3.06 September 2005
Chapter 6 Branch Optimizations
The optimizations in this chapter help improve branch prediction and minimize branch penalties.
In This Chapter
This chapter covers the following topics:
Topic Page
Density of Branches 126
Two-Byte Near-Return RET Instruction 128
Branches That Depend on Random Data 130
Pairing CALL and RETURN 132
Recursive Functions 133
Nonzero Code-Segment Base Values 135
Replacing Branches with Computation 136
The LOOP Instruction 141
Far Control-Transfer Instructions 142