This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: floor_log2_wide speedup


On Fri, May 28, 2004 at 08:02:47PM -0400, DJ Delorie wrote:
> floor_log2_wide (unsigned HOST_WIDE_INT x)
> {
>   int t=0;
>   if (x == 0)
>     return -1;
> #if (__GNUC__ * 1000 + __GNUC_MINOR__) >= 3004
>   return (sizeof(HOST_WIDE_INT)*8-1) - __builtin_clz(x);

You've got to choose the proper version of clz, clzl, clzll.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]