On Thu, 2005-07-28 at 17:34 +0100, Maciej W. Rozycki wrote: > Since you're considering GCC-generated code for ffs(), ffz() and friends, > how about trying __builtin_ffs(), __builtin_clz() and __builtin_ctz() as > apropriate? Reasonably recent GCC may actually be good enough to use the > fastest code depending on the processor submodel selected. I can change the find_first_bit to use __builtin_ffs, but how would you implement the ffz? The clz and ctz only count the number of leading or trailing zeros respectively, it doesn't find the first zero. Of course a __builtin_ctz(~x) would but this might take longer than what we already have. I'll go ahead and try it and see. But I still don't have a decent benchmark on this. I'll start looking into the kernel and see how it's used, and see if I can find a proper benchmark. -- Steve - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- References:
- [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- From: Steven Rostedt <[email protected]>
- Re: [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- From: Daniel Walker <[email protected]>
- Re: [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- From: Steven Rostedt <[email protected]>
- Re: [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- From: Steven Rostedt <[email protected]>
- Re: [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- From: Steven Rostedt <[email protected]>
- Re: [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- From: Steven Rostedt <[email protected]>
- Re: [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- From: Nick Piggin <[email protected]>
- [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- From: Steven Rostedt <[email protected]>
- Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- From: Linus Torvalds <[email protected]>
- Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- From: Steven Rostedt <[email protected]>
- Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- From: "Maciej W. Rozycki" <[email protected]>
- [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable
- Prev by Date: Re: [PATCH 1/5] Add AIO event ring size tunable
- Next by Date: Re: RFC: Raise required gcc version to 3.2 ?
- Previous by thread: Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- Next by thread: Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
- Index(es):