Processor Reciprocal Instruction Lookup Table Accuracy
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing reciprocal and square root reciprocal instructions in processors suffer from relatively low accuracy (2−11) and fail to provide correct results for very small or denormal values, necessitating software workarounds and additional iterations.
Innovation Solution
Implementing user-level instructions (VRCP14 and VRSQRT14) that perform reciprocal and square root reciprocal operations with a relative accuracy of 2−14, using a modified algorithm with a lookup table and full sign elimination, allowing single iteration processing and reduced hardware requirements.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If existing RCP and RSQRT instructions are used, then hardware implementation is simple, but accuracy is low (2^-11) and fails for denormal values
Solution Approach 1:
The reciprocal calculation is divided into two segments: a lookup table providing initial approximation and a correction term. The lookup table handles the bulk of the computation while the correction term refines the result, achieving high accuracy without requiring a completely complex hardware implementation.
Solution Approach 2:
The lookup table pre-computes reciprocal values for standard ranges, providing a preliminary accurate result before applying correction terms. This preliminary action eliminates the need for complex real-time computation while maintaining high precision.
2Measurement precision
If additional iterations of algorithm are performed to increase accuracy, then measurement precision improves, but software overhead increases
Solution Approach 1:
The patent replaces iterative software algorithms with a hardware-based lookup table approach. Instead of performing multiple software iterations to improve accuracy, the hardware directly provides high-precision results through pre-computed tables and correction terms, eliminating software overhead while maintaining precision.
Solution Approach 2:
The patent changes the computational parameters by using a lookup table with correction terms instead of iterative algorithms. This parameter change allows achieving high accuracy (2^-14) in a single operation without the time cost of multiple iterations.
3Reliability
If secondary path is used to handle denormal operands, then correctness for denormal values is achieved, but processing speed decreases
Solution Approach 1:
The lookup table is designed to handle all input types universally, including normal and denormal values. By making the table universal, the patent eliminates the need for separate handling paths, achieving both correctness for denormal values and high processing speed in a single unified operation.
Data Source
AI summary
In one embodiment, the present invention includes a method for receiving a reciprocal instruction and an operand in a processor, accessing an entry of a lookup table based on a portion of the operand and the instruction, generating an encoder output based on a type of the reciprocal instruction and whether the reciprocal instruction is a legacy instruction, and selecting portions of the lookup table entry and input operand to be provided to a reciprocal logic unit based on the encoder output. Other embodiments are described and claimed.


