arch/arm/stm32h7: Add lazy FPU for STM32H7 ARMV7 single core chips #15876
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Introduces LAZYFPU by enabling LSPEN and ASPEN for lazy stacking and automatic state preservation. FPU registers are no longer stored in XCPT registers (HW and SW) if LAZY FPU is enabled.
Discussed in #15826
Impact
This reduces context switching overhead in some contexts where the FPU is used. This feature is implemented for all ARMv7-M chips, however I have only added
select ARCH_HAVE_LAZYFPU
for the STM32H7 chips that are single ARMv7-M cores as I do not have an exhaustive list of all ARMv7-M chips to test on.Testing
Performed on an STM32H743 chip. I have increased the number of FPU loops to 25 and reduced the FPU thread stack size to 2048.
Here is the results of
ostest
when LAZYFPU is disabled:Here is the results of
ostest
when LAZYFPU is enabled:tbd, currently crashes