From patchwork Mon Apr 3 21:52:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 125732 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 3EE83428C3; Mon, 3 Apr 2023 23:52:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82E6041143; Mon, 3 Apr 2023 23:52:39 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 161304067E for ; Mon, 3 Apr 2023 23:52:37 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 5F8C4210DC5D; Mon, 3 Apr 2023 14:52:36 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5F8C4210DC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680558756; bh=5ltsvVaUMbKkOdztLnohPoEDJyNO4qKJ6XNaAjGfoFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SZZjl9yoOfEn7Ix4/ef5G9ZYkbcfv2LHFjiDe28qfIos+oyC44nPh3dWI6eTENSLk cIwt1ZByarg1BjtG0Z40+wOGcF6F6znHeWD8xvrkWhCfkr7MFUIjr+vFkrAxOc4VpT zyJEmhLeH99yC6qBCsAe4BXUZbNM3q2WGL2HPsew= From: Tyler Retzlaff To: dev@dpdk.org Cc: bruce.richardson@intel.com, david.marchand@redhat.com, thomas@monjalon.net, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH 1/9] eal: use rdtsc intrinsic when compiling with msvc Date: Mon, 3 Apr 2023 14:52:23 -0700 Message-Id: <1680558751-17931-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-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 Inline assembly is not supported for msvc x64 instead use __rdtsc intrinsic. Signed-off-by: Tyler Retzlaff --- lib/eal/x86/include/rte_cycles.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/eal/x86/include/rte_cycles.h b/lib/eal/x86/include/rte_cycles.h index a461a4d..0c142ce 100644 --- a/lib/eal/x86/include/rte_cycles.h +++ b/lib/eal/x86/include/rte_cycles.h @@ -6,6 +6,10 @@ #ifndef _RTE_CYCLES_X86_64_H_ #define _RTE_CYCLES_X86_64_H_ +#ifdef RTE_TOOLCHAIN_MSVC +#include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -23,6 +27,7 @@ static inline uint64_t rte_rdtsc(void) { +#ifndef RTE_TOOLCHAIN_MSVC union { uint64_t tsc_64; RTE_STD_C11 @@ -47,6 +52,9 @@ "=a" (tsc.lo_32), "=d" (tsc.hi_32)); return tsc.tsc_64; +#else + return __rdtsc(); +#endif } static inline uint64_t