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 <lingkai.dong@arm.com>

Signed-off-by: Lingkai Dong <lingkai.dong@arm.com>
pull/75/head
Lingkai Dong 3 years ago committed by GitHub
parent 25c3fa3c02
commit 7a27992cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 $<$<STREQUAL:${CMAKE_C_COMPILER_ID},GNU>:-flax-vector-conversions>)
endif()
if (DISABLEFLOAT16)
target_compile_definitions(${project} PRIVATE DISABLEFLOAT16)
endif()

Loading…
Cancel
Save