https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110899

--- Comment #8 from Florian Weimer <fw at gcc dot gnu.org> ---
(In reply to Michael Matz from comment #7)
> > > Does the clang implementation take into account the various problematic
> > > cases that arise when calling a normal function from a (say) preserve_all
> > > function
> > > (hint: such call can't usually be done)?
> > 
> > How so? We need to version the __preserve_most__ attribute with the ISA
> > level, of course.
> 
> I don't see how that helps.  Imagine a preserve_all function foo that calls
> printf.  How do you propose that 'foo' saves all parts of the SSE registers,
> even those that aren't invented yet, or those that can't be touched by the
> current ISA?  (printf might clobber all of these)

Vector registers are out of scope for this.

But lets look at APX. If printf is recompiled to use APX, then it will clobber
the extended register file. If we define __preserve_most__ the way we do in my
psABI proposal (i.e., *not* as everything but %r11), the extended APX registers
are still caller-saved. We will have to introduce a __preserve_most_apx__
attribute and a different psABI specification that says that the new APX
registers are callee-saved, too.

(These details are the main reason why I want this in the psABI documentation.
This stuff is out there and will be used, so let's make sure that it's somewhat
reasonable.)

Reply via email to