Skip to content
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

fix(threads): xtensa: enable saving/restoring float regs #481

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaspar030
Copy link
Collaborator

@kaspar030 kaspar030 commented Oct 22, 2024

Description

... seems like something we want. esp-wifi also enables this.

Issues/PRs references

Open Questions

Change checklist

  • I have cleaned up my commit history and squashed fixup commits.
  • I have followed the Coding Conventions.
  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.

@elenaf9
Copy link
Collaborator

elenaf9 commented Oct 22, 2024

Does this impact context switching performance? Because now on each context switch the 15 float registers need to be saved/ restored as well.

@kaspar030
Copy link
Collaborator Author

Does this impact context switching performance? Because now on each context switch the 15 float registers need to be saved/ restored as well.

It probably does. But if we don't save them, they're potentially garbled after a context switch ...

@elenaf9
Copy link
Collaborator

elenaf9 commented Oct 22, 2024

But if we don't save them, they're potentially garbled after a context switch

esp-hal disables the floating point co-processor when the feature is disabled, and the relevant registers aren't present in the trapframe in that case. So they can't be used. I ran into a panic myself in the past due to that 😄
Once the feature is enabled, the registers are part of the trapframe, and we automatically save them because we always save and switch the whole trapframe.

So IMO users that need floating point operations can just enable it and it will work with our implementation (also thanks to 0e84775). No need for us to enable it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants