Main Content

Supported MATLAB Functions with CMSIS Library for ARM Cortex-A Processors

The Embedded Coder® Support Package for ARM® Cortex®-A Processors provides a code replacement library (CRL) ARM Cortex-A CMSIS to generate calls to CMSIS-DSP library optimized for ARM Cortex-A processors.

For more information on CMSIS-DSP library, see https://github.com/ARM-software/CMSIS-DSP.

Note

  • ARM Cortex-A CMSIS CRL supports both 32 bit and 64 bit ARM Cortex-A architectures.

  • Only 64 bit ARM Cortex-A architectures support the half data type.

  • If you encounter situations where the ARM Cortex-A CMSIS CRL does not provide code replacements due to the input vector length being below the threshold, you can enable CMSIS function generation for all input lengths. To do this, set the environment variable DISABLE_ARMCORTEXA_CMSIS_CRL_THRESHOLDS to true using the following command:

    setenv('DISABLE_ARMCORTEXA_CMSIS_CRL_THRESHOLDS',true)

Basic Math Operations

OperationWrappers calling CMSIS FunctionSupported data typesInput/Output specificationsReplaced MATLAB® function or operator
Elementwise real addition
  • mw_arm_add_f64

  • mw_arm_add_f32

  • mw_arm_add_f16

  • mw_arm_add_q31

  • mw_arm_add_q15

  • mw_arm_add_q7

  • double

  • single

  • half

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

  • Matrix

  • Both input and output must have same word length and datatype.

plus
Real vector offset
  • mw_arm_offset_f64

  • mw_arm_offset_f32

  • mw_arm_offset_f16

  • mw_arm_offset_q31

  • mw_arm_offset_q15

  • mw_arm_offset_q7

Elementwise real subtraction
  • mw_arm_sub_f64

  • mw_arm_sub_f32

  • mw_arm_sub_f16

  • mw_arm_sub_q31

  • mw_arm_sub_q15

  • mw_arm_sub_q7

  • double

  • single

  • half

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

  • Matrix

  • Both inputs must be of the same datatype and word length.

  • Both input and output must have same word length.

minus
Elementwise real multiplication
  • mw_arm_mult_f64

  • mw_arm_mult_f32

  • mw_arm_mult_f16

  • mw_arm_mult_q31

  • mw_arm_mult_q15

  • mw_arm_mult_q7

  • double

  • single

  • half

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

  • Matrix

  • Both input and output must be of same word length.

  • Ensure that inputs with floating-point data types, such as double, single, or half, are of the same type.

  • For fixed point inputs, both the inputs must be of equal word length.

Fixed point real element-wise multiplication:

  • For inputs of type, fixdt(true,32,L1) and fixdt(true,32,L2), the output will be of type fixdt(true,32,L1+L2-31)

  • For inputs of type, fixdt(true,16,L1) and fixdt(true,16,L2), the output can be of type fixdt(true,16,L1+L2-15).

  • For inputs of type, fixdt(true,8,L1) and fixdt(true,8,L2), the output can be of type fixdt(true,8,L1+L2-7).

Real vector scale
  • mw_arm_scale_f64

  • mw_arm_scale_f32

  • mw_arm_scale_f16

  • mw_arm_scale_q31

  • mw_arm_scale_q15

  • mw_arm_scale_q7

mpy (Fixed-Point Designer)
Real absolute
  • mw_arm_abs_f64

  • mw_arm_abs_f32

  • mw_arm_abs_f16

  • mw_arm_abs_q31

  • mw_arm_abs_q15

  • mw_arm_abs_q7

  • double

  • single

  • half

  • fixdt(true,32,31)

  • fixdt(true,16,15)

  • fixdt(true,8,7)

  • Vector

  • Matrix

  • Both input and output must have same word length.

abs
Real dot product
  • mw_arm_dot_prod_f64

  • mw_arm_dot_prod_f32

  • mw_arm_dot_prod_q31

  • mw_arm_dot_prod_q15

  • mw_arm_dot_prod_q7

  • double

  • single

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

Fixed point real dot product:

  • For inputs of type, fixdt(true,32,L1) and fixdt(true,32,L2), the output will be of type fixdt(true,64,L1+L2-14)

  • For inputs of type, fixdt(true,16,L1) and fixdt(true,16,L2), the output can be of type fixdt(true,64,L1+L2), fixdt(true,32,L1+L2-6), or fixdt(true,16,L1+L2-18).

dot
Vector log real
  • mw_arm_vlog_f64

  • mw_arm_vlog_f32

  • double

  • single

  • Scalar

  • Vector

  • Matrix

log
Vector exponential real
  • mw_arm_vexp_f64

  • mw_arm_vexp_f32

  • mw_arm_vexp_f16

  • double

  • single

  • half

  • Scalar

  • Vector

  • Matrix

exp

Complex Math Operations

OperationWrappers calling CMSIS FunctionSupported data typesInput/Output specificationsReplaced MATLAB function or operator
Complex dot product
  • mw_arm_cmplx_dot_prod_f32

  • single

  • Vector

  • Complex inputs

dot
Complex-by-complex multiplication
  • mw_arm_cmplx_mult_cmplx_f64

  • mw_arm_cmplx_mult_cmplx_f32

  • double

  • single

  • Vector and matrix

  • Both inputs must be complex

mtimes
Complex-by-real multiplication
  • mw_arm_cmplx_mult_real_f32

  • mw_arm_real_mult_cmplx_f32

  • single

  • Vector and matrix

  • Real and complex inputs

  • One input must be real and the other input must be complex

mtimes

Matrix Operations

OperationFunction nameSupported data typesInput/Output specificationsReplaced MATLAB function or operator
Matrix-by-vector multiplicationneon_mv_mul_u8x16uint8
  • Vector and matrix

  • Number of rows and columns of first input must be a multiple of 16 to get code replacement.

  • Number of rows of second input must be a multiple of 16 to get code replacement.

mtimes
neon_mv_mul_u16x8uint16
  • Vector and matrix

  • Number of rows and columns of first input must be a multiple of 8 to get code replacement.

  • Number of rows of second input must be a multiple of 8 to get code replacement.

neon_mv_mul_u32x4uint32
  • Vector and matrix

  • Number of rows and columns of first input must be a multiple of 4 to get code replacement.

  • Number of rows of second input must be a multiple of 4 to get code replacement.

Matrix-by-matrix multiplicationneon_mm_mul_u16x8uint16
  • Matrix

  • Number of rows and columns of first and second input must be a multiple of 8 to get code replacement.

neon_mm_mul_u32x4uint32
  • Matrix

  • Number of rows and columns of first and second input must be a multiple of 4 to get code replacement.