This is the mail archive of the
mailing list for the GCC project.
Re: [patch] use __builtin_ctzl in ggc-page
- From: Daniel Jacobowitz <drow at false dot org>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Steven Bosscher <stevenb at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 15 Jan 2005 12:56:25 -0500
- Subject: Re: [patch] use __builtin_ctzl in ggc-page
- References: <email@example.com> <firstname.lastname@example.org>
On Fri, Jan 14, 2005 at 05:31:21PM -0800, Zack Weinberg wrote:
> Steven Bosscher <email@example.com> 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.
We already use __builtin_clz explicitly in toplev.h, so I don't see any
harm in doing it this way...