Skip to content

Commit

Permalink
CMSIS-DSP: Added new compilation define for MVE.
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe0606 committed Mar 2, 2021
1 parent 7114cc6 commit 7450136
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CMSIS/DSP/Include/arm_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@
*
* - ARM_MATH_HELIUM:
*
* It implies the flags ARM_MATH_MVEF and ARM_MATH_MVEI and ARM_MATH_FLOAT16.
* It implies the flags ARM_MATH_MVEF and ARM_MATH_MVEI and ARM_MATH_MVE_FLOAT16.
*
* - ARM_MATH_HELIUM_EXPERIMENTAL:
*
* Only taken into account when ARM_MATH_MVEF, ARM_MATH_MVEI or ARM_MATH_MVE_FLOAT16 are defined.
* Enable some vector versions which may have worse performance than scalar
* depending on the core / compiler configuration.
*
* - ARM_MATH_MVEF:
*
Expand Down
1 change: 1 addition & 0 deletions CMSIS/DSP/Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include(configLib)

option(NEON "Neon acceleration" OFF)
option(NEONEXPERIMENTAL "Neon experimental acceleration" OFF)
option(HELIUMEXPERIMENTAL "Helium experimental acceleration" OFF)
option(LOOPUNROLL "Loop unrolling" ON)
option(ROUNDING "Rounding" OFF)
option(MATRIXCHECK "Matrix Checks" OFF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@return none
*/

#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE)
#if (defined(ARM_MATH_MVE_FLOAT16) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE)
void arm_biquad_cascade_df2T_f16(
const arm_biquad_cascade_df2T_instance_f16 * S,
const float16_t * pSrc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@param[in] blockSize number of samples to process
@return none
*/
#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)
#if (defined(ARM_MATH_MVEF) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE)
#include "arm_helium_utils.h"

void arm_biquad_cascade_df2T_f32(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#pragma GCC warning "Scalar version of arm_biquad_cascade_stereo_df2T_f16 built. Helium version has build issues with gcc."
#endif

#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H)
#if (defined(ARM_MATH_MVE_FLOAT16) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H)
void arm_biquad_cascade_stereo_df2T_f16(
const arm_biquad_cascade_stereo_df2T_instance_f16 * S,
const float16_t * pSrc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@param[in] blockSize number of samples to process
@return none
*/
#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)
#if (defined(ARM_MATH_MVEF) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE)
#include "arm_helium_utils.h"

void arm_biquad_cascade_stereo_df2T_f32(
Expand Down
7 changes: 7 additions & 0 deletions CMSIS/DSP/cmsisdspconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
config["MVEF"]=False
config["NEON"]=False
config["HELIUM"]=False
config["HELIUMEXPERIMENTAL"]=False
config["Float16"]=True
config["HOST"]=False

Expand Down Expand Up @@ -365,6 +366,9 @@ def interpretCmakeOptions(cmake):
if test(cmake,"MVEF"):
r.append("-DARM_MATH_MVEF")

if test(cmake,"HELIUMEXPERIMENTAL"):
r.append("-DARM_MATH_HELIUM_EXPERIMENTAL")

if test(cmake,"HELIUM") or test(cmake,"MVEF") or test(cmake,"MVEI"):
r.append("-IPrivateInclude")

Expand Down Expand Up @@ -508,13 +512,16 @@ def configCMake(config):
check(config,"ROUNDING")
check(config,"MATRIXCHECK")

st.sidebar.header('Vector extensions')
st.sidebar.info("Enable vector code. It is not automatic for Neon. Use of Helium will enable new options to select some interpolation tables.")
archi=st.sidebar.selectbox("Vector",('None','Helium','Neon'))
if archi == 'Neon':
config["NEON"]=True
if archi == 'Helium':
multiselect(config,"MVE configuration",["MVEI","MVEF"])
HELIUM=True
st.sidebar.info("When checked some experimental versions will be enabled and may be less performant than scalar version depending on the architecture.")
check(config,"HELIUMEXPERIMENTAL")
if archi != 'None':
st.sidebar.info("When autovectorization is on, pure C code will be compiled. The version with C intrinsics won't be compiled.")
check(config,"AUTOVECTORIZE")
Expand Down
4 changes: 4 additions & 0 deletions CMSIS/DSP/configCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ function(configcore PROJECTNAME ROOT)
target_compile_definitions(${PROJECTNAME} PRIVATE ARM_MATH_NEON_EXPERIMENTAL)
endif()

if (HELIUMEXPERIMENTAL)
target_compile_definitions(${PROJECTNAME} PRIVATE ARM_MATH_HELIUM_EXPERIMENTAL)
endif()

if (HELIUM AND CORTEXM)
target_compile_definitions(${PROJECTNAME} PRIVATE ARM_MATH_HELIUM)
endif()
Expand Down

0 comments on commit 7450136

Please sign in to comment.