Table Call Instruction for Function Address Indexing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
As computing capabilities in devices like wireless telephones increase, the number of function calls grows, leading to larger code sizes due to extensive use of function call addresses, which results in increased memory usage and power consumption.
Innovation Solution
A table-based function call instruction is introduced, where an opcode and operand specify a function call address from a sorted table of frequently called functions, allowing for a reduction in code size by using fewer bits compared to generic function call instructions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If generic function call instructions are used to invoke functions, then any function can be called with full address flexibility, but the code size increases significantly
Solution Approach 1:
The function call mechanism is segmented into two parts: a compact table call instruction (8 bits) for frequently called functions, and full generic function call instructions for other cases. This segmentation allows the system to use different instruction types based on the calling frequency and address requirements, reducing overall code size while maintaining flexibility.
Solution Approach 2:
The function call addresses are pre-organized into a sorted table during link time or compile time, with frequently called functions placed at specific indices. This preliminary organization enables the use of compact indexed calls for these functions, eliminating the need to encode full addresses in the instructions themselves.
2Measurement precision
If full function call addresses are encoded in instructions, then precise function identification is achieved, but memory usage increases
Solution Approach 1:
A function call address table serves as an intermediary structure between the compact table call instruction and the actual function addresses. The instruction encodes only a small index (4 bits) rather than the full address, and the table translates this index into the complete function call address during execution, thereby reducing memory usage in the instruction stream while maintaining precise function identification.
3Adaptability or versatility
If larger code size is used to store all function call addresses, then complete function calling capability is maintained, but power consumption increases
Solution Approach 1:
The function calling capability is segmented into frequent and infrequent calls. By using compact instructions for frequent calls and reserving full instructions for infrequent calls, the overall instruction stream becomes smaller, reducing the energy required to fetch, decode, and execute instructions.
Solution Approach 2:
The instruction format parameter is changed from a fixed 32-bit generic format to a variable format where frequently used functions use an 8-bit compressed format. This parameter change reduces the average instruction size, thereby reducing the energy consumption associated with processing the instruction stream.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
An apparatus includes a memory that stores an instruction including an opcode and an operand. The operand specifies an immediate value or a register indicator of a register storing the immediate value. The immediate value is usable to identify a function call address. The function call address is selectable from a plurality of function call addresses.