This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Work in progress: "Super Sib Calls"; opinions sought


In message <20020910160854.A4234@royal.anu.edu.au>, Andreas Bauer writes:
 >> Also note that simply constructing arguments in the outgoing space is
 >> not necessarily going to avoid the overlapping problems.  Consider
 >> targets where the incoming and outgoing space is not disjoint
 >> (as is the case when passing arguments in registers).
 >> 
 >> For memory arguments, clearly the incoming and outgoing spaces are
 >> disjoint.  However, you've got those (*&#@$ memory copies from the
 >> outgoing space back to the incoming space; those are bloody expensive.
 >
 >I wasn't aware of these sorts of problems and architectures.  I assume
 >ARM is again the platform which would cause difficulties, since its got
 >such a limited number of registers?  I'd be glad if you could point out
 >some examples for me to have a look at.
Alpha, HP-PA, mn103, mn102, h8300 and many others.  Most targets which pass
parameters in registers use the same registers for incoming and outgoing
arguments.

The only register passing targets I'm aware of which do not have an overlap
in the incoming/outgoing argument registers would would be the sparc, ia64
and xtensa (?).  Not surprisingly those are architctures with register
windows.

It's not a question of a limited number of registers, but the case that
there isn't any mechanism to shift "views" at the call point on most
architectures.  

Think about it for a while.  If the caller puts arguments in some registers,
say %o0, %o1, %o2, etc, then the callee is going to have to expect to find
them in the *same* registers.  ie, the incoming and outgoing register spaces
overlap.  

The exception to that is targets with register windows -- on such targets
the register file is "shifted" at call points which results in the caller
and callee accessing arguments via different registers.  For example, on
the sparc, outgoing arguments are placed in %o0, %o1, etc.  We perform a
call and shift the register window.  As a result the callee sees the
incoming arguments in %i0, %i1,etc.  

Jeff





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]