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 1C7C6A00C2; Thu, 5 Jan 2023 18:21:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F38344067C; Thu, 5 Jan 2023 18:21:20 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6271C4021E for ; Thu, 5 Jan 2023 18:21:19 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 7918620B8762; Thu, 5 Jan 2023 09:21:18 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7918620B8762 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1672939278; bh=mPmEzLnWeyR4uP71EGnftn0biz0eFVdbMFUEuRYA1K0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q09k98lSBilNj/LM5Py3giOLtSB2Q1E6NmaL6SCz+1RKLRs3KdxtLuT/e4uBOx+04 NV21sKFaOIukM2YO/OlAVXDGwCVdSVz4LRDTRh3oCXIADNLY/KD+yjofnaXGnhvsjn JDO6ik1/cXWAjrGPwklPjDOQcRTGMXaFt/qmcGNY= Date: Thu, 5 Jan 2023 09:21:18 -0800 From: Tyler Retzlaff To: Thomas Monjalon Cc: Morten =?iso-8859-1?Q?Br=F8rup?= , dev@dpdk.org, david.marchand@redhat.com Subject: Re: [PATCH v2 1/2] eal: provide leading and trailing zero bit count abstraction Message-ID: <20230105172118.GB9408@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1669241687-18810-1-git-send-email-roretzla@linux.microsoft.com> <1669246997-30592-2-git-send-email-roretzla@linux.microsoft.com> <98CBD80474FA8B44BF855DF32C47DC35D87624@smartserver.smartshare.dk> <3710898.kQq0lBPeGt@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3710898.kQq0lBPeGt@thomas> 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 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@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.