Compiler Intrinsics for Math Function Accuracy and Performance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Software applications like MP3 players face inefficiencies due to resource-intensive standard math libraries when performing mathematical functions frequently, and custom implementations reduce portability across platforms.
Innovation Solution
A programmable compiler detects mathematical function invocations requiring reduced accuracy or speed and replaces them with intrinsics, converting invocations into inline object code for optimization, while preserving full accuracy functions when necessary.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If standard math library functions are used, then accuracy and robustness are improved, but computational resource consumption increases
Solution Approach 1:
The patent changes the accuracy parameter of math functions by providing multiple versions with different precision levels (e.g., 24-bit, 12-bit, 6-bit accuracy). The compiler selects the appropriate version based on the application's accuracy requirements, allowing lower CPU cycle consumption when full accuracy is not needed.
Solution Approach 2:
The patent applies partial action by implementing math functions with only the necessary level of accuracy for each specific application rather than providing complete high-accuracy implementations for all cases. This eliminates excessive computational effort when lower accuracy suffices.
2Reliability
If standard math library functions are used, then mathematical correctness is improved, but execution speed deteriorates
Solution Approach 1:
The patent provides multiple versions of math functions with different accuracy parameters (24-bit, 12-bit, 6-bit). The compiler selects the version that matches the required accuracy level, enabling faster execution when lower precision is acceptable while maintaining mathematical correctness when high precision is needed.
Solution Approach 2:
The patent segments the math function implementations into multiple versions with different accuracy characteristics. This segmentation allows the system to choose the appropriate level of precision for each computational context, optimizing execution speed without sacrificing necessary mathematical correctness.
3Productivity
If application-specific math function definitions are used, then execution speed is improved, but portability deteriorates
Solution Approach 1:
The patent creates a universal math function interface that works across multiple platforms and accuracy requirements. The same source code can call math functions that will be optimized for different accuracy levels and platforms through compiler directives, maintaining portability while enabling platform-specific optimizations.
Solution Approach 2:
The patent introduces compiler intrinsics and intermediate representation as mediators between the high-level source code and platform-specific implementations. This intermediary layer allows the compiler to translate portable source code into optimized machine code with appropriate accuracy levels for each target platform.
4Adaptability or versatility
If library function calls are used, then code reusability is improved, but overhead increases
Solution Approach 1:
The patent merges the math function implementations directly into the application code through compiler inlining. This eliminates the overhead of separate library function calls while maintaining code reusability, as the same source code can be compiled with different optimization levels for different platforms.
Data Source
AI summary
A programmable compiler detects from source code invocations of math functions that require reduced levels of accuracy, limited variable domains, or enhanced performance. The programmable compiler replaces such invocations with intrinsics from the compiler's own intrinsic library. The math function invocations are compiled into inline object code. The inline object can be subsequently optimized along with other object code through normal compiler optimization. If an accuracy requirement is beyond what any compiler intrinsic can provide, the programmable compiler preserves the invocation of the math function defined in a default library.


