Main Content

Conditions for Code Replacement of Math Functions with QHL

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 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
  • Scalar, vector or 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

cos
  • Scalar, vector or 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

abs
  • Scalar, vector or matrix

  • Real Values

Input Length > 11

  • Vector, and matrix real inputs

    • qhmath_abs_af

sqrt
  • Scalar, vector or matrix

  • Real Values

 
  • Scalar real inputs

    • qhmath_sqrt_f

  • Vector, and matrix real inputs

    • qhmath_sqrt_af

rsqrt (Fixed-Point Designer)
  • Scalar, vector or matrix

  • Real values

 
  • Scalar real inputs

    • qhmath_rsqrt_f

  • Vector, and matrix real inputs

    • qhmath_rsqrt_af

log
  • Scalar, vector or 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

log2
  • Scalar, vector or matrix

  • Real values

 
  • Scalar real inputs

    • qhmath_log2_f

  • Vector, and matrix real inputs

    • qhmath_log2_af

log10
  • Scalar, vector or matrix

  • Real values

 
  • Scalar real inputs

    • qhmath_log10_f

  • Vector, and matrix real inputs

    • qhmath_log10_af

asin
  • Scalar, vector or 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

acos
  • Scalar, vector or 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

atan
  • Scalar, vector or 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

sinh
  • Scalar, vector or 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

cosh
  • Scalar, vector or 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

tanh
  • Scalar, vector or 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

exp
  • Scalar, vector or 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

power
  • Scalar, vector or 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

tan
  • Scalar, vector or matrix

  • Real and Complex values

 
  • Scalar real inputs

    • qhmath_tan_f

  • Vector and matrix real inputs

    • qhmath_tan_af

  • Scalar, vector, and matrix complex inputs

    • mw_qhcomplex_ctan_f

ceil
  • Scalar

  • Real values

 
  • Scalar real inputs

    • qhmath_ceil

floor
  • Scalar

  • Real values

 
  • Scalar real inputs

    • qhmath_floor

hypot
  • Scalar

  • Real values

 
  • Scalar real inputs

    • qhmath_hypot

See Also

| | | | |

Topics