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

Math: Cleanup FIR and IIR build type select #8108

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

singalsu
Copy link
Collaborator

The normally undefined SOF_FIR_FORCEARCH or SOF_IIR_DF2T_FORCEARCH can be defined at command line to force the build of other code optimized version for any compiler. The usage is only for debugging, e.g. build generic FIR version with xcc.

@singalsu singalsu requested a review from marc-hb August 28, 2023 15:07
src/include/sof/math/fir_config.h Outdated Show resolved Hide resolved
src/include/sof/math/iir_df2t.h Outdated Show resolved Hide resolved
src/include/sof/math/fir_config.h Outdated Show resolved Hide resolved
Comment on lines 33 to 39
#define FIR_GENERIC 0
#define FIR_HIFIEP 1
#define FIR_HIFI3 0
#else
#define FIR_GENERIC 1
#define FIR_HIFIEP 0
#define FIR_HIFI3 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@singalsu @andrula-song can we make all these Kconfig options for v2.8. Thanks !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do it. This wasn't intended for kconfig, no need to add complexity there for a simple developer aid to compare optimized versions, or develop generic version code within Xplorer. I did this as example for #7033, where a similar case is discussed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont mean a system wide HIFI level, but a per module Kconfig menu where we can set generic | hifi2 | hifi3 | avx etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, avx with gcc changes things, so we will have quite many options. Need to think a way.

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup.

Do you really need a different macro for each file?

PS: still draft?

@singalsu singalsu force-pushed the math_iir_cleanup_arch_force branch from 72a3bd6 to 92f83a3 Compare August 30, 2023 09:16
@singalsu singalsu marked this pull request as ready for review August 30, 2023 12:54
#elif XCHAL_HAVE_HIFI3 == 1 || XCHAL_HAVE_HIFI4 == 1
#define FIR_HIFI3 1
#define FIR_HIFIEP 0
#ifdef SOFM_FIR_FORCEARCH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where and how to define SOFM_FIR_FORCEARCH and SOF_IIR_DF2T_FORCEARCH? feel this patch make code more complex than before change, not sure whether we can have a more straightforward code clean.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where and how to define SOFM_FIR_FORCEARCH and SOF_IIR_DF2T_FORCEARCH?

The answer is literally in the first line of the patch.

feel this patch make code more complex than before change,

That's a bold statement considering you didn't read the first line.

@lgirdwood
Copy link
Member

SOFCI TEST

The normally undefined SOF_FIR_FORCEARCH or SOF_IIR_DF2T_FORCEARCH
can be defined at command line to force the build of other code
optimized version for any compiler. The usage is only for
debugging, e.g. build generic FIR version with xcc.

Signed-off-by: Seppo Ingalsuo <[email protected]>
The HiFi3 code is faster and compatible so it should be used
instead of generic version for HiFi4.

Signed-off-by: Seppo Ingalsuo <[email protected]>
@singalsu singalsu force-pushed the math_iir_cleanup_arch_force branch from 92f83a3 to 6d70765 Compare September 1, 2023 15:06
@singalsu singalsu requested a review from kv2019i as a code owner September 1, 2023 15:06
@lgirdwood lgirdwood merged commit d964b7b into thesofproject:main Sep 1, 2023
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants