This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: FUNCTION_OK_FOR_SIBCALL vs INITIAL_FRAME_POINTER_OFFSET
- From: Paul Brook <paul at codesourcery dot com>
- To: "Dave Korn" <dave dot korn at artimi dot com>
- Cc: gcc at gcc dot gnu dot org, "'Richard Henderson'" <rth at redhat dot com>
- Date: Tue, 21 Mar 2006 15:25:28 +0000
- Subject: Re: FUNCTION_OK_FOR_SIBCALL vs INITIAL_FRAME_POINTER_OFFSET
- References: <009001c64cfa$43667180$a501a8c0@CAM.ARTIMI.COM>
> >> scratchslot = argument
> >> argument = stack frame size - small
> >> sp += argument
> >> argument = scratchslot
> >> sp += small
> >
> > This assumes you have a frame pointer or sp+large_offset addressing mode
> > for accessing scratchslot. In which case you could either use fp as
> > scratch storage or probably have an add sp, large_offset instruction.
> >
> > Paul
> >
> :) OK, I'll allocate a successive series of scratchslots every 32k all
> : the
>
> way up the stack and bounce the (continuously-reducing) frame size argument
> from one to the next until we get within range of the top!
Or use 2 scratch regs:
sp[0] = tmp1;
tmp1 = #(framesize - small)
sp[tmp1] = tmp2;
tmp2 = tmp1;
tmp1 = sp[0];
sp += tmp2;
tmp2 = sp[0];
sp += #small;
Paul