On Tue, Apr 17, 2012 at 11:13 AM, Alan Modra <amo...@gmail.com> wrote:
> This continues the prologue and epilogue cleanup.  Not many user
> visible changes here, except for:
> - a bugfix to the LR save RTL emitted by rs6000_emit_savres_rtx which
>  may affect SPE,
> - a bugfix for SPE code emitted when using a static chain,
> - vector saves will be done using r1 for large frames just over 32k in
>  size, and,
> - using r11 as a frame pointer whenever we need to set up r11 for
>  out-of-line saves, and merging two pointer reg setup insns.
> The latter is a necessary prerequisite to enabling out-of-line
> save/restore for large frames, as I do in a later patch.  Currently
> this will only affect abiv4 -Os when using out-of-line saves.
>
> eg. -m32 -Os -mno-multiple
> int f (double x)
> {
>  char a[33];
>  __asm __volatile ("#%0" : "=m" (a) : : "fr31", "r27", "r28");
>  return (int) x;
> }
>        old                     new
>        stwu 1,-96(1)           mflr 0
>        mflr 0                  addi 11,1,-8
>        addi 11,1,88            stwu 1,-96(1)
>        stw 0,100(1)            stw 0,12(11)
>        stfd 31,88(1)           bl _savegpr_27
>        bl _savegpr_27          stfd 31,0(11)
>
>
>        * config/rs6000/rs6000.c (rs6000_emit_stack_reset): Delete forward
>        decl.  Move logic selecting update reg to callers.  Update all callers.
>        (rs6000_emit_allocate_stack): Add copy_off param.
>        (emit_frame_save): Don't handle reg+reg addressing.
>        (ptr_regno_for_savres): New function, extracted from..
>        (rs6000_emit_savres_rtx): ..here.  Add lr_offset param.
>        (rs6000_emit_prologue): Generate frame_ptr_rtx as we need it.
>        Set frame_reg_rtx to r11 whenever r11 is needed, and merge
>        frame offset adjustment for out-of-line save with copy from sp.
>        Simplify condition controlling whether cr is saved early or
>        late.  Use ptr_regno_for_savres to verify correct reg is set
>        up for out-of-line saves.  Pass the actual pointer reg used to
>        rs6000_emit_savres_rtx so rtl matches insns in out-of-line
>        function.  Rearrange spe vars so code is similar to that
>        elsewhere in this function.  Don't update frame_off when spe
>        save code will restore r11.  Use emit_frame_save for spe and
>        gpr saves.  Consolidate darwin out-of-line gpr setup with that
>        for other abis.  Don't assume frame_offset is zero and frame
>        reg is sp when setting up altivec reg saves, and calculate
>        exact offset requirement.
>        (rs6000_emit_epilogue): Use HOST_WIDE_INT for frame_off.  Tidy
>        spe restore code.  Consolidate darwin out-of-line gpr setup
>        with that for other abis.

This patch is okay.

Thanks, David

Reply via email to