Main Content

Conditions for Code Replacement of Math Operators with QHL

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 operators only when you set specific properties, as indicated in this table:

 OperatorsInput RequirementsParameter RequirementsEquivalent Functions
1 add
  • Input can be vector/matrix

  • Real or Complex Values

  • Real Input Length > 1000

    OR

    Complex Input Length >= 500

  • Vector and matrix real inputs

    • qhblas_vector_add_af

  • Vector and matrix complex inputs

    • mw_qhblas_vector_add_acf

2sub (Fixed-Point Designer)
  • Input can be vector/matrix

  • Real or Complex Values

  • Real Input Length > 1000

    OR

    Complex Input Length >= 500

  • Vector and matrix real inputs

    • qhblas_vector_sub_af

  • Vector and matrix complex inputs

    • mw_qhblas_vector_sub_acf

3 Mul - elementwise
  • Input can be vector/matrix

  • Real or Complex Values

  • Real Input Length > 1000

    OR

    Complex Input Length >= 500

  • Vector and matrix real inputs

    • qhblas_vector_hadamard_af

  • Vector and matrix complex inputs

    • mw_qhblas_vector_hadamard_acf

4 Mul - Scaling
  • Input can be vector/matrix

  • Real or Complex Values

  • Real Input Length > 1000

    OR

    Complex Input Length >= 500

  • Vector and matrix real inputs

    • qhblas_vector_add_af

  • Vector and matrix complex inputs

    • mw_qhblas_vector_add_acf

5 Matrix inverse
  • Real or Complex Values

  • square input

  • Dim = 2, 3 and 4

 
  • Matrix real inputs

    • mw_qhblas_matrix_inverse_af

  • Matrix complex inputs

    • mw_qhblas_matrix_inverse_acf

6 Comparators
  • Input can be a vector/matrix

  • Real or Complex values

      • Equal (==)

      • Not Equal (~=)

  • Input can be a vector/matrix

  • Real values

      • Greater than (>)

      • Greater than or equal (>=)

      • Less than (<)

      • Less than or equal (<=)

  • Equal (==)

Real Input Length >= 20 OR Complex Input Length > inf

  • Not Equal (~=)

Real Input Length > = 16 OR Complex Input Length > inf

  • Greater than (>)

  • Greater than or equal (>=)

Real Input Length > 16

  • Less than (<)

  • Less than or equal (<=)

Real Input Length > 16

  • Equal (==) - Real - mw_q6_cmp_eq_af

    Complex - mw_q6_cmp_eq_acf

  • Not Equal (~=) - Real -mw_q6_cmp_neq_af

    Complex - mw_q6_cmp_neq_acf

  • Greater than (>) - mw_q6_cmp_gt_af

  • Greater than or equal (>=) - mw_q6_cmp_ge_af

  • Less than (<) - mw_q6_cmp_lt_af

  • Less than or equal (<=) - mw_q6_cmp_le_af

7 Shift
  • Shift value via input port. Input can be a vector/matrix (int32/uint32)

  • Real value

    • Shift left (<<)

    • Shift right arithmetic (>>)

  • Shift value via dialog. Input can be a vector/matrix (int32/uint32)

  • Real value

    • Shift left (<<)

    • Shift right arithmetic (>>)

    • Shift right logical (.>>)

  • Real Input Length > 26

  • Shift left (<<) - mw_q6_asl_aw/mw_q6_lsl_aw

  • Shift right arithmetic (>>) - mw_q6_asr_aw

  • Shift right logical (.>>) - mw_q6_lsr_aw

8dot
  • Input can be a vector/matrix

  • Real values

  • Real Input Length > =100

  • For vector, and matrix real inputs - qhblas_f_vector_dot_af

  • For vector, and matrix complex inputs - qhblas_cf_vector_dot_acf

See Also

| | | | |

Related Topics