-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/cortexm-fpu: use it via a feature instead of DEFAULT_MODULE #13236
Conversation
ab5f989
to
58a483a
Compare
This feature is only available on Cortex M4F and M7 architectures
58a483a
to
986d393
Compare
@fjmolinas, if you have some time today, this PR is ready for review (since #13174 was merged!) |
@@ -3,6 +3,7 @@ include ../Makefile.tests_common | |||
USEMODULE += printf_float | |||
USEMODULE += xtimer | |||
|
|||
#DISABLE_MODULE += cortexm_fpu | |||
# Use CortexM FPU when available (only on M4F and M7 CPUs) | |||
FEATURES_OPTIONAL += cortexm_fpu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the FPU only gets used in this test (or when explicitly requested), otherwise software emulation is used.
What is the benefit of that?
If you have an FPU that should always be preffered over float-abi=soft
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll update the PR in that direction !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been trying and I realized that to be possible it would need #9913 to be fixed first.
This is because cortexm.inc.mk is included before processing the dependency resolution and this PR relies on this mechanism. Even if we would keep the FPU by default (using a default module), that would still be required (this is what I was thinking of and tried actually).
If you have an FPU that should always be preffered over float-abi=soft, no?
Yes probably.
I think I'll rework that PR and cut the CPU_ARCH/FAM move out of it.
@aabadie can you give me an update on the status here? |
closing in favor of #13738 |
Contribution description
This PR reworks how cortexm_fpu is managed: it applies the suggestion from @haukepetersen in #6630 (comment).
This allows to remove reference to DEFAULT_MODULE from a file that is included from a Makefile.include and not from a Makefile.dep but also to finely filter when the feature should be used or not.
To achieve this, I have to know which CPU_ARCH is used early (in Makefile.features): so the first commit of this PR is moving all CPU_ARCH/MODEL defined in Makefile.include to Makefile.features. I can provide this commit in a separate PR if requested by reviewers.
The other commits are just introducing and using the usual management of feature, and applying it to the new cortexm_fpu feature.
Testing procedure
patch:
Issues/PRs references
This PR is based on #13174 to be able to know the value of CPU_ARCH early and be able to determine if the cortexm_fpu feature is provided.