This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: speeding up parts of gcc by using ffs
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, <gcc at gcc dot gnu dot org>, <apinski at apple dot com>
- Date: Mon, 6 Jan 2003 18:27:01 +0000 (GMT)
- Subject: Re: speeding up parts of gcc by using ffs
On Mon, 6 Jan 2003, Zack Weinberg wrote:
> glibc provides ffsl and ffsll which take 'long' and 'long long'
> respectively; may I suggest that you follow these steps:
>
> 1) put ffsl and ffsll into libiberty.
> 2) have hwint.h #define ffs_hwi and ffs_hwidesti appropriately
> 3) use ffs/ffsl/ffsll/ffs_hwi throughout the compiler
> 4) create __builtin_ffsl and __builtin_ffsll
If any of the uses are genuinely performance-critical (as shown by
profiling), the fallback version of ffs (and ffsl, ffsll) in libiberty
could also be speeded up by replacing it with glibc's generic C
implementation.
--
Joseph S. Myers
jsm28@cam.ac.uk