On Tue, 2007-10-23 at 18:44 +0100, Dave Korn wrote: > On 23 October 2007 18:25, skaller wrote: > > > In > > > > > http://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Explicit-Reg-Vars.html#Explicit-Re > 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"); .... #else #error "CPU NOT SUPPORTED" #endif 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; return(&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++: http://felix.sf.net