ASRC: add simd config for ASRC module

With simd config adding, user are able to choose simd
version for ASRC build.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
This commit is contained in:
Baofeng Tian 2024-02-19 15:14:18 +08:00 committed by Liam Girdwood
parent 0e29dc690d
commit 1cb8d8fb19
6 changed files with 50 additions and 48 deletions

View File

@ -16,6 +16,8 @@ config COMP_ASRC
if COMP_ASRC
rsource "Kconfig.simd"
choice
prompt "ASRC down sampling conversions set"
default COMP_ASRC_DOWNSAMPLING_FULL

View File

@ -0,0 +1,40 @@
# SPDX-License-Identifier: BSD-3-Clause
comment "ASRC optimization level select"
choice "ASRC_SIMD_LEVEL_SELECT"
prompt "choose which SIMD level used for ASRC module"
depends on COMP_ASRC
default ASRC_HIFI_MAX
config ASRC_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 ASRC_HIFI_5
prompt "choose HIFI5 intrinsic optimized ASRC module"
bool
help
This option used to build HIFI5 optimized ASRC code
config ASRC_HIFI_4
prompt "choose HIFI4 intrinsic optimized ASRC module"
bool
help
This option used to build HIFI4 optimized ASRC code
config ASRC_HIFI_3
prompt "choose HIFI3 intrinsic optimized ASRC module"
bool
help
This option used to build HIFI3 intrinsic optimized ASRC code
config ASRC_HIFI_NONE
prompt "choose generic C ASRC module, no HIFI SIMD involved"
bool
help
This option used to build ASRC generic code.
endchoice

View File

@ -1,39 +0,0 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2012 Intel Corporation. All rights reserved.
*/
#ifndef __SOF_AUDIO_ASRC_ASRC_CONFIG_H__
#define __SOF_AUDIO_ASRC_ASRC_CONFIG_H__
/* If next define is set to 1 the ASRC is configured automatically. Setting
* to zero temporarily is useful is for testing needs.
*/
#define ASRC_AUTOARCH 1
/* Select optimized code variant when xt-xcc compiler is used on HiFi3 */
#if ASRC_AUTOARCH == 1
#if defined __XCC__
/* For xt-xcc */
#include <xtensa/config/core-isa.h>
#if XCHAL_HAVE_HIFI3 == 1 || XCHAL_HAVE_HIFI4 == 1
/* Version for HiFi3 */
#define ASRC_HIFI3 1
#define ASRC_GENERIC 0
#else
/* Version for e.g. HiFi2EP */
#define ASRC_HIFI3 0
#define ASRC_GENERIC 1
#endif
#else
/* For GCC */
#define ASRC_GENERIC 1
#define ASRC_HIFI3 0
#endif /* XCC */
#else
/* Applied when ASRC_AUTOARCH is set to zero */
#define ASRC_GENERIC 1 /* Enable generic */
#define ASRC_HIFI3 0 /* Disable HiFi3 */
#endif /* Autoarch */
#endif /* __SOF_AUDIO_ASRC_ASRC_CONFIG_H__ */

View File

@ -12,7 +12,6 @@
#include <sof/trace/trace.h>
#include <sof/audio/format.h>
#include <user/trace.h>
#include "asrc_config.h"
#include "asrc_farrow.h"
LOG_MODULE_DECLARE(asrc, CONFIG_SOF_LOG_LEVEL);

View File

@ -2,9 +2,9 @@
//
// Copyright(c) 2012-2019 Intel Corporation. All rights reserved.
#include "asrc_config.h"
#include <sof/common.h>
#if ASRC_GENERIC == 1
#if SOF_USE_HIFI(NONE, ASRC)
#include "asrc_farrow.h"
#include <sof/audio/format.h>
@ -360,4 +360,4 @@ void asrc_calc_impulse_response_n7(struct asrc_farrow *src_obj)
}
}
#endif /* ASRC_GENERIC */
#endif /* ASRC_HIFI_NONE */

View File

@ -2,11 +2,11 @@
//
// Copyright(c) 2012-2019 Intel Corporation. All rights reserved.
#include "asrc_config.h"
#include <sof/common.h>
#if SOF_USE_HIFI(3, ASRC) || SOF_USE_HIFI(4, ASRC) || SOF_USE_HIFI(5, ASRC)
#include "asrc_farrow.h"
#if ASRC_HIFI3 == 1
#include <xtensa/tie/xt_hifi3.h>
LOG_MODULE_DECLARE(asrc, CONFIG_SOF_LOG_LEVEL);
@ -401,4 +401,4 @@ void asrc_calc_impulse_response_n7(struct asrc_farrow *src_obj)
AE_SA64POS_FP(align_out, result_P);
}
#endif /* ASRC Hifi3 */
#endif /* ASRC_HIFI_3 */