This is the mail archive of the
mailing list for the GCC project.
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
> > 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:
register void *stack asm ("%rsp");
register void *stack asm ("%esp");
#elsif defined (SPARC)
register void *stack asm ("%stack");
#error "CPU NOT SUPPORTED"
Hmm .. actually I just checked in more depth how Boehm does this,
and it is clever enough to avoid all this:
int * nested_sp()
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++: http://felix.sf.net