Branch Target Buffer with Auxiliary Indirect Cache for Branch Prediction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Modern processors face inefficiencies in branch prediction, particularly in RISC architectures, due to pipeline stalls caused by unresolved branch instructions, which can lead to reduced performance and increased clock cycles when mispredictions occur.

Innovation Solution

Implementing a branch target buffer (BTB) and an indirect branch target buffer (BTBI) within the processor core, utilizing a hashed program counter and branch history information for efficient branch prediction, allowing for both relative and absolute/indirect branching, thereby reducing pipeline flushes and improving performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If a single branch target buffer is used for all branch types, then the device complexity is reduced, but the branch prediction accuracy deteriorates for indirect branches

Engineering Contradiction:
Improvebranch prediction structureVSAvoidbranch prediction accuracy
Core Design Contradiction:
Device complexityVSMeasurement precision

Solution Approach 1:

The branch prediction structure is segmented into two separate buffers: a primary branch target buffer for direct branches and an indirect branch target buffer for indirect branches. This segmentation allows each buffer to be optimized for its specific branch type, improving prediction accuracy without excessive complexity increase.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

An intermediary mechanism is introduced to determine which buffer to access based on the branch type. The system uses an indirect branch indicator to select between the primary and indirect buffers, acting as a mediator that routes different branch types to their appropriate prediction structures.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Device complexity

If branch prediction is not used, then the device complexity is reduced, but the processor performance deteriorates due to pipeline stalls

Engineering Contradiction:
Improvebranch prediction circuitryVSAvoidprocessor performance
Core Design Contradiction:
Device complexityVSProductivity

Solution Approach 1:

The branch target buffers store pre-calculated target addresses for branch instructions. By having these addresses readily available in the buffers before execution, the processor can continue pipeline operations without stalls, as the target address is already prepared and stored.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses branch history information as feedback to improve prediction accuracy. Historical branch outcomes are stored and used to inform future predictions, creating a feedback loop that continuously improves processor performance by learning from past execution patterns.

Inventive Principle:
Principle #23Feedback

3Measurement precision

If a comprehensive branch target buffer is used for all branch types, then the branch prediction accuracy is improved, but the loss of time for buffer searches increases

Engineering Contradiction:
Improvebranch prediction accuracyVSAvoidbuffer search time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The buffer search time is reduced by segmenting the search space into two smaller, specialized buffers. Instead of searching through a large comprehensive buffer, the system performs targeted searches in either the primary or indirect buffer based on the branch type, significantly reducing average search time.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The buffer structure is pre-organized with dedicated regions for different branch types. This preliminary organization allows the system to directly access the appropriate buffer without performing extensive searches, as the target location is determined in advance by the branch type classification.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12360769B2Branch target buffer operation with auxiliary indirect cache
Publication Date: 2025.07.15 AKEANA INC
  • US12360769B2 patent drawing
  • US12360769B2 patent drawing
  • US12360769B2 patent drawing

AI summary

Disclosed embodiments provide techniques for branch prediction. A processor core is accessed. The processor core is coupled to memory and includes branch prediction circuitry. The branch prediction circuitry includes a branch target buffer (BTB) and an indirect branch target buffer (BTBI). A hashed program counter within the processor core is read. The BTB and BTBI are searched. The searching the BTB is accomplished with the hashed program counter and the searching the BTBI is accomplished with the hashed program counter and branch history information. A predicted branch target address within the BTBI or the BTB is matched. The matching within the BTBI is based on an indirect branch instruction, and the matching within the BTB is based on other branch instruction types. The predicted branch target address that was matched is predicted taken. The processor core is directed to fetch a next instruction from the predicted branch target address.