From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 34AD445E3C; Thu, 5 Dec 2024 21:17:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA4FA40A73; Thu, 5 Dec 2024 21:17:50 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 659C74069D for ; Thu, 5 Dec 2024 21:17:49 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 5458120ACD84; Thu, 5 Dec 2024 12:17:48 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5458120ACD84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733429868; bh=bRAD/htCGQzcTa57/TxXFQJc7LbGmK/PK/nIs4KGcPQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i58Xxplb2uQaznb8Walx0g0bsPQbDOGK7wuV7Loki7lIF1ZDjh6xMv20Z1ji/7Fpr 4roq6Eda1ZiFoPXzJD1xBaD50+fK0lBsB2mCmnPG8CiQ25Bi9T2w0TAiVOWfHxEkt3 0UWcD7WuMLv9TxA/sb4KzC+IahwZthUL8K/BXBBM= Date: Thu, 5 Dec 2024 12:17:48 -0800 From: Andre Muezerie To: David Marchand Cc: Tyler Retzlaff , dev@dpdk.org, Bruce Richardson , Joyce Kong , Konstantin Ananyev Subject: Re: [PATCH 2/2] eal: add rte ffs32 and rte ffs64 inline functions Message-ID: <20241205201748.GA2676@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1710969879-23701-1-git-send-email-roretzla@linux.microsoft.com> <1710969879-23701-3-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, Jun 14, 2024 at 04:49:49PM +0200, David Marchand wrote: > On Wed, Mar 20, 2024 at 10:25 PM Tyler Retzlaff > wrote: > > > > provide toolchain abstraction for __builtin_ffs{,l,ll} gcc built-in > > intrinsics. > > > > Signed-off-by: Tyler Retzlaff > > 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