This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81709] __attribute__((interrupt)) should handle SSE registers
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Aug 2017 03:59:09 +0000
- Subject: [Bug target/81709] __attribute__((interrupt)) should handle SSE registers
- Auto-submitted: auto-generated
- References: <bug-81709-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81709
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Anatol from comment #2)
> Theoretically it is possible to do things like this manually. Track
> functions x86 extensions usage and save registers accordingly. But I would
> love to see a more automated and less error-prone way to do it. Similar to
> what CLANG compiler already does. CLANG tracks registers use and reduces a
> lot of burden for me.
>
> That is the reason why we switched to CLANG in our project for now but I
> would love to see GCC first-class support as well.
>
> What is the reason that GCC does not track SSE register usage? Is it a GGC
> architecture restriction or something else?
To use SSE registers in interrupt handler, you need to save the complete
vector state, %xmm0-%xmm15 isn't sufficient. You need to preserve the
whole set of vector registers plus MXCSR register. One way to do it is
to use xsave/xrstor.