Skip to content

ARM: Cortex-M: enhance non-sharing floating point services #15115

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

Closed
ioannisg opened this issue Apr 2, 2019 · 1 comment
Closed

ARM: Cortex-M: enhance non-sharing floating point services #15115

ioannisg opened this issue Apr 2, 2019 · 1 comment
Assignees
Labels
area: ARM ARM (32-bit) Architecture Enhancement Changes/Updates/Additions to existing features
Milestone

Comments

@ioannisg
Copy link
Member

ioannisg commented Apr 2, 2019

The Zephyr Kernel specification claims that under the Unshared FP registers' mode, only a single context (a thread, not an ISR) is allowed to use the FP registers, otherwise the behavior is undefined.

This allows us to implement the following enhancements that will increase system performance:

  • We remove the requirement for Stacking the FP-context during Exception Entry and/or context-switch. We don't really need to do this, since the ISRs won't touch the FP registers, and the next switched-in thread won't do it, either. This will improve both interrupt latency, when building with CONFIG_FLOAT=y, and required stack size for threads that use the FP

  • We remove the activation of FP-context during boot. This is not needed, as the single thread that will use the FP-context, can, simply initialize it. We update the documentation to match this change.

  • We add the initialization of FPSCR and the FP registers during boot. This is fine, since only a single entity will use the FP-context.

  • We also remove the FP-context from the ESF and _preempt_float structures, since we won't be stacking these registers, anyway. This saves us some memory from the thread structures.

  • Finally, we configure the FPCCR according to the setup with respect to CONFIG_USERSPACE.

@ioannisg ioannisg added the Enhancement Changes/Updates/Additions to existing features label Apr 2, 2019
@ioannisg ioannisg added this to the v1.15.0 milestone Apr 2, 2019
@ioannisg ioannisg added the area: ARM ARM (32-bit) Architecture label Apr 2, 2019
@ioannisg ioannisg self-assigned this Apr 3, 2019
@ioannisg ioannisg added the In progress For PRs: is work in progress and should not be merged yet. For issues: Is being worked on label Apr 4, 2019
@ioannisg ioannisg removed the In progress For PRs: is work in progress and should not be merged yet. For issues: Is being worked on label Apr 12, 2019
@ioannisg
Copy link
Member Author

ioannisg commented May 3, 2019

Addressed by #15258

@ioannisg ioannisg closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

1 participant