Single Instruction Register Loading for Function Call Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Special-purpose processors, optimized for mathematical operations, incur performance overhead when executing function calls due to inefficient loading of argument and internal values from memory into registers, breaking the 'black box' nature of functions and affecting program performance.
Innovation Solution
Generating a data structure that includes both argument and internal values used by a function, allowing a single instruction to load these values into registers before function execution, thereby reducing register load operations and maintaining the function as a 'black box'.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If multiple separate instructions are used to load argument and internal values into registers, then each value can be loaded individually, but the number of instructions increases and execution time increases
Solution Approach 1:
The patent combines multiple separate load instructions into a single compound instruction that loads multiple values (both argument and internal values) into multiple registers simultaneously. This merging of operations eliminates the sequential execution overhead of multiple individual load instructions, directly improving function call execution speed while reducing the time loss associated with register loading.
Solution Approach 2:
The patent performs preliminary organization of data by storing both argument and internal values together in a structured data structure in memory before the function call. This preliminary arrangement allows the single compound load instruction to efficiently retrieve all necessary values in one operation, rather than requiring multiple sequential accesses during function execution.
2Productivity
If the programmer optimizes the calling program by looking inside the function code, then loading performance can be improved, but the black box nature of the function is broken and future function changes may adversely impact program performance
Solution Approach 1:
The patent introduces an intermediary data structure that sits between the function definition and the calling program. This data structure explicitly declares all values (arguments and internal values) that the function needs, allowing the compiler to generate optimized load instructions without the caller needing to inspect the function body. This intermediary mechanism maintains the black box nature of functions while enabling performance optimization, and ensures that future function changes automatically update through interface regeneration without impacting calling programs.
Data Source
AI summary
A technique for efficient calling of functions on a processor generates an executable program having a function call by analysing an interface for the function that defines an argument expression and an internal value used solely within the function, and an argument declaration defining an argument value to be provided to the function when the program is run. A data structure is generated including the internal value and a resolved argument value derived from the argument expression and the argument value. A single instruction is encoded in the program to utilise the data structure. When the program is executed on a processor, the single instruction causes the processor to load the argument value and internal value from the data structure into registers in the processor, prior to evaluating the function. The function can then be executed without further register loads being performed.


