Compiler Intrinsics for Math Function Accuracy and Performance

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering Contradiction Analysis

1Measurement precision

If standard math library functions are used, then accuracy and robustness are improved, but computational resource consumption increases

Engineering Contradiction:
Improvemath function accuracyVSAvoidCPU cycle consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

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.

Inventive Principle:
Principle #35Parameter changes

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.

Inventive Principle:
Principle #16Partial or excessive action

2Reliability

If standard math library functions are used, then mathematical correctness is improved, but execution speed deteriorates

Engineering Contradiction:
Improvemathematical correctnessVSAvoidexecution speed
Core Design Contradiction:
ReliabilityVSProductivity

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.

Inventive Principle:
Principle #35Parameter changes

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.

Inventive Principle:
Principle #1Segmentation

3Productivity

If application-specific math function definitions are used, then execution speed is improved, but portability deteriorates

Engineering Contradiction:
Improveexecution speedVSAvoidsource code portability
Core Design Contradiction:
ProductivityVSAdaptability or versatility

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.

Inventive Principle:
Principle #6Universality (Multi-functionality)

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Adaptability or versatility

If library function calls are used, then code reusability is improved, but overhead increases

Engineering Contradiction:
Improvecode reusabilityVSAvoidlibrary call overhead
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

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.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS8370822B2Compiling techniques for providing limited accuracy and enhanced performance granularity
Publication Date: 2013.02.05 APPLE INC
  • US8370822B2 patent drawing
  • US8370822B2 patent drawing
  • US8370822B2 patent drawing

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.