Re: [PATCH 11/23] make atomic_read() and atomic_set() behavior consistent on m32r
From: Segher Boessenkool
Date: Wed Aug 22 2007 - 10:26:08 EST
I also tried to rewrite it with inline asm code, but the kernel text
size
bacame roughly 2kB larger. So, I prefer C version.
Could you send me the source code diff between the two versions
you tested? 2kB difference is way too much, the asm version should
be smaller if anything.
You're not the only arch maintainer who prefers doing it in C. If you
trust your compiler (a big "if", apparently), inline asm only improves
code generation if you have a whole bunch of general purpose registers
for the optimizer to play with.
No. The only real difference between the *(volatile *)& version
and the volatile asm() version is that the volatile asm() version
has defined semantics. There will be some code generation differences
too, but they should be in the noise, unless GCC generates really
bad code for either case. We know it sometimes does that for the
*(volatile *)& thing; if the asm() version does something bad, I'd
like to know about that too.
Segher
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/