From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91114D715C7 for ; Sat, 24 Jan 2026 07:58:57 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72ECF40293; Sat, 24 Jan 2026 08:58:56 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 69E7D4026F for ; Sat, 24 Jan 2026 08:58:55 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 830462071A; Sat, 24 Jan 2026 08:58:54 +0100 (CET) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v10] eal: RTE_PTR_ADD/SUB char* for compiler optimizations Date: Sat, 24 Jan 2026 08:58:52 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F656B1@smartserver.smartshare.dk> X-MimeOLE: Produced By Microsoft Exchange V6.5 In-Reply-To: <20260123162742.69675-1-scott.k.mitch1@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v10] eal: RTE_PTR_ADD/SUB char* for compiler optimizations Thread-Index: AdyMhTZO5b3PMC1AQAOBrqnsxQRR9AAgeMbg References: <20260117210322.5419-1-scott.k.mitch1@gmail.com> <20260123162742.69675-1-scott.k.mitch1@gmail.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: , Cc: , 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 > From: Scott Mitchell >=20 > Modify RTE_PTR_ADD and RTE_PTR_SUB to use char* pointer arithmetic > on Clang instead of uintptr_t casts. Benefits of this approach: > - API compatibility: works for both integer and pointer inputs > - Retains simple macros: no pragmas, no _Generic > - Enables Clang optimizations: Clang can now unroll and vectorize > pointer loops. GCC uses uintptr_t to avoid false positive warnings. >=20 > Example use case which benefits is __rte_raw_cksum. Performance > results from cksum_perf_autotest on Intel Xeon (Cascade Lake, > AVX-512) built with Clang 18.1 (TSC cycles/byte): > Block size Before After Improvement > 100 0.40 0.24 ~40% > 1500 0.50 0.06 ~8x > 9000 0.49 0.06 ~8x >=20 > Signed-off-by: Scott Mitchell Acked-by: Morten Br=F8rup