[PATCH 2/2] eal: add rte ffs32 and rte ffs64 inline functions
Andre Muezerie
andremue at linux.microsoft.com
Thu Dec 5 21:17:48 CET 2024
On Fri, Jun 14, 2024 at 04:49:49PM +0200, David Marchand wrote:
> On Wed, Mar 20, 2024 at 10:25 PM Tyler Retzlaff
> <roretzla at linux.microsoft.com> wrote:
> >
> > provide toolchain abstraction for __builtin_ffs{,l,ll} gcc built-in
> > intrinsics.
> >
> > Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
>
> Please add a unit test and an entry in the release notes.
>
> > ---
> > lib/eal/include/rte_bitops.h | 34 ++++++++++++++++++++++++++++++++++
> > 1 file changed, 34 insertions(+)
> >
> > diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h
> > index 449565e..e157a45 100644
> > --- a/lib/eal/include/rte_bitops.h
> > +++ b/lib/eal/include/rte_bitops.h
> > @@ -405,6 +405,28 @@
> > return (unsigned int)__popcnt64(v);
> > }
> >
> > +static inline unsigned int
> > +rte_ffs32(uint32_t v)
> > +{
> > + unsigned long rv;
> > +
> > + if (0 == _BitScanForward(&rv, v))
>
> _BitScanForward(&rv, v) == 0 please.
>
>
> --
> David Marchand
>
Thanks David. I'll make the change suggested and add some unit tests.
--
Andre Muezerie
More information about the dev
mailing list