Main Content

Conditions for Code Replacement of Math Functions with QHL

Each math function 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
1sin
  • Input can be scalar/vector/matrix

  • Real or Complex Values

 
  • Scalar real inputs

    • qhmath_sin_f

  • Scalar, vector, and matrix real inputs

    • qhmath_sin_af

  • Scalar, vector, and matrix complex inputs

    • mw_qhcomplex_csin_f

2cos
  • Input can be scalar/vector/matrix

  • Real or Complex Values

 
  • Scalar real inputs

    • qhmath_cos_f

  • Scalar, vector, and matrix real inputs

    • qhmath_cos_af

  • Scalar, vector, and matrix complex inputs

    • mw_qhcomplex_ccos_f

3abs
  • Input can be scalar/vector/matrix

  • Real Values

Input Length > 11

  • Vector, and matrix real inputs

    • qhmath_abs_af

4sqrt
  • Input can be scalar/vector/matrix

  • Real Values

 
  • Scalar real inputs

    • qhmath_sqrt_f

  • Vector, and matrix real inputs

    • qhmath_sqrt_af

5rsqrt (Fixed-Point Designer)
  • Input can be scalar/vector/matrix

  • Real Values

 
  • Scalar real inputs

    • qhmath_rsqrt_f

  • Vector, and matrix real inputs

    • qhmath_rsqrt_af

6log
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_log_f

  • Vector, and matrix real inputs

    • qhmath_log_af

  • Scalar complex inputs

    • mw_qhcomplex_clog_f

  • Vector and matrix complex inputs

    • mw_qhcomplex_clog_af

7log2
  • Input can be scalar/vector/matrix

  • Real values

 
  • Scalar real inputs

    • qhmath_log2_f

  • Vector, and matrix real inputs

    • qhmath_log2_af

8log10
  • Input can be scalar/vector/matrix

  • Real values

 
  • Scalar real inputs

    • qhmath_log10_f

  • Vector, and matrix real inputs

    • qhmath_log10_af

9asin
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_asin_f

  • vector, and matrix real inputs

    • qhmath_asin_af

  • scalar complex inputs

    • mw_qhcomplex_casin_f

  • Vector, and Matrix complex inputs

    • mw_qhcomplex_casin_af

10acos
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_acos_f

  • vector, and matrix real inputs

    • qhmath_acos_af

  • scalar complex inputs

    • mw_qhcomplex_cacos_f

  • Vector, and Matrix complex inputs

    • mw_qhcomplex_cacos_af

11atan
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_atan_f

  • vector, and matrix real inputs

    • qhmath_atan_af

  • scalar complex inputs

    • mw_qhcomplex_catan_f

  • Vector, and Matrix complex inputs

    • mw_qhcomplex_catan_af

12sinh
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_asinh_f

  • vector, and matrix real inputs

    • qhmath_asinh_af

  • scalar complex inputs

    • mw_qhcomplex_csinh_f

  • Vector, and Matrix complex inputs

    • mw_qhcomplex_csinh_af

13cosh
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_acosh_f

  • vector, and matrix real inputs

    • qhmath_acosh_af

  • scalar complex inputs

    • mw_qhcomplex_ccosh_f

  • Vector, and Matrix complex inputs

    • mw_qhcomplex_ccosh_af

14tanh
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_ctanh_f

  • vector, and matrix real inputs

    • qhmath_ctanh_af

  • scalar complex inputs

    • mw_qhcomplex_ctanh_f

  • Vector, and Matrix complex inputs

    • mw_qhcomplex_ccosh_af

15exp
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_cexp_f

  • vector, and matrix real inputs

    • qhmath_cexp_af

  • scalar complex inputs

    • mw_qhcomplex_cexp_f

  • Vector, and Matrix complex inputs

    • mw_qhcomplex_cexp_af

16power
  • Input can be scalar/vector/matrix

  • Real and Complex values

 
  • Scalar, matrix real inputs (base) and vector, matrix real inputs (exponent)

    • mw_qhmath_pow_f

  • Vector real inputs (base) and scalar real inputs (exponent)

    • qhmath_pow_af

  • Scalar, vector, and matrix complex inputs (base and exponent)

    • mw_qhcomplex_cpow_f

See Also

| | | | |

Related Topics