Просмотр исходного кода

CMSIS-DSP: Corrected build issues and code generation issues with gcc.

Christophe Favergeon 4 лет назад
Родитель
Сommit
81faafa024

+ 5 - 1
CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f32.c

@@ -48,7 +48,11 @@
   @return        none
  */
 
-#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)
+#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && defined(__CMSIS_GCC_H)
+#pragma GCC warning "Scalar version of arm_levinson_durbin_f32 built. Helium version has build issues with gcc."
+#endif 
+
+#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) &&  !defined(__CMSIS_GCC_H)
 
 #include "arm_helium_utils.h"
 

+ 6 - 1
CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_q31.c

@@ -107,7 +107,12 @@ __STATIC_FORCEINLINE q31_t divide(q31_t n, q31_t d)
   @param[in]     nbCoefs  number of autoregressive coefficients
   @return        none
  */
-#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE)
+
+#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && defined(__CMSIS_GCC_H)
+#pragma GCC warning "Scalar version of arm_levinson_durbin_q31 built. Helium version has build issues with gcc."
+#endif 
+
+#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) &&  !defined(__CMSIS_GCC_H)
 
 #define LANE23_MASK 0xFF00
 

+ 15 - 5
CMSIS/DSP/gcc.cmake

@@ -15,14 +15,17 @@ find_program(CMAKE_C_COMPILER NAMES arm-none-eabi-gcc arm-none-eabi-gcc.exe)
 find_program(CMAKE_CXX_COMPILER NAMES arm-none-eabi-g++ arm-none-eabi-g++.exe)
 find_program(CMAKE_ASM_COMPILER NAMES arm-none-eabi-gcc arm-none-eabi-gcc.exe)
 
+
+if (NOT ("${tools}" STREQUAL ""))
+message(STATUS "Tools path is set")
 SET(CMAKE_AR "${tools}/bin/ar")
 SET(CMAKE_CXX_COMPILER_AR "${tools}/bin/ar")
 SET(CMAKE_C_COMPILER_AR "${tools}/bin/ar")
-
-#find_program(CMAKE_AR NAMES arm-none-eabi-gcc-ar arm-none-eabi-gcc-ar.exe )
-#find_program(CMAKE_CXX_COMPILER_AR NAMES arm-none-eabi-gcc-ar arm-none-eabi-gcc-ar.exe )
-#find_program(CMAKE_C_COMPILER_AR NAMES arm-none-eabi-gcc-ar arm-none-eabi-gcc-ar.exe)
-
+else()
+find_program(CMAKE_AR NAMES arm-none-eabi-gcc-ar arm-none-eabi-gcc-ar.exe )
+find_program(CMAKE_CXX_COMPILER_AR NAMES arm-none-eabi-gcc-ar arm-none-eabi-gcc-ar.exe )
+find_program(CMAKE_C_COMPILER_AR NAMES arm-none-eabi-gcc-ar arm-none-eabi-gcc-ar.exe)
+endif()
 
 #SET(CMAKE_LINKER "${tools}/bin/arm-none-eabi-g++")
 find_program(CMAKE_LINKER NAMES arm-none-eabi-g++ arm-none-eabi-g++.exe)
@@ -48,10 +51,17 @@ if(NOT ARM_CPU)
 endif(NOT ARM_CPU)
 
 if (ARM_CPU STREQUAL "cortex-m55")
+# For gcc 10q4
 SET(CMAKE_C_FLAGS "-ffunction-sections -fdata-sections -march=armv8.1-m.main+mve.fp+fp.dp" CACHE INTERNAL "C compiler common flags")
 SET(CMAKE_CXX_FLAGS "-ffunction-sections -fdata-sections -march=armv8.1-m.main+mve.fp+fp.dp" CACHE INTERNAL "C compiler common flags")
 SET(CMAKE_ASM_FLAGS "-march=armv8.1-m.main+mve.fp+fp.dp" CACHE INTERNAL "ASM compiler common flags")
 SET(CMAKE_EXE_LINKER_FLAGS "-fno-use-linker-plugin -march=armv8.1-m.main+mve.fp+fp.dp"  CACHE INTERNAL "linker flags")
+elseif (ARM_CPU STREQUAL "cortex-m55+nomve.fp+nofp")
+# This case is not tested nor supported
+SET(CMAKE_C_FLAGS "-ffunction-sections -fdata-sections -march=armv8.1-m.main+dsp+fp.dp" CACHE INTERNAL "C compiler common flags")
+SET(CMAKE_CXX_FLAGS "-ffunction-sections -fdata-sections -march=armv8.1-m.main+dsp+fp.dp" CACHE INTERNAL "C compiler common flags")
+SET(CMAKE_ASM_FLAGS "-march=armv8.1-m.main+dsp+fp.dp" CACHE INTERNAL "ASM compiler common flags")
+SET(CMAKE_EXE_LINKER_FLAGS "-fno-use-linker-plugin -march=armv8.1-m.main+dsp+fp.dp"  CACHE INTERNAL "linker flags")
 else()
 SET(CMAKE_C_FLAGS "-ffunction-sections -fdata-sections -mcpu=${ARM_CPU}" CACHE INTERNAL "C compiler common flags")
 SET(CMAKE_CXX_FLAGS "-ffunction-sections -fdata-sections -mcpu=${ARM_CPU}" CACHE INTERNAL "C compiler common flags")

+ 2 - 0
CMSIS/DoxyGen/DSP/src/history.txt

@@ -47,6 +47,8 @@
       GCC issues:
       - Scalar version of arm_mat_cmplx_mult_f16.c built with Helium target
       - Scalar version of arm_biquad_cascade_stereo_df2T_f16.c built with Helium target.
+      - Scalar version of arm_levinson_durbin_f32 built with Helium target
+      - Scalar version of arm_levinson_durbin_q31 built with Helium target
 
       Important:
       - Initialization of FIRs has changed for the Helium version. Read the