From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
Joyce Kong <joyce.kong@arm.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH 1/2] eal: provide movdiri for MSVC
Date: Wed, 20 Mar 2024 14:24:38 -0700 [thread overview]
Message-ID: <1710969879-23701-2-git-send-email-roretzla@linux.microsoft.com> (raw)
In-Reply-To: <1710969879-23701-1-git-send-email-roretzla@linux.microsoft.com>
MSVC does not support inline assembly instead it provides compiler
intrinsics. Provide conditional compile for MSVC for movdiri using the
_directstoreu_u32 intrinsic.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/eal/x86/include/rte_io.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/eal/x86/include/rte_io.h b/lib/eal/x86/include/rte_io.h
index 0e1fefd..2c72601 100644
--- a/lib/eal/x86/include/rte_io.h
+++ b/lib/eal/x86/include/rte_io.h
@@ -22,11 +22,15 @@
static __rte_always_inline void
__rte_x86_movdiri(uint32_t value, volatile void *addr)
{
+#ifdef RTE_TOOLCHAIN_MSVC
+ _directstoreu_u32((void *)(uintptr_t)addr, value);
+#else
asm volatile(
/* MOVDIRI */
".byte 0x40, 0x0f, 0x38, 0xf9, 0x02"
:
: "a" (value), "d" (addr));
+#endif
}
__rte_experimental
--
1.8.3.1
next prev parent reply other threads:[~2024-03-20 21:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 21:24 [PATCH 0/2] provide rte_ffs32, rte_ffs64 and __rte_x86_movdiri " Tyler Retzlaff
2024-03-20 21:24 ` Tyler Retzlaff [this message]
2024-03-20 21:24 ` [PATCH 2/2] eal: add rte ffs32 and rte ffs64 inline functions Tyler Retzlaff
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=1710969879-23701-2-git-send-email-roretzla@linux.microsoft.com \
--to=roretzla@linux.microsoft.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=joyce.kong@arm.com \
--cc=konstantin.v.ananyev@yandex.ru \
/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).