From patchwork Fri Jan 6 22:01:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 121686 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E0F49A00C2; Fri, 6 Jan 2023 23:01:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4BE640141; Fri, 6 Jan 2023 23:01:53 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id CC3CE4067C for ; Fri, 6 Jan 2023 23:01:52 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0BC6420B8762; Fri, 6 Jan 2023 14:01:52 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0BC6420B8762 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673042512; bh=Rl+km/2bTU6f1n+d54rch7Rqizi8tijNZiIGc2krNOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jhiy7dqFO/+CD7jp6uj10d7KRt5xAVUQ28QJ1FnOb45zsEF2P8s1DR6r4HMoXgPzS X3ZpdWxiwmxLUnN+5rib71R2XLu8x+o5yp1VisEzR9QxYj6ZyXlQ040maa+tL7l0Gp NWnTMMAXri2ZRreCJgOv02YLtlIHzklNDcIDVEt4= From: Tyler Retzlaff To: dev@dpdk.org Cc: mb@smartsharesystems.com, thomas@monjalon.net, david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH v3 0/3] eal: provide leading and trailing zero bit count Date: Fri, 6 Jan 2023 14:01:42 -0800 Message-Id: <1673042505-756-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1669241687-18810-1-git-send-email-roretzla@linux.microsoft.com> References: <1669241687-18810-1-git-send-email-roretzla@linux.microsoft.com> 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 Move existing bit manipulation, log and npow functions from rte_common.h to rte_bitops.h Provide leading and trailing zero bit count functions to abstract away compiler specific implementations. Include basic unit test for new leading/trailing zero bit count functions. v3: * rename to use 32/64 instead of l/ll suffixes * add new functions to rte_bitops.h instead of new header * move other bit functions from rte_common.h to rte_bitops.h v2: * use unsigned int instead of unsigned (checkpatches) * match multiple include guard naming convention to rte_common.h * add explicit extern "C" linkage to rte_bitcount.h note: not really needed but checkpatches required * add missing space around '-' Tyler Retzlaff (3): eal: move bit functions from common to bitops header eal: provide leading and trailing zero bit count abstraction test/bitcount: add bitcount tests app/test/meson.build | 2 + app/test/test_bitcount.c | 71 +++++++ app/test/test_common.c | 1 + lib/eal/common/rte_reciprocal.c | 1 + lib/eal/include/rte_bitops.h | 460 ++++++++++++++++++++++++++++++++++++++++ lib/eal/include/rte_common.h | 293 ------------------------- 6 files changed, 535 insertions(+), 293 deletions(-) create mode 100644 app/test/test_bitcount.c