Re: [PATCH 3/6] C-language equivalents of include/asm-*/bitops.h

From
Richard Henderson <hidden>
Date
2006-01-26 00:08:21
Also in
linux-mips, lkml, sparclinux
Reply to
Russell King, 2006-01-25
On Wed, Jan 25, 2006 at 08:02:50PM +0000, Russell King wrote:
quoted
+	s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s;
+	s =  8; if (word << 24 != 0) s = 0; b += s; word >>= s;
+	s =  4; if (word << 28 != 0) s = 0; b += s; word >>= s;
...
Basically, shifts which depend on a variable are more expensive than
constant-based shifts.
Actually, they're all constant shifts.  Just written stupidly.


r~
Thread (30 messages) 30 messages, 15 authors, last reply 2006-01-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help