Partial Data Type Promotion for Microprocessor Vectorization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional compilers limit the number of calculations a processor can perform by promoting all mixed data type elements to the highest data type, which reduces the number of elements that can be stored in a register and increases clock cycles, hindering efficient vectorization in microprocessors.
Innovation Solution
A compiler is configured to detect vectorizable loops and perform partial data type promotion, allowing calculations to be done using intermediate data types, thereby optimizing the compilation process and improving vectorization performance by enabling more elements to be stored in a register.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If all mixed data type elements are promoted to the highest data type, then calculation accuracy is improved, but the number of elements that can be stored in a register decreases and clock cycles increase
Solution Approach 1:
The patent applies local quality by promoting data types selectively rather than uniformly. Different elements in the same expression can be promoted to different intermediate data types based on their specific requirements, allowing some elements to use smaller data types (saving register space) while others use larger data types (maintaining accuracy where needed).
Solution Approach 2:
The patent changes the data type parameter from a fixed highest type to variable intermediate types. The compiler determines appropriate intermediate data types for each element based on the expression context, enabling flexible adjustment between precision and register capacity to optimize vectorization performance.
2Reliability
If full data type promotion is performed, then program correctness is maintained, but execution time increases due to more clock cycles
Solution Approach 1:
The patent applies partial action by performing data type promotion only where necessary for correctness rather than universally. The compiler identifies which elements require promotion to maintain program correctness and applies promotion selectively, avoiding unnecessary promotion overhead and reducing execution time.
Solution Approach 2:
The patent introduces intermediate data types as mediators between the original mixed data types and the final result type. These intermediate types allow calculations to proceed with appropriate precision while enabling better vectorization, and the results are subsequently converted to the final required type.
3Stability of the object's composition
If all elements are promoted to the highest data type, then data type consistency is improved, but the number of calculations the processor can perform decreases
Solution Approach 1:
The patent segments the data type promotion process into multiple stages with different intermediate types rather than applying a single highest data type to all elements. This segmentation allows different parts of the expression to use different data type sizes, increasing the total number of elements that can be processed in parallel.
Solution Approach 2:
The patent makes the data type selection dynamic rather than static. The compiler analyzes the expression and dynamically determines the appropriate intermediate data type for each element based on operational requirements, enabling flexible optimization between consistency and computational capacity.
Data Source
AI summary
Aspects of the invention include a compiler detecting an expression in a loop that includes elements of mixed data types. The compiler then promotes elements of a sub-expression of the expression to a same intermediate data type. The compiler then calculates the sub-expression using the elements of the same intermediate data type.


