> Date: Fri, 13 Feb 1998 10:29:56 -0800 > From: Richard Henderson > PowerPC, Sparc64, and others have multiple CC registers. It > comes to pass that while writing some inline assembly, you need > one. At present you can only just pick one at random and > clobber it. > > What if we provide a way to allocate scratches explicitly? My > thought here is to put something special in the () part of the > output section (whether we turn it into a clobber is immaterial; > we need a parameter number for the asm string). I considered > using something like __scratch__, but it'd be nice to avoid a > new keyword. Using auto instead appeals to me. > > So you could then do > > asm ("cmpwi %0,%1,123\n\t" > "beq %0,1f\n\t" > "blah\n" > "1:" > : "=y"(auto) : "r"(foo)); Funny you should mention that. I have such a patch attached; I did it as a warmup to see how I should do the rewriting patch. It uses the syntax : "=y" : "r"(foo)); That is, you just omit the expression. My problem is that I can't find a compelling use for it. Usually, you only have one register that is best; on PPC, typically this is cr0 (for loops and suchlike) or cr7 (because it occupies the least significant bits when you put the ccr in an integer register). Thus I'm not terribly interested in it, unless someone else can find an actual use for it. I would rather spend the effort on important things, like making sure that the released GNU C library doesn't crash the released GNU C compiler :-).