DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: Anatoly Burakov <anatoly.burakov@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
	Sivaprasad Tummala <sivaprasad.tummala@amd.com>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH] eal: fix compile failure of asm on MSVC toolchain
Date: Tue, 17 Oct 2023 07:06:10 -0700	[thread overview]
Message-ID: <1697551570-20942-1-git-send-email-roretzla@linux.microsoft.com> (raw)

Most MSVC targets do not support inline asm and __MWAITX__ is a GCC
implementation detail. Use a test of defined(RTE_TOOLCHAIN_MSVC) to
avoid conditional compilation of inline asm and instead use intrinsics
instead.

Fixes: c7ed1ce04704 ("eal/x86: add power intrinsics for AMD")
Cc: sivaprasad.tummala@amd.com

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/x86/rte_power_intrinsics.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/x86/rte_power_intrinsics.c b/lib/eal/x86/rte_power_intrinsics.c
index 63a1f7e..483395d 100644
--- a/lib/eal/x86/rte_power_intrinsics.c
+++ b/lib/eal/x86/rte_power_intrinsics.c
@@ -60,7 +60,7 @@ static void intel_umwait(const uint64_t timeout)
  */
 static void amd_monitorx(volatile void *addr)
 {
-#if defined(__MWAITX__)
+#if defined(RTE_TOOLCHAIN_MSVC) || defined(__MWAITX__)
 	/* cast away "volatile" when using the intrinsic */
 	_mm_monitorx((void *)(uintptr_t)addr, 0, 0);
 #else
@@ -75,7 +75,7 @@ static void amd_monitorx(volatile void *addr)
 static void amd_mwaitx(const uint64_t timeout)
 {
 	RTE_SET_USED(timeout);
-#if defined(__MWAITX__)
+#if defined(RTE_TOOLCHAIN_MSVC) || defined(__MWAITX__)
 	_mm_mwaitx(0, 0, 0);
 #else
 	asm volatile(".byte 0x0f, 0x01, 0xfb;"
-- 
1.8.3.1


             reply	other threads:[~2023-10-17 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 14:06 Tyler Retzlaff [this message]
2023-10-26  8:43 ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1697551570-20942-1-git-send-email-roretzla@linux.microsoft.com \
    --to=roretzla@linux.microsoft.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=sivaprasad.tummala@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).