Hi Collin,

> Is there any reason not to use stdbit.h for ffs, ffsl, ffsll,
> count-leading-zeros, count-one-bits, count-trailing-zeros?

Before doing so, how about making sure that stdbit.in.h works
at least as well as the old code w.r.t. inlining (assuming -O1 or higher)?
(Recall that these functions do very little work, therefore an extra
function call cost is significant.) Maybe it already does, but I haven't
verified it; could you verify it with reasonably modern gcc and clang?

Also, I see that MSVC is not well covered by this default in stdbit.in.h:

#else
/* This platform is so old that it lacks typeof, so _Generic is likely
   missing or unreliable.  The C23 standard seems to allow yielding B
   (which is always unsigned long long int), so do that.  */
# define _GL_STDBIT_TYPEOF_CAST(a, b) (b)
#endif

Can it be improved?

Bruno




Reply via email to