主要内容

Conditions for Code Replacement of Math Functions with HVX

Each math operators that can be used with the Support Package for Qualcomm Hexagon Processors requires specific conditions to allow code replacement by using the Qualcomm Hexagon Library (QHL). 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.

FunctionInput RequirementsParameter RequirementsEquivalent Functions
sin
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_sin_af

cos
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_cos_af

sqrt
  • Input can be vector or matrix

  • Real value

Length should be ≥ 4

  • qhmath_hvx_sqrt_af

rsqrt (Fixed-Point Designer)
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_rsqrt_af

log
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_log_af

log2
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_log2_af

log10
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_log10_af

asin

For MATLAB and row-major of Simulink block

  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_asin_af

acos

For MATLAB and row-major of Simulink block

  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_acos_af

atan
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_atan_af

sinh
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_sinh_af

cosh
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_cosh_af

tanh
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_tanh_af

exp
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_exp_af

power
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_pow_af

tan
  • Input can be vector or matrix

  • Real value

 
  • qhmath_hvx_tan_af

hypot
  • Input can be vector or matrix

  • Real value

Length should be ≥ 25
  • qhmath_hvx_hypot_af

See Also

| |

Topics