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: Mon, 21 Aug 2017 20:05:34 +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 #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.