From 7a27992cdcb330f305a9735abe6bfd914e93f064 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Thu, 3 Nov 2022 13:56:30 +0000 Subject: [PATCH] Apply -flax-vector-conversions flag to GCC (#65) Some CMSIS-DSP code does not explicitly convert between vectors of different numbers and types of elements. While some other compilers default to implicitly converting vectors, gcc does not do this unless explicitly enabled. Signed-off-by: Lingkai Dong Signed-off-by: Lingkai Dong --- Source/configDsp.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/configDsp.cmake b/Source/configDsp.cmake index e8284f55..1c047076 100644 --- a/Source/configDsp.cmake +++ b/Source/configDsp.cmake @@ -47,6 +47,12 @@ if (HELIUM OR MVEF OR SUPPORT) target_include_directories(${project} PRIVATE "${DSP}/PrivateInclude") endif() +if (MVEI OR MVEF OR HELIUM) + # By default, GCC does not enable implicit conversion between vectors of different numbers or types of elements + # which is required by some code in CMSIS-DSP + target_compile_options(${project} PRIVATE $<$:-flax-vector-conversions>) +endif() + if (DISABLEFLOAT16) target_compile_definitions(${project} PRIVATE DISABLEFLOAT16) endif()