On Thu, Jun 05, 2008 at 11:44:51AM +0100, David Howells wrote:
Scott Wood [off-list ref] wrote:
quoted
int tmp;
asm volatile("addi %1, %2, -1;"
"andc %1, %2, %1;"
"cntlzw %1, %1;"
"subfic %0, %1, 31" : "=r" (j), "=&r" (tmp) : "r" (i));
Registers are usually assumed to be 'long' in size, so I'd recommend using
that rather than 'int' for tmp, though I suspect it'll make little difference
(except, perhaps on x86 where you can partially use registers).
I had originally written that as long, but I changed it since the asm
code is explicitly assuming 32-bit. It's more documentation than
anything else.
-Scott