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


Steven Bosscher <stevenb@suse.de> writes:

> 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?

This optimization is clearly desirable, but IIRC (it has been
discussed before) the preferred way to do it was by using ffs() [which
should be automatically optimized by recent GCC] and making sure that
function has a fallback in libiberty.

It might improve things further to invert the sense of the in_use_p
bits, so that *un*used chunks had their bits 1.

zw


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