[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ffsl, ffsll: optimize
From: |
Eric Blake |
Subject: |
Re: ffsl, ffsll: optimize |
Date: |
Thu, 13 Oct 2011 16:55:09 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15 |
On 10/13/2011 04:49 PM, Bruno Haible wrote:
Hi Eric,
Your ffs, ffsl, ffsll modules make use of __builtin_ffs for GCC>= 3.4.
But the same compiler versions also have __builtin_ffsl and __builtin_ffsll.
Their use simplifies (and most certainly speeds up) the code generated
by GCC.
I must have missed it when reading 'info gcc', since the builtins are
not next to one another in the documentation (no idea what sorting was
intended there). Or maybe I was hoping that the __builtin_ffs was
type-agnostic, like some of the other builtins.
Of course, I've verified that the test suite still passes.
2011-10-13 Bruno Haible<address@hidden>
ffsl, ffsll: Optimize for GCC.
* lib/ffsl.h (FUNC): Use GCC_BUILTIN if defined.
* lib/ffsl.c (GCC_BUILTIN): New macro.
* lib/ffsll.c (GCC_BUILTIN): Likewise.
Yes, go ahead.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org