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: Zack Weinberg <zack at codesourcery dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: gcc at gcc dot gnu dot org, apinski at apple dot com
- Date: Mon, 06 Jan 2003 09:49:26 -0800
- Subject: Re: speeding up parts of gcc by using ffs
- References: <448174DB-2155-11D7-983A-000393A6D2F2@physics.uc.edu>
Andrew Pinski <pinskia@physics.uc.edu> writes:
> A follow of the comments I received, I have only right now added the
> simple cases of HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT and
> HOST_BITS_PER_INT == HOST_BITS_PER_LONG. I might implement the other
> part of the patch for when HOST_BITS_PER_WIDE_INT ==
> HOST_BITS_PER_LONG_LONG and HOST_BITS_PER_WIDE_INT ==
> HOST_BITS_PER_LONG but this might take some time because I have to add
> some more builtins but it will clean things up.
I'm not enthusiastic about all the #ifdefs.
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
zw