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.
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:
[x] I have tested my changes. ~No regression in existing tests.~ (stack consumption and timing will get worse)
[ ] I have modified and/or added unit-tests to cover the code changes in this Pull Request.
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.
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:
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.