This is the mail archive of the 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: register variables: list?

On Tue, 2007-10-23 at 18:44 +0100, Dave Korn wrote:
> On 23 October 2007 18:25, skaller wrote:
> > In
> > 
> >
> g-Vars
> > 
> > it explains how to use register variables .. but doesn't list them.
> > 
> > Is there a document somewhere which lists
> > 
> > a) each CPU macro name
>   Don't at all understand what you're referring to there.  Macro?  You mean a
> #define?  Name of the cpu?  I don't see anything referring to the cpu name in
> the explicit reg vars docs.

Sorry, I thought it was obvious.. I want to write:

#if defined(AMD64)
register void *stack asm ("%rsp");
#elsif defined(X86)
register void *stack asm ("%esp");
#elsif defined (SPARC)
register void *stack asm ("%stack");

Hmm .. actually I just checked in more depth how Boehm does this,
and it is clever enough to avoid all this:

int * nested_sp()
    int dummy;

Ouch .. I should have thought of that! And he's using
setjmp to save registers plus other hacks I can steal.. :)

However I may want to reserve a register, so I still
need a list with ABI details (which ones are caller-saved).

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++:

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