diff --git a/src/audio/copier/Kconfig b/src/audio/copier/Kconfig index 05d788645..7c4c38a17 100644 --- a/src/audio/copier/Kconfig +++ b/src/audio/copier/Kconfig @@ -1,5 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause +rsource "Kconfig.simd" + config COMP_COPIER bool "COPIER component" default y diff --git a/src/audio/copier/Kconfig.simd b/src/audio/copier/Kconfig.simd new file mode 100644 index 000000000..d8639fcdb --- /dev/null +++ b/src/audio/copier/Kconfig.simd @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: BSD-3-Clause + +comment "COPIER optimization level select" + +choice "COPIER_SIMD_LEVEL_SELECT" + prompt "choose which SIMD level used for COPIER module" + depends on COMP_COPIER + default COPIER_HIFI_MAX + + config COPIER_HIFI_MAX + prompt "SIMD will selected by toolchain pre-defined header" + bool + help + When this was selected, optimization level will be determined + by toolchain pre-defined macros in core isa header file. + + config COPIER_HIFI_5 + prompt "choose HIFI5 intrinsic optimized COPIER module" + bool + help + This option used to build HIFI5 optimized COPIER code + + config COPIER_HIFI_4 + prompt "choose HIFI4 intrinsic optimized COPIER module" + bool + help + This option used to build HIFI4 optimized COPIER code + + config COPIER_HIFI_3 + prompt "choose HIFI3 intrinsic optimized COPIER module" + bool + help + This option used to build HIFI3 intrinsic optimized COPIER code + + config COPIER_HIFI_NONE + prompt "choose generic C COPIER module, no HIFI SIMD involved" + bool + help + This option used to build COPIER generic code. +endchoice diff --git a/src/audio/copier/copier.h b/src/audio/copier/copier.h index ab27d3faf..550219a2a 100644 --- a/src/audio/copier/copier.h +++ b/src/audio/copier/copier.h @@ -33,17 +33,6 @@ #include #include -#define COPIER_GENERIC - -#if defined(__XCC__) -#include - -#if XCHAL_HAVE_HIFI3 || XCHAL_HAVE_HIFI4 -#undef COPIER_GENERIC -#endif - -#endif - static const uint32_t INVALID_QUEUE_ID = 0xFFFFFFFF; /* copier Module Configuration & Interface diff --git a/src/audio/copier/copier_generic.c b/src/audio/copier/copier_generic.c index 37d89430d..b270e5546 100644 --- a/src/audio/copier/copier_generic.c +++ b/src/audio/copier/copier_generic.c @@ -7,16 +7,16 @@ #include #include #include "copier.h" +#include LOG_MODULE_DECLARE(copier, CONFIG_SOF_LOG_LEVEL); -#ifdef COPIER_GENERIC +#if SOF_USE_HIFI(NONE, COPIER) #include #include #include #include -#include #include #include #include diff --git a/src/audio/copier/copier_hifi.c b/src/audio/copier/copier_hifi.c index 8d05fe924..f428d1f90 100644 --- a/src/audio/copier/copier_hifi.c +++ b/src/audio/copier/copier_hifi.c @@ -4,15 +4,15 @@ // // Author: Andrula Song #include "copier.h" +#include -#if __XCC__ && (XCHAL_HAVE_HIFI3 || XCHAL_HAVE_HIFI4) +#if SOF_USE_HIFI(3, COPIER) || SOF_USE_HIFI(4, COPIER) || SOF_USE_HIFI(5, COPIER) #include #include #include #include #include -#include #include #include #include