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 6985642E48; Tue, 11 Jul 2023 18:49:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDEE94003C; Tue, 11 Jul 2023 18:49:20 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 418BD40A7D for ; Tue, 11 Jul 2023 18:49:19 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8D25121C3A89; Tue, 11 Jul 2023 09:49:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8D25121C3A89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1689094158; bh=IrH2ynVpYKsiyF65alm/shyk0lKAgoOI0fwhRze6FZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ia52I15doAH4P8kGyTlm1XrWMIQ4/ZsEMmmkTT5C3VHmYrRIo+HfLQLoA7Wo8OBJ3 eeYB0qWJPoKiAHj8pKr2PD2SB7j86drxVMsb6nkA6RM12xrXRLyncfjl32WkRjjwjC FOyGfS/Cb4G5GIuZCRJ5vLPHfXEENQxIXuXgE8Z4= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev , Ciara Power , thomas@monjalon.net, david.marchand@redhat.com, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v9 01/14] eal: use rdtsc intrinsic Date: Tue, 11 Jul 2023 09:49:04 -0700 Message-Id: <1689094157-16873-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1689094157-16873-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1689094157-16873-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Convert code to use __rdtsc intrinsic. Signed-off-by: Tyler Retzlaff Acked-by: Konstantin Ananyev Acked-by: Morten Brørup --- lib/eal/x86/include/rte_cycles.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/eal/x86/include/rte_cycles.h b/lib/eal/x86/include/rte_cycles.h index a461a4d..ca0fb10 100644 --- a/lib/eal/x86/include/rte_cycles.h +++ b/lib/eal/x86/include/rte_cycles.h @@ -6,6 +6,12 @@ #ifndef _RTE_CYCLES_X86_64_H_ #define _RTE_CYCLES_X86_64_H_ +#ifdef RTE_TOOLCHAIN_MSVC +#include +#else +#include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -23,6 +29,7 @@ static inline uint64_t rte_rdtsc(void) { +#ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT union { uint64_t tsc_64; RTE_STD_C11 @@ -32,7 +39,6 @@ }; } tsc; -#ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT if (unlikely(rte_cycles_vmware_tsc_map)) { /* ecx = 0x10000 corresponds to the physical TSC for VMware */ asm volatile("rdpmc" : @@ -42,11 +48,7 @@ return tsc.tsc_64; } #endif - - asm volatile("rdtsc" : - "=a" (tsc.lo_32), - "=d" (tsc.hi_32)); - return tsc.tsc_64; + return __rdtsc(); } static inline uint64_t -- 1.8.3.1