-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add configUSE_TASK_FPU_SUPPORT to AARCH64 port #1048
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NEON SIMD is required by standard AARCH64 and its registers are frequently utilized by standard functions such as memcpy(). This means that even simple tasks that do not use any floating point arithmetics may still alter the contents of the FPU registers. For this reason it makes sense to add support for configUSE_TASK_FPU_SUPPORT to be able to enforce FPU register saving and restoring globally. The implementation was largely adopted from the ARM_CA9 port. However, the FPU registers must be placed on the stack before the critical nesting count to match the AARCH64 portASM.S.
n9wxu
previously approved these changes
May 7, 2024
chinglee-iot
previously approved these changes
May 7, 2024
aggarg
reviewed
May 7, 2024
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
|
aggarg
approved these changes
May 8, 2024
shubnil
approved these changes
May 8, 2024
@StefanBalt Thank you for your contribution. |
schilkp
pushed a commit
to schilkp/FreeRTOS-Kernel
that referenced
this pull request
May 17, 2024
* Add configUSE_TASK_FPU_SUPPORT to AARCH64 port NEON SIMD is required by standard AARCH64 and its registers are frequently utilized by standard functions such as memcpy(). This means that even simple tasks that do not use any floating point arithmetics may still alter the contents of the FPU registers. For this reason it makes sense to add support for configUSE_TASK_FPU_SUPPORT to be able to enforce FPU register saving and restoring globally. The implementation was largely adopted from the ARM_CA9 port. However, the FPU registers must be placed on the stack before the critical nesting count to match the AARCH64 portASM.S.
MinghuanLian
pushed a commit
to nxp-mcuxpresso/FreeRTOS-Kernel
that referenced
this pull request
Nov 28, 2024
This is a direct backport of upstream commit [1] for aarch64 (legacy operation port) done under [2] The same code can be applied on the aarch SRE port to be able to enable FPU context saving on all tasks context switch to mitigate GCC optimization to use SIMD registers for copy. [1] "55eceb22: Add configUSE_TASK_FPU_SUPPORT to AARCH64 port (FreeRTOS#1048)" [2] FreeRTOS#1048 Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
asellaminxp
pushed a commit
to nxp-mcuxpresso/FreeRTOS-Kernel
that referenced
this pull request
Nov 28, 2024
This is a direct backport of upstream commit [1] for aarch64 (legacy operation port) done under [2] The same code can be applied on the aarch SRE port to be able to enable FPU context saving on all tasks context switch to mitigate GCC optimization to use SIMD registers for copy. [1] "55eceb22: Add configUSE_TASK_FPU_SUPPORT to AARCH64 port (FreeRTOS#1048)" [2] FreeRTOS#1048 Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
asellaminxp
pushed a commit
to nxp-mcuxpresso/FreeRTOS-Kernel
that referenced
this pull request
Jan 22, 2025
This is a direct backport of upstream commit [1] for aarch64 (legacy operation port) done under [2] The same code can be applied on the aarch SRE port to be able to enable FPU context saving on all tasks context switch to mitigate GCC optimization to use SIMD registers for copy. [1] "55eceb22: Add configUSE_TASK_FPU_SUPPORT to AARCH64 port (FreeRTOS#1048)" [2] FreeRTOS#1048 Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
asellaminxp
pushed a commit
to nxp-mcuxpresso/FreeRTOS-Kernel
that referenced
this pull request
Jan 22, 2025
This is a direct backport of upstream commit [1] for aarch64 (legacy operation port) done under [2] The same code can be applied on the aarch SRE port to be able to enable FPU context saving on all tasks context switch to mitigate GCC optimization to use SIMD registers for copy. [1] "55eceb22: Add configUSE_TASK_FPU_SUPPORT to AARCH64 port (FreeRTOS#1048)" [2] FreeRTOS#1048 Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
2 tasks
archigup
pushed a commit
that referenced
this pull request
Jan 23, 2025
This is a direct backport of upstream commit [1] for aarch64 (legacy operation port) done under [2] The same code can be applied on the aarch SRE port to be able to enable FPU context saving on all tasks context switch to mitigate GCC optimization to use SIMD registers for copy. [1] "55eceb22: Add configUSE_TASK_FPU_SUPPORT to AARCH64 port (#1048)" [2] #1048 Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
NEON SIMD is required by standard AARCH64 and its registers are frequently utilized by standard functions such as memcpy(). This means that even simple tasks that do not use any floating point arithmetics may still alter the contents of the FPU registers.
For this reason it makes sense to add support for configUSE_TASK_FPU_SUPPORT to be able to enforce FPU register saving and restoring globally.
Without configUSE_TASK_FPU_SUPPORT it is not possible to enforce this for some library tasks.
This pull request partially fixes this issue:
https://forums.freertos.org/t/zynq-ultrascale-mpsoc-task-floating-point-corruption/9121
For a full fix
portASM.S
also needs to be adapted to save/restore all FPU registers at interrupt entry/exit.Maybe I will find time to contribute this in another pull request.
Checklist:
No regression in existing tests.(stack consumption and timing will get worse)Related Issue
My colleague did already something similar for the ARM Cortex R5 port: GH-584
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.