From patchwork Wed Mar 20 21:18:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 138643 X-Patchwork-Delegate: thomas@monjalon.net 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 D53B643D0A; Wed, 20 Mar 2024 22:18:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AF4142DFD; Wed, 20 Mar 2024 22:18:33 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id F282242D80 for ; Wed, 20 Mar 2024 22:18:30 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 50E0B20B74C1; Wed, 20 Mar 2024 14:18:30 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 50E0B20B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710969510; bh=+MkBMGzAaEGsG/xWVCr+NpNeTrguLOr8nlCWdH0EdRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kwlq9A7E1/bhQ2wOQty4MZMo8ciE3ZBx5l6yvhsD5TBVmDq2FfQorZbBAGf2rZcs5 N/R0OCXKsENv1mD/za48I2foGoN7nY6LclD4UetsW+y/GqdmQqiWIywEoMEMZxIB8T 7wdwBffD/OJDb6DdsCxLzN5Gpl7K1nkkozc2CvcE= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev , Tyler Retzlaff Subject: [PATCH 1/2] eal: provide prefetch functions for MSVC Date: Wed, 20 Mar 2024 14:18:28 -0700 Message-Id: <1710969509-20627-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710969509-20627-1-git-send-email-roretzla@linux.microsoft.com> References: <1710969509-20627-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 MSVC does not have an equivalent of __builtin_prefetch that allows read or read-write parameter. Introduce conditional compile expansion of rte_prefetch[0-2] inline functions when building with MSVC. Signed-off-by: Tyler Retzlaff --- lib/eal/include/generic/rte_prefetch.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/eal/include/generic/rte_prefetch.h b/lib/eal/include/generic/rte_prefetch.h index f9fab5e..773b3b8 100644 --- a/lib/eal/include/generic/rte_prefetch.h +++ b/lib/eal/include/generic/rte_prefetch.h @@ -71,7 +71,11 @@ * GCC docs where these integer constants are described in more detail: * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ +#ifdef RTE_TOOLCHAIN_MSVC + rte_prefetch0(p); +#else __builtin_prefetch(p, 1, 3); +#endif } /** @@ -92,7 +96,11 @@ * GCC docs where these integer constants are described in more detail: * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ +#ifdef RTE_TOOLCHAIN_MSVC + rte_prefetch1(p); +#else __builtin_prefetch(p, 1, 2); +#endif } /** @@ -113,7 +121,11 @@ * GCC docs where these integer constants are described in more detail: * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ +#ifdef RTE_TOOLCHAIN_MSVC + rte_prefetch2(p); +#else __builtin_prefetch(p, 1, 1); +#endif } /**