-
Notifications
You must be signed in to change notification settings - Fork 349
Description
Is your feature request related to a problem? Please describe.
Currently, each module's version select are done based on predefined macro in ( core-isa.h), which is not able to be configurable.
code list below, take volume as example:
#if defined(__XCC__)
# include <xtensa/config/core-isa.h>
# if XCHAL_HAVE_HIFI4
# define VOLUME_HIFI4
# elif XCHAL_HAVE_HIFI3
# define VOLUME_HIFI3
# else
# define VOLUME_GENERIC
# endif
#else
# define VOLUME_GENERIC
#endif
Describe the solution you'd like
Prefer use Kconfig to provide a choice for developer, then module version can be changed in a unified way.
Describe alternatives you've considered
There are multiple ways to resolve this request:
-
add -C=-DCONFIG_VOLUME_HIFI3=y or similar to build cmd line to provide switch for volume hifi3/hifi4/generic.
pros: nothing need change.
cons: if want to switch with multiple modules, cmd line would be much longer and not easy to know which are take effect and which not. -
current implement in PR: Volume: Add volume SIMD build option #8682
pros: it achieved configurable and remove select code in header file(listed above).
cons: add a new build env and need align with test bench build.
personally, I still think this is the good way, it removed #if in each module header, and configurable for module also done. -
provide choice make generic as default and set HIFI version in each platform Kconfig
pros: implementation is simple.
cons:
1. As kai mentioned, there are cloud build for mtl, and no xtensa tool chain, which will cause build error.
2. need address each platform to add correct HIFI version kconfig. -
provide choice and make a DUMMY(name can be discussed, just use it as default choice), keep current header selection.
pros: this is a very simple implementation, without any break and can achieve module customization.
cons: still need header above code support to get the real default HIFI version, this is a mediate solution.
Please address your comments here and we need finalize which solution is best for now.