Return Stack Buffer Index Storage for Speculative Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Return stack buffers (RSBs) can become corrupted due to speculative execution, leading to mis-speculations and loss of information, as existing methods to preserve alignment require additional storage or are impractical due to significant storage requirements.

Innovation Solution

Modifying the RSB to store index values instead of addresses, using a look-up table to store return addresses, and implementing a structure with multiple address slots per entry, along with pointer bits to manage slot usage, allowing for speculative pop restoration without full RSB storage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the RSB stores full return addresses, then accurate return address prediction is achieved, but storage requirements become excessive and corruption from speculation cannot be effectively managed

Engineering Contradiction:
Improvereturn address prediction accuracyVSAvoidstorage requirements
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The return address storage is segmented into two parts: a compact RSB that stores only index values (not full addresses), and a separate look-up table that stores the actual return addresses. This segmentation allows the RSB to remain small and efficient while the look-up table provides the full address information when needed, resolving the contradiction between storage efficiency and prediction accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Index values serve as intermediaries between the compact RSB and the full return addresses in the look-up table. Instead of storing complete addresses in the RSB, the system stores compact indexes that reference the look-up table, enabling efficient storage while maintaining the ability to retrieve full addresses for accurate prediction.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If speculative execution is allowed, then processing speed is improved, but the RSB becomes corrupted leading to mis-speculations

Engineering Contradiction:
Improveprocessing speedVSAvoidRSB integrity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system prepares for potential speculation corruption by storing snapshots of the RSB state at prediction points. When speculation is detected or confirmed, these pre-stored snapshots allow the system to restore the RSB to its correct state, cushioning against the harmful effects of speculative corruption while maintaining high processing speed.

Inventive Principle:
Principle #11Beforehand cushioning (Prior cushioning)

Solution Approach 2:

The system implements feedback mechanisms where the correctness of speculative predictions is monitored. When mis-speculation is detected, the system uses stored index snapshots to restore the RSB to the correct state, creating a feedback loop that maintains RSB integrity even during speculative execution.

Inventive Principle:
Principle #23Feedback

3Stability of the object's composition

If a pointer to the top of the RSB is stored with every prediction, then alignment is preserved, but information can still be lost due to speculative pops

Engineering Contradiction:
ImproveRSB alignmentVSAvoidspeculative pop information
Core Design Contradiction:
Stability of the object's compositionVSLoss of information

Solution Approach 1:

The system performs preliminary action by storing snapshots of the RSB index values at the point of prediction, before speculative execution occurs. This allows the system to restore the exact RSB state if speculation goes wrong, preventing information loss from speculative pops while maintaining alignment through the stored pointer.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Instead of storing the entire RSB (which would be excessive), the system creates compact copies of only the critical index values and pointer information. These copies are sufficient to restore alignment and prevent information loss without the full storage cost of duplicating the entire RSB structure.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS9424203B2Storing look-up table indexes in a return stack buffer
Publication Date: 2016.08.23 MIPS TECH INC
  • US9424203B2 patent drawing
  • US9424203B2 patent drawing
  • US9424203B2 patent drawing

AI summary

A return stack buffers (RSB) is modified to store index values instead of addresses. When a function is called, the address following the function call is stored in a look-up table and the index at which the address is stored is pushed to the RSB. When a function returns, an index is popped from the RSB and used to identify an address in the look-up table. In another embodiment, the RSB is modified such that each entry comprises two or more address slots. When a function is called, the address following the function call is pushed to the RSB and stored in a selected one of the address slots in a top entry in the RSB. One or more pointer bits within the entry are set to indicate which slot the address was stored in.