25112 Rev. 3.06 September 2005

Software Optimization Guide for AMD64 Processors

6.6Nonzero Code-Segment Base Values

Optimization

In 32-bit threads, avoid using a nonzero code-segment (CS) base value. (In 64-bit mode, segmentation is disabled and the segment base value is ignored and treated as zero.)

Application

This optimization applies to:

32-bit software

Rationale

A nonzero CS base value causes an additional two cycles of branch-misprediction penalty when compared with a CS base value of zero:

CS base value

 

Minimum branch penalty (cycles)

 

 

 

 

 

Prediction sequential

 

Prediction taken

Misprediction

 

 

 

 

 

 

 

0

0

 

1

10

 

 

 

 

 

Not 0

0

 

1

12

 

 

 

 

 

Chapter 6

Branch Optimizations

135

Page 151
Image 151
AMD 250 manual Nonzero Code-Segment Base Values, 135