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: egcs-1.1 status


On Sun, Aug 23, 1998 at 04:42:25AM +0200, Jeffrey A Law wrote:
> 
>   In message <19980823032940.A4165@kali.lrz-muenchen.de>you write:
>   > How about something like 
>   > 
>   > register void *arga asm("eax");
>   > register void *argb asm("ebx");
>   > 
>   > void switch_to(void)
>   > {
>   > 	/* use arga and argb */
>   > }
>   > 
>   > Could this work?
> The important issue is argument setup on the caller side, not the
> callee side.

In the __switch_to case this is done by a assembly function, and thus no 
problem. The question is only whether it can be told to gcc reliably 
that it should expect the variables in these registers.

I recognize that it is not nice because it prevents lots of optimizations
(possible solved by using local fixed register variables instead, is it 
guranteed that these registers won't be thrashed between function entry
and first use?)

Another problem of the global register variables is that the function would
needs to be put into an own file, or at least at the end another one, otherwise
the functions after it would generate horrible code.

Regarding the problem of eax as the return value registers: when all 
functions used in __switch_to() are inlined, and __switch_to() itself
is a void, would that solve the problem?

-Andi


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