Conditions for Code Replacement of MATLAB Functions with HVX
R2026bEach MATLAB® 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 Qualcomm Hexagon Vector eXtensions (HVX) library. You use this code replacement library to generate C/C++ code from a Simulink® model or from MATLAB code.
When you satisfy the specified conditions, the generated C/C++ code uses HVX support to achieve optimized execution on Qualcomm Hexagon processors.
HVX supports these MATLAB functions for floating-point data only when you configure the required properties, as specified in this table.
Basic Math Operations
| Function | Input Requirements | Property Requirements | Equivalent Functions |
|---|---|---|---|
sqrt |
| Length must be ≥ 4 |
|
rsqrt (Fixed-Point Designer) |
| - |
|
log |
| - |
|
log2 |
| - |
|
log10 |
| - |
|
exp |
| - |
|
power |
| - |
|
Trigonometric Operations
| Function | Input Requirements | Property Requirements | Equivalent Functions |
|---|---|---|---|
sin |
| - |
|
cos |
| - |
|
asin | For MATLAB and row-major of Simulink block
| - |
|
acos | For MATLAB and row-major of Simulink block
| - |
|
atan |
| - |
|
sinh |
| - |
|
cosh |
| - |
|
tanh |
| - |
|
tan |
| - |
|
hypot |
| Length must be ≥ 25 |
|
Fourier Transform Operations
| Function | Input Requirements | Output Requirements | Input Alignment | Output Alignment | Property Requirements | Equivalent Functions |
|---|---|---|---|---|---|---|
fft |
|
| 128 | 128 |
Note To enable code replacement, use the syntax
If you specify additional inputs such as |
|
fft |
|
| 128 | 128 | mw_qhdsp_hvx_c1dfft_af_opt_builtin | |
ifft |
|
| 128 | 128 |
Note To enable code replacement, use the syntax
If you specify additional inputs such as | mw_qhdsp_hvx_c1difft_af_builtin |