Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Stack bias



On Tue, 11 Aug 2009, der Mouse wrote:

> I'm not talking about any "optimization" gcc could do; I'm talking
> about whether routines that don't themselves need %sp (which among
> other things pretty much compels them to be leaf routines) can use %o6
> the way they can use %o0-%o5 and %o7.  It seemed to me you were saying
> that they couldn't use %o6 but could use %i6, which struck me as so
> utterly bizarre I felt sure there was something I was missing.  Whether
> gcc, or any other compiler for that matter, is smart enough to do so is
> a completely separate question.

No, leaf routines (those that don't issue save/restore instructions) can't 
use %o6.  It needs to point to the register save area for %i0..%l7.  And 
leaf routines are not allowed to change %i0..%l7 since they belong to the 
previous stack frame.  Leaf routines can only use %o0, %o1, %o2, %o3, %o4, 
%o5, %o7, and %g1 (64-bit aplications can also use %g4 and %g5) and of 
course %g0.

Eduardo


Home | Main Index | Thread Index | Old Index