Stack Pointer Prediction via Physical Register Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The limited number of architectural registers in processors leads to delays when variables stored in memory need to be read back into registers, as the process of reading from memory introduces latency, particularly in situations with insufficient registers for multiple functions or during function calls.

Innovation Solution

A method is introduced to predict pointer values of variables stored in the stack by maintaining a data structure that maps physical registers to stack pointers and offsets, allowing architectural registers to be directly mapped to physical registers without the need for memory loads, thereby eliminating latency and enabling out-of-order execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If variables are stored in memory to free up architectural registers, then register availability is improved, but access latency increases due to memory reads

Engineering Contradiction:
Improveregister availabilityVSAvoidaccess latency
Core Design Contradiction:
Quantity of substanceVSLoss of time

Solution Approach 1:

The patent performs preliminary actions by predicting stack pointer values and pre-loading variable values into physical registers before they are actually needed by instructions. The system anticipates future memory access requirements and prepares data in advance, eliminating latency when variables are needed.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a cushioning effect by maintaining a buffer of pre-loaded values in physical registers. When stack pointer prediction indicates that variables will be needed, they are loaded into registers in advance, providing a cushion against future latency requirements and ensuring data availability without blocking instruction execution.

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

2Quantity of substance

If the number of architectural registers is increased, then register availability is improved, but instruction set complexity increases

Engineering Contradiction:
Improvenumber of architectural registersVSAvoidinstruction set complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The patent transitions from a single-dimensional register architecture to a multi-dimensional solution by introducing physical registers as a second layer beyond architectural registers. This dimensional extension allows the system to provide additional storage capacity without modifying the architectural register interface or instruction set, effectively adding space in a new dimension rather than expanding the existing structure.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Solution Approach 2:

The patent introduces physical registers as an intermediary layer between architectural registers and memory. This intermediary structure provides additional storage capacity while maintaining the existing architectural interface, allowing the system to overcome architectural register limitations without requiring changes to the instruction set or architectural interface.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Speed

If variables are kept in architectural registers, then access speed is improved, but register availability decreases when functions are nested

Engineering Contradiction:
Improveaccess speedVSAvoidregister availability
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent segments the register storage system into two distinct parts: architectural registers for frequently accessed variables requiring fast access, and physical registers for additional storage capacity. This segmentation allows variables to be distributed across different storage layers based on access patterns, maintaining fast access for critical variables while providing additional storage for nested function variables.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent adds a second dimensional layer of physical registers that exists parallel to the architectural register space. This dimensional addition provides extra storage capacity for nested function variables without interfering with the existing architectural register interface or access patterns, allowing both fast access and increased availability to coexist.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS9934039B2Stack saved variable pointer value prediction
Publication Date: 2018.04.03 MIPS TECH INC
  • US9934039B2 patent drawing
  • US9934039B2 patent drawing
  • US9934039B2 patent drawing

AI summary

Methods of predicting stack pointer values of variables stored in a stack are described. When an instruction is seen which stores a variable in the stack in a position offset from the stack pointer, an entry is added to a data structure which identifies the physical register which currently stores the stack pointer, the physical register which stores the value of the variable and the offset value. Subsequently when an instruction to load a variable from the stack from a position which is identified by reference to the stack pointer is seen, the data structure is searched to see if there is a corresponding entry which includes the same offset and the same physical register storing the stack pointer as the load instruction. If a corresponding entry is found the architectural register in the load instruction is mapped to the physical register storing the value of the variable from the entry.