Conditions for Code Replacement of Math Functions with HVX
Each math function that can be used with the Embedded Coder® Support Package for Qualcomm® Hexagon® Processors requires specific conditions to allow code replacement by using the Hexagon Vector Extension (HVX). You use this code replacement when generating C/C++ code from a model or from MATLAB® code.
If you do not meet the specific requirements, then the generated C/C++ code runs on the Qualcomm Hexagon Processors. However, this generated code does not use library support.
The library supports these Math functions only when you set specific properties, as indicated in this table:
Function | Input Requirements | Parameter Requirements | Equivalent Functions |
---|---|---|---|
sin |
|
| |
cos |
|
| |
sqrt |
| Length should be ≥ 4 |
|
rsqrt (Fixed-Point Designer) |
|
| |
log |
|
| |
log2 |
|
| |
log10 |
|
| |
asin | For MATLAB and row-major of Simulink block
|
| |
acos | For MATLAB and row-major of Simulink block
|
| |
atan |
|
| |
sinh |
|
| |
cosh |
|
| |
tanh |
|
| |
exp |
|
| |
power |
|
| |
tan |
|
| |
hypot |
| Length should be ≥ 25 |
|
See Also
Conditions for Code Replacement of Math Operators with HVX | Conditions for Code Replacement of DSP Blocks with HVX | Conditions for Code Replacement of DSP System Objects with HVX