CMSIS-DSP: Added ARM_MATH_AUTOVECTORIZE and AUTOVECTORIZE to cmake
It is to provide more control and to disable
intrinsics version of some kernels when the C code is simple enough to
benefit from vectorization.
Since the result is compiler dependent, this option is optional.
(And it is not yet added to the source files).
Compilation flags may have to be tuned (-O3 for instance ...)
diff --git a/CMSIS/DSP/Source/configDsp.cmake b/CMSIS/DSP/Source/configDsp.cmake
index ccdf5cb..b472be0 100644
--- a/CMSIS/DSP/Source/configDsp.cmake
+++ b/CMSIS/DSP/Source/configDsp.cmake
@@ -18,8 +18,14 @@
target_compile_definitions(${project} PRIVATE ARM_MATH_MATRIX_CHECK)
endif()
+if (AUTOVECTORIZE)
+ target_compile_definitions(${project} PRIVATE ARM_MATH_AUTOVECTORIZE)
+endif()
+
if (NEON OR NEONEXPERIMENTAL)
target_include_directories(${project} PRIVATE "${root}/CMSIS/DSP/ComputeLibrary/Include")
endif()
+
+
endfunction()
\ No newline at end of file
diff --git a/CMSIS/DSP/Toolchain/AC6.cmake b/CMSIS/DSP/Toolchain/AC6.cmake
index 8604f0c..6cde1df 100644
--- a/CMSIS/DSP/Toolchain/AC6.cmake
+++ b/CMSIS/DSP/Toolchain/AC6.cmake
@@ -17,7 +17,7 @@
get_target_property(DISABLEOPTIM ${PROJECTNAME} DISABLEOPTIMIZATION)
if ((OPTIMIZED) AND (NOT DISABLEOPTIM))
#cmake_print_variables(DISABLEOPTIM)
- target_compile_options(${PROJECTNAME} PRIVATE "-O2")
+ target_compile_options(${PROJECTNAME} PRIVATE "-O3")
endif()
if (FASTMATHCOMPUTATIONS)
diff --git a/CMSIS/DSP/configLib.cmake b/CMSIS/DSP/configLib.cmake
index ab35b35..1b7abc0 100755
--- a/CMSIS/DSP/configLib.cmake
+++ b/CMSIS/DSP/configLib.cmake
@@ -5,6 +5,7 @@
include(Toolchain/Tools)
option(OPTIMIZED "Compile for speed" ON)
+option(AUTOVECTORIZE "Prefer autovectorizable code to one using C intrinsics" OFF)
enable_language(CXX C ASM)