主要内容

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

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

For more information on the 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.

  • When the ARM Cortex-A CMSIS CRL does not provide code replacements because the input vector length is below the threshold, you can enable CMSIS function generation for all input lengths. To enable this option, set the environment variable DISABLE_ARMCORTEXA_CMSIS_CRL_THRESHOLDS to true using the following command:

    setenv('DISABLE_ARMCORTEXA_CMSIS_CRL_THRESHOLDS','true')

    To generate optimized code, thresholds are introduced . Forcing CMSIS function generation for all input lengths using this command can degrade performance.

Basic Math Operations

OperationWrappers Calling CMSIS FunctionSupported Data TypesInput/Output SpecificationsReplaced MATLAB® Function or Operator
Element-wise 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 the same word length and data type.

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

Element-wise 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 data type and word length.

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

minus
Element-wise 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 the same word length.

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

  • For fixed-point inputs, both 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 is 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 the 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 is 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

OperationWrappers Calling CMSIS FunctionSupported Data TypesInput/Output SpecificationsReplaced MATLAB Function or Operator
Matrix multiplication
  • mw_arm_mat_mult_f64

  • mw_arm_mat_mult_f32

  • double

  • single

  • Matrix

  • Real inputs

mtimes
Complex matrix multiplication
  • mw_arm_cmplx_mat_mult_f32

  • single

  • Matrix

  • Complex inputs

mtimes
Matrix transpose
  • mw_arm_mat_trans_f64

  • mw_arm_mat_trans_f32

  • mw_arm_mat_trans_q31

  • mw_arm_mat_trans_q15

  • mw_arm_mat_trans_q7

  • double

  • single

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Matrix

  • Real inputs

transpose
Complex matrix transpose
  • mw_arm_mat_cmplx_trans_f32

  • mw_arm_mat_cmplx_trans_q31

  • mw_arm_mat_cmplx_trans_q15

  • single

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • Matrix

  • Complex inputs

ctranspose
Matrix-by-vector multiplicationneon_mv_mul_u8x16uint8
  • Vector and matrix

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

  • Number of rows in 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 in first input must be a multiple of 8 to get code replacement.

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

neon_mv_mul_u32x4uint32
  • Vector and matrix

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

  • Number of rows in 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 in first and second input must be a multiple of 8 to get code replacement.

neon_mm_mul_u32x4uint32
  • Matrix

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

See Also