Constant Pool Base Register for Subroutine Constant Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing constant data accessing methods, such as MIPS32 and program-counter-relative data access, are inefficient in managing large code sizes due to increased instruction sizes when the distance from the program-counter-relative load instruction to constant data addresses grows, leading to suboptimal code size and efficiency.
Innovation Solution
A constant data accessing system that employs a compiler with a constant pool handler, a computer processor with a constant pool base register, and an instruction set module for managing and accessing constants, which involves placing constants in a pool, determining a constant pool base address, and using this register to access and manage the constants through specific instructions like Push-CPBR, Call-and-Set-CPBR, and Pop-CPBR.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If program-counter-relative data access is used to access constants, then the code size for accessing constants is reduced to 4 bytes when the distance is within range, but the instruction size increases to 8 bytes when the distance from the program-counter-relative load instruction to the constant data address becomes large
Solution Approach 1:
The patent introduces a constant pool base register as an intermediary between the program counter and the constant data. This register holds the base address of the constant pool, allowing the processor to access constants using a fixed-size instruction format regardless of the distance to the constant data, thereby resolving the contradiction between code size efficiency and instruction size stability
Solution Approach 2:
The constant pool base register is automatically managed by the compiler and processor system. The compiler automatically places constants in a constant pool and updates the base register, while the processor automatically uses this register for constant access. This self-service mechanism eliminates the need for manual intervention and ensures consistent performance
2Length of stationary object
If the code size of the subroutine is very large, then the address distance from the program-counter-relative load instruction to the address of the constant becomes longer, but this increases the instruction size to 8 bytes
Solution Approach 1:
The patent segments the address access mechanism into two parts: a base address stored in the constant pool base register and an offset contained in the instruction. This segmentation allows the instruction to remain compact (4 bytes) while handling large address distances through the combination of the base register value and the instruction offset
Solution Approach 2:
The patent transitions from a one-dimensional program-counter-relative addressing mode to a two-dimensional addressing mode by introducing the constant pool base register as an additional dimension. This allows the system to access constants at any address by combining the base register (providing the high-order address bits) with the instruction offset (providing the low-order address bits)
Data Source
AI summary
A constant data accessing system having a constant pool comprises a computer processor having a constant pool base register, a compiler having a constant pool handler, and an instruction set module having a constant pool instruction set unit. The constant pool base register is configured to store a value of constant pool base address of one or a plurality of subroutines which have constants to be accessed.


