This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add inline bsearch expansion
- From: Jakub Jelinek <jakub at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 5 Jan 2013 14:19:37 +0100
- Subject: Re: [PATCH] Add inline bsearch expansion
- References: <20130105125130.GA2893@domone.kolej.mff.cuni.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Jan 05, 2013 at 01:51:30PM +0100, OndÅej BÃlka wrote:
> I looked into qsort/bsearch functions. Here I
> added inline version of bsearch.
>
> It saves multiplications instructions as size is
> most of time known in advance.
> When compiled with gcc-4.7.1 and icc 12.1.4 with -O2
> it can inline ccmp functions from example below.
> gcc-4.5.3 does not inline ccmp.
I don't comment on whether it is a good idea or not etc.,
just nits that you should guard it with
#ifdef __USE_EXTERN_INLINES
and use
__extern_inline
instead of extern inline.
Jakub