[1/2] eal: provide movdiri for MSVC

Message ID 1710969879-23701-2-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Series provide rte_ffs32, rte_ffs64 and __rte_x86_movdiri for MSVC |


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 20, 2024, 9:24 p.m. UTC
  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)
+	_directstoreu_u32((void *)(uintptr_t)addr, value);
 	asm volatile(
 		/* MOVDIRI */
 		".byte 0x40, 0x0f, 0x38, 0xf9, 0x02"
 		: "a" (value), "d" (addr));