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

--- Comment #17 from Christophe Lyon <clyon at gcc dot gnu.org> ---
(In reply to Richard Earnshaw from comment #10)
> (In reply to Christophe Lyon from comment #9)
> > > My initial thoughts are along the lines of...
> > > Only try to save FP registers that this function directly clobbers.
> > What's the point of saving these if a callee clobbers other registers?
> > 
> 
> They need to be done early enough to ensure that any code in *this* function
> does not clobber them.  Any additional registers would have to be saved by a
> library call that does that.

So if this function clobbers, say d16-d17, but calls another function, do you
mean we should
vpush d16-d17
then call the new lib function which saves all the FP context (thus saving
d16-d17 twice)?

> 
> > Shouldn't that be something like save-nothing vs save-all-FP-regs if there
> > is a callee?
> > 
> > Do you mean save direct clobbers only when the handler is a leaf function?
> 
> Well, obviously if it's a leaf function, saving only the registers that are
> clobbered is enough, and the compiler can do the analysis to ensure that.

I'm working on this, and just realized that this also means saving FPSR. It
seems there's no support for that yet in arm.md (unlike aarch64.md), am I
missing something?

> 
> > 
> > > Provide libgcc routines to save/restore the FP context.
> > Do you mean such routines should push all FP regs+status regs?
> 
> All registers that are are call clobbered.  There's no need to do the
> call-saved registers as the compiler can do that on an as-needed case
> already.

Reply via email to