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 E39EB43176; Mon, 16 Oct 2023 03:29:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69F1B40299; Mon, 16 Oct 2023 03:29:25 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 63D4640269 for ; Mon, 16 Oct 2023 03:29:24 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id A874320B74C0; Sun, 15 Oct 2023 18:29:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A874320B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1697419763; bh=WLDURQQ3hGTwC1Pso7yM1ZkfxzCKJxar7ok0xvNBjYA=; h=From:To:Cc:Subject:Date:From; b=esFuoJakDKnmfYTpWSiEiO+HRW7IRYqhQbRt/+30XSKS4VmZEHVVPbIqXzkU3ubfB WbE4R2vG1TBYqZADESxxRO18OIVm99e/zvYjYm0U0TkfFSQS6h/hGeBNCiGQQF7SeF Qw1G3Z7KrRx2PAS2Fii0/zCbEGOaSfzMtx8wvldg= From: Tyler Retzlaff To: dev@dpdk.org Cc: david.marchand@redhat.com, Joyce Kong , Tyler Retzlaff Subject: [PATCH] eal: use abstracted bit count functions Date: Sun, 15 Oct 2023 18:29:22 -0700 Message-Id: <1697419762-13259-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 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 Use DPDK abstracted bitcount functions in rte_bsf and rte_fls inline functions. Signed-off-by: Tyler Retzlaff --- lib/eal/include/rte_bitops.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h index d45aa54..6b8ae8d 100644 --- a/lib/eal/include/rte_bitops.h +++ b/lib/eal/include/rte_bitops.h @@ -574,7 +574,7 @@ static inline uint32_t rte_bsf32(uint32_t v) { - return (uint32_t)__builtin_ctz(v); + return (uint32_t)rte_ctz32(v); } /** @@ -615,7 +615,7 @@ static inline uint32_t rte_bsf64(uint64_t v) { - return (uint32_t)__builtin_ctzll(v); + return (uint32_t)rte_ctz64(v); } /** @@ -656,7 +656,7 @@ static inline uint32_t rte_fls_u32(uint32_t x) { - return (x == 0) ? 0 : 32 - __builtin_clz(x); + return (x == 0) ? 0 : 32 - rte_clz32(x); } /** @@ -674,7 +674,7 @@ static inline uint32_t rte_fls_u64(uint64_t x) { - return (x == 0) ? 0 : 64 - __builtin_clzll(x); + return (x == 0) ? 0 : 64 - rte_clz64(x); } /*********** Macros to work with powers of 2 ********/ -- 1.8.3.1