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 #5 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Anatol from comment #4)
> > you need to save the complete vector state
> 
> It is a good point. Would it make sense for compiler to do it? Instead of
> forcing users to track if SSE registers are used and doing xsave/xrstor
> manually?

To save and restore the complete vector state, you need to do

Check if CPU supports xsave/restore
if yes
  Query CPU for the complete vector state size
  Allocate space on stack for the complete vector state
  xsave
else
  Allocate space on stack for the fxsave area.
  fxsave
endif
...
if CPU supports xsave/restore
  xrstor
else
  fxrstor
endif

I don't believe compiler needs to do all that.

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