[PATCH v2 1/2] eal: provide leading and trailing zero bit count abstraction

Stephen Hemminger stephen at networkplumber.org
Fri Jan 6 01:32:40 CET 2023


On Thu, 5 Jan 2023 09:21:18 -0800
Tyler Retzlaff <roretzla at linux.microsoft.com> wrote:

> On Thu, Jan 05, 2023 at 10:01:31AM +0100, Thomas Monjalon wrote:
> > 05/01/2023 08:09, Morten Brørup:  
> > > > From: Tyler Retzlaff [mailto:roretzla at linux.microsoft.com]
> > > > +/**
> > > > + * @warning
> > > > + * @b EXPERIMENTAL: this API may change, or be removed, without prior
> > > > notice
> > > > + *
> > > > + * Get the count of leading 0-bits in v.
> > > > + *
> > > > + * @param v
> > > > + *   The value.
> > > > + * @return
> > > > + *   The count of leading zero bits.
> > > > + */
> > > > +__rte_experimental
> > > > +static inline unsigned int
> > > > +rte_clzl(unsigned long v)  
> > > 
> > > Don't use l (long) and ll (long long) for names (and types), use explicit bit lengths, 32 and 64.
> > > 
> > > E.g.: rte_clz32(uint32_t v)  
> > 
> > I agree on using numbers.
> >   
> 
> love the idea, fewer functions too.
> 
> though it is a shame we cannot adopt C11 standard because we could just
> do away with the bit suffixes entirely.

We could but the project needs to support older RHEL releases
which have older tool sets. Though probably this is moot point given
how much meson seems to change.


More information about the dev mailing list