Skip to content

Conversation

@marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Jan 12, 2024

The if XCHAL_HAVE_HIFI4 macro logic is duplicated across many source files. Starting with dcblock.h, make it generic and move it to Kconfig

This adds the ability to override the max available HIFI level using Kconfig

EDIT: this is what was (I think) requested in alternative #8720 (comment)

The `if XCHAL_HAVE_HIFI4` macro logic is duplicated across many source
files. Starting with dcblock.h, make it generic and move it to Kconfig

This adds the ability to override the max available HIFI level using
Kconfig

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Jan 12, 2024

To actually build with HiFi, this depends on

WARNING: non-Zephyr platforms will require an XTOS equivalent of Zephyr's67513 in the SOF repo. Otherwise they will... silently disable HiFi? This is one problem with this approach: I CANNOT test XTOS because I only have Intel toolchains and there is no Intel XTOS in this branch anymore. Someone outside Intel will have to implement and test the XTOS part of this. @andyross ?


# The first valid one seems to be the default.
# If not reliably, this can also be achieved with 3
# explicit `default` lines above.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

More specifically:

     default DCBLOCK_GENERIC if !XTENSA_TOOLCHAIN_HAS_HIFI
     default DCBLOCK_HIFI4 if XTENSA_ARCH_HAS_HIFI4
     default DCBLOCK_HIFI3 if XTENSA_ARCH_HAS_HIFI3

Also tested.

Unlike the order of the values themselves, "first valid default wins" is documented and guaranteed.

Copy link
Member

Choose a reason for hiding this comment

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

ok, so does XTENSA_ARCH_HAS_HIFI3 etc come from Zephyr Kconfig ? I guess some of this is still WIP on the Zephyr side.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, so does XTENSA_ARCH_HAS_HIFI3 etc come from Zephyr Kconfig ? I guess some of this is still WIP on the Zephyr side.

Yes, as mentioned above it's zephyrproject-rtos/zephyr#67513. It didn't draw huge crowds but the little feedback has been positive so far.

The main problem is: how to duplicate 67513 in XTOS and test it? XTOS was removed from the main branch for Intel. Maybe I can try to use a Cadence/Intel toolchain for compile-testing some non-Intel platform? Either way this will duplicate a lot of macros which are already duplicating core-isa.h. Much smaller alternative #8720 keeps relying on core-isa.h which means it has none of these problems.

Copy link
Contributor

@btian1 btian1 Jan 19, 2024

Choose a reason for hiding this comment

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

yes, IPC3 is one problem, another problem is non-zephyr build, then all will use generic version.
ever or never consider BUILD_ENV? I don't have a perfect solution for now, each method seems have shortcomings.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Jan 26, 2024

Alternative #8787 has been merged.

@marc-hb marc-hb closed this Jan 26, 2024
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.

3 participants