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]

Re: __builtin_apply/sparc.md problem on SPARC-Solaris ?


On Thu, 22 Oct 1998 15:55:34 -0700, Richard Henderson <rth@cygnus.com> wrote:

> On Thu, Oct 22, 1998 at 09:22:38AM -0700, Ovidiu Predescu wrote:
> > Could you please list one case in which type information is needed?
> 
> Some m68k return pointers in a0, integers in d0, fp in fp0.
> 
> Alpha, MIPS, PPC and many others take fp arguments in fp regs,
> others in int regs.
> 
> Sparc64 splits structures <= 32 bytes into fundamental types
> and promotes them by type into integer and fp regs.  Structures
> larger than 32 bytes are passed by reference.

We had the same discussion a while ago and explained you how the Objective-C
runtime uses the __builtin_apply function. It doesn't use the mechanism to
dynamically create method invocations but to forward the message to another
object on possibly another method that takes the _exact_ same arguments.

For doing this thing the __builtin_apply mechanism should be sufficient as it
copies all the registers involved in a function call and restores their values
at the end. The caller sees the function invocation as a normal function call
and takes the return value from the expected place no matter is on stack or in
some register.

For building dynamic function invocations I agree with you that we need to have
additional type information. libffi is a very good example of how to do the
things.

Ovidiu




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