This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] use __builtin_ctzl in ggc-page


On Fri, 2005-01-14 at 18:32, Steven Bosscher wrote:
> Hi,
> 
> The page allocator looks for free objects by keeping bitmaps of
> taken slots in a bag.  We look for a 0 bit with a loop right now,
> but we could use a builtin instead, like Nathan did recently for
> the revamped bitmap.c.
> 
> Bootstrapped on x86_64-suse-linux-gnu, OK?
> 
> Gr.
> Steven
> 
> 	* ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a
> 	loop to look for a free slot in a page entry.

I would expect this makes things worse for platforms that don't have the
builtin, since we now end up with a library call overhead on top of the
calculation cost.

I'm not convinced these micro-optimizations are such a good thing. 
Apart from anything else, they clutter the code unnecessarily -- and a
really smart compiler ought to be able to work this one out!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]