[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/INTEL-INTRINSICS PATCH 3/3] Implement _mm_getcsr and _mm_setcsr



Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx>
---
 include/xmmintrin.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/xmmintrin.h b/include/xmmintrin.h
index 2dfa4d5..1b1210f 100644
--- a/include/xmmintrin.h
+++ b/include/xmmintrin.h
@@ -3110,6 +3110,20 @@ static inline void __DEFAULT_FN_ATTRS _mm_pause(void)
 #undef __DEFAULT_FN_ATTRS
 #undef __DEFAULT_FN_ATTRS_MMX
 
+/* Set the control register to I.  */
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
+_mm_setcsr (unsigned int __I)
+{
+  __builtin_ia32_ldmxcsr (__I);
+}
+
+/* Return the contents of the control register.  */
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
+_mm_getcsr (void)
+{
+  return __builtin_ia32_stmxcsr ();
+}
+
 /* Ugly hack for backwards-compatibility (compatible with gcc) */
 #ifdef __GNUC__
 #include <emmintrin.h>
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.