[1/2] eal: provide prefetch functions for MSVC
Checks
Commit Message
MSVC does not have an equivalent of __builtin_prefetch that allows read
or read-write parameter. Introduce conditional compile expansion of
rte_prefetch[0-2] inline functions when building with MSVC.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/eal/include/generic/rte_prefetch.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
@@ -71,7 +71,11 @@
* GCC docs where these integer constants are described in more detail:
* https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
*/
+#ifdef RTE_TOOLCHAIN_MSVC
+ rte_prefetch0(p);
+#else
__builtin_prefetch(p, 1, 3);
+#endif
}
/**
@@ -92,7 +96,11 @@
* GCC docs where these integer constants are described in more detail:
* https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
*/
+#ifdef RTE_TOOLCHAIN_MSVC
+ rte_prefetch1(p);
+#else
__builtin_prefetch(p, 1, 2);
+#endif
}
/**
@@ -113,7 +121,11 @@
* GCC docs where these integer constants are described in more detail:
* https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
*/
+#ifdef RTE_TOOLCHAIN_MSVC
+ rte_prefetch2(p);
+#else
__builtin_prefetch(p, 1, 1);
+#endif
}
/**