Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio: SRC: Optimize HiFi4 and HiFi5 version code #9825

Merged
merged 4 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/audio/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause

add_local_sources(sof src_generic.c src_hifi2ep.c src_hifi3.c src_hifi4.c src_common.c src.c)
add_local_sources(sof src_generic.c src_hifi2ep.c src_hifi3.c src_hifi4.c src_hifi5.c src_common.c src.c)

if(CONFIG_IPC_MAJOR_3)
add_local_sources(sof src_ipc3.c)
Expand Down
61 changes: 15 additions & 46 deletions src/audio/src/src_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,24 @@
#ifndef __SOF_AUDIO_SRC_SRC_CONFIG_H__
#define __SOF_AUDIO_SRC_SRC_CONFIG_H__



/* If next define is set to 1 the SRC is configured automatically. Setting
* to zero temporarily is useful is for testing needs.
*/
#define SRC_AUTOARCH 1

/* Force manually some code variant when SRC_AUTODSP is set to zero. These
* are useful in code debugging.
*/
#if SRC_AUTOARCH == 0
#define SRC_GENERIC 1
#define SRC_HIFIEP 0
#define SRC_HIFI3 0
#endif

/* Select optimized code variant when xt-xcc compiler is used */
#if SRC_AUTOARCH == 1
#if defined __XCC__
#include <xtensa/config/core-isa.h>
#define SRC_GENERIC 0
#if XCHAL_HAVE_HIFI4 == 1
#define SRC_HIFI4 1
#define SRC_HIFI3 0
#define SRC_HIFIEP 0
#include <sof/common.h>

/* Follow kconfig for FILTER in SRC component */
#if SOF_USE_MIN_HIFI(5, FILTER)
#define SRC_HIFI5 1
#elif SOF_USE_MIN_HIFI(4, FILTER)
#define SRC_HIFI4 1
#elif SOF_USE_MIN_HIFI(3, FILTER)
#define SRC_HIFI3 1
#elif SOF_USE_HIFI(2, FILTER)
#define SRC_HIFIEP 1
#else
#define SRC_HIFI4 0
#if XCHAL_HAVE_HIFI2EP == 1
#define SRC_HIFIEP 1
#define SRC_HIFI3 0
#endif
#if XCHAL_HAVE_HIFI3 == 1
#define SRC_HIFI3 1
#define SRC_HIFIEP 0
#endif
#endif
#else
/* GCC */
#define SRC_GENERIC 1
#define SRC_HIFIEP 0
#define SRC_HIFI3 0
#if CONFIG_LIBRARY
#else
#define SRC_SHORT 1 /* Need to use for generic code version speed */
#endif
#endif
#define SRC_GENERIC 1
#endif

/* Kconfig option tiny needs 16 bits coefficients, other options use 32 bits */
/* Kconfig option tiny needs 16 bits coefficients, other options use 32 bits,
* also gcc builds for all platforms and testbench (library)
*/
#if !defined(SRC_SHORT)
#if CONFIG_COMP_SRC_TINY
#define SRC_SHORT 1 /* 16 bit coefficients filter core */
Expand Down
Loading
Loading