Exploiting Bias in the Hysteresis Bit of 2-bit Saturating Counters in Branch Predictors

Gabriel H. Loh, Dana S. Henry, Arvind KrishnamurthyJ. Instr. Level Parallelism 2003

Abstract

Modern branch predictors utilize 2-bit saturating counters to provide hysteresis, preventing frequent state changes due to anomalous branch outcomes. This paper demonstrates that the hysteresis bit is highly redundant, often carrying less than 0.18 bits of actual information. We propose Shared Split Counters (SSC), a hardware optimization that shares a single hysteresis bit among multiple branch counters. Our evaluation using SPEC2000 benchmarks shows that SSC achieves a 25% to 37.5% reduction in predictor storage area with negligible impact on prediction accuracy.

Introduction

Branch prediction is critical for maintaining instruction pipeline efficiency in modern processors. The 2-bit saturating counter has been the industry standard for decades, using one bit for direction (Taken/Not-Taken) and a second for hysteresis (Strong/Weak). However, as predictors scale, the on-chip area and power consumption of these counters become significant. This research explores whether the full bit of hysteresis per counter is necessary, given that most branches exhibit strong directional bias.

Methodology

The authors introduce two key concepts to exploit hysteresis redundancy:

Split Counter Encoding

Standard 2-bit counters are re-mapped into "Split Counters" where the bits are functionally independent. The most significant bit (MSB) represents the predicted direction, while the least significant bit (LSB) explicitly represents the "strength" or confidence (Strong vs. Weak).

State transition diagrams for (a) standard 2-bit saturating counters and (b) the proposed split counter encoding.

Shared Split Counters (SSC)

By separating direction and strength bits into distinct arrays, the hardware can allow multiple direction entries to share a single strength (hysteresis) bit. For instance, an SSC4 configuration shares one hysteresis bit among four branches, effectively creating a 1.25-bit counter.

Analysis of Branch Bias

Entropy analysis using SPEC2000 integer benchmarks reveals that the "strength" bits are highly compressible. Using Shannon’s Source Coding Theorem, the authors found the entropy to be approximately 0.18 bits per prediction. This indicates that the hysteresis bit is underutilized by a factor of five.

Empirical data showing the high frequency of strong state predictions across SPEC2000 benchmarks.

As shown in the table above, over 90% of branch predictions occur when the counter is in a "strong" state. This high bias confirms that the hysteresis bit remains constant for the vast majority of executions, justifying the sharing mechanism.

Results and Discussion

The SSC approach yields significant hardware efficiency gains:

  • Area Efficiency: SSC2 (2-way sharing) and SSC4 (4-way sharing) reduce SRAM storage requirements by 25% and 37.5%, respectively.
  • Accuracy Trade-offs: For an 8K-entry gshare predictor, SSC2 results in a minor 2.8% increase in mispredictions. This gap narrows as predictor size increases; for 32KB+ predictors, the performance of SSC is nearly indistinguishable from standard 2-bit counters.
  • Information Density: The coding efficiency—information stored per bit—increases from 18% in standard designs to over 84% in SSC4.

Conclusion

The hysteresis bit in traditional branch predictors represents a significant source of wasted on-chip area. By leveraging the inherent bias in branch behavior through Shared Split Counters, designers can reclaim substantial storage area with minimal performance penalties. Future work may extend this sharing principle to other architectural structures like meta-predictors or data value predictors.

Summary updated

BibTeX
@article{loh2003exploiting,
  author = {Gabriel H. Loh and Dana S. Henry and Arvind Krishnamurthy},
  title = {{Exploiting Bias in the Hysteresis Bit of 2-bit Saturating Counters in Branch Predictors}},
  journal = {J. Instr. Level Parallelism},
  year = {2003},
}
Figure