On Mon, May 21, 2012 at 1:14 AM, Alan Modra <amo...@gmail.com> wrote:
> Currently, powerpc-linux gcc -Os -mno-multiple uses out-of-line gpr
> save and restore functions when saving/restoring just one gpr.  That's
> quite silly since the function call requires more instructions and is
> slower than an inline save/restore.  The only case where it might win
> is when no fprs are restored and the restore function can tear down
> the frame and exit (also loading up lr on ppc64).  I guess that's how
> GP_SAVE_INLINE came to be like it is, ie. it's optimised for the
> common case using ldm in the prologue and no fprs.  Still, it isn't
> difficult to choose the best combination in all cases, but it does
> mean different logic is needed for restores.  I could have implemented
> GP_RESTORE_INLINE and FP_RESORE_INLINE macros but it seemed simpler to
> just move everything into the one place the macros are invoked.  AIX
> and Darwin register cutoff doesn't change with this patch.
>
> This patch also enables out-of-line restores in cases that were
> previously disabled due to using inline saves.
>
> Bootstrapped and regression tested powerpc-linux.  OK to apply?
>
>        * aix.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
>        * darwin.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
>        * sysv4.h (FP_SAVE_INLINE, GP_SAVE_INLINE, V_SAVE_INLINE): Delete.
>        * config/rs6000/rs6000.c (V_SAVE_INLINE): Delete.
>        (rs6000_savres_strategy): Reimplement GP/FP/V_SAVE_INLINE logic.
>        For ELF targets, use out-of-line restores for -Os and any number
>        of regs if the restore exits, and out-of-line gp save for two or
>        more regs.  Use save_reg_p to test for holes in reg restore set.
>        Replace "#if" with "if".

Okay.

Thanks, David

Reply via email to