This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/81709] __attribute__((interrupt)) should handle SSE registers


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]