]> xenbits.xensource.com Git - unikraft/libs/intel-intrinsics.git/commitdiff
Implement _mm_pause
authorSharan Santhanam <sharan.santhanam@neclab.eu>
Sat, 15 Jun 2019 21:29:13 +0000 (23:29 +0200)
committerFelipe Huici <felipe.huici@neclab.eu>
Tue, 18 Jun 2019 07:35:12 +0000 (09:35 +0200)
Signed-off-by: Sharan Santhanam <sharan.santhanam@neclab.eu>
Signed-off-by: Felipe Huici <felipe.huici@neclab.eu>
Reviewed-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
include/emmintrin.h
include/xmmintrin.h

index 8703b9abd0e626d718765df7cc0f4259780c218c..c0573a1aecf28d1560c420a59728816cebef3614 100644 (file)
@@ -4999,15 +4999,6 @@ _mm_castsi128_pd(__m128i __a)
 extern "C" {
 #endif
 
-/// Indicates that a spin loop is being executed for the purposes of
-///    optimizing power consumption during the loop.
-///
-/// \headerfile <x86intrin.h>
-///
-/// This intrinsic corresponds to the <c> PAUSE </c> instruction.
-///
-void _mm_pause(void);
-
 #if defined(__cplusplus)
 } // extern "C"
 #endif
index e2543a779e07a283057f4fcbe45a2acd10f62cc4..0b271b3fb3921b79e441d726e47aea582d34ecd7 100644 (file)
 #define __XMMINTRIN_H
 
 #include <mmintrin.h>
+/* Define the default attributes for the functions in this file. */
+#ifdef  __GNUC__
+#define __DEFAULT_FN_ATTRS __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+#define __DEFAULT_FN_ATTRS_MMX __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+#else
+#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse2"), __min_vector_width__(128)))
+#define __DEFAULT_FN_ATTRS_MMX __attribute__((__always_inline__, __nodebug__, __target__("mmx,sse2"), __min_vector_width__(64)))
+#endif
+
 
 typedef int __v4si __attribute__((__vector_size__(16)));
 typedef float __v4sf __attribute__((__vector_size__(16)));
@@ -39,15 +48,6 @@ typedef unsigned int __v4su __attribute__((__vector_size__(16)));
 #include <mm_malloc.h>
 #endif
 
-/* Define the default attributes for the functions in this file. */
-#ifdef  __GNUC__
-#define __DEFAULT_FN_ATTRS __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-#define __DEFAULT_FN_ATTRS_MMX __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-#else
-#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse"), __min_vector_width__(128)))
-#define __DEFAULT_FN_ATTRS_MMX __attribute__((__always_inline__, __nodebug__, __target__("mmx,sse"), __min_vector_width__(64)))
-#endif
-
 #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w))
 
 
@@ -3086,6 +3086,18 @@ do { \
 #define _m_ _mm_
 #define _m_ _mm_
 
+/// Indicates that a spin loop is being executed for the purposes of
+///    optimizing power consumption during the loop.
+///
+/// \headerfile <x86intrin.h>
+///
+/// This intrinsic corresponds to the <c> PAUSE </c> instruction.
+///
+static inline void __DEFAULT_FN_ATTRS _mm_pause(void)
+{
+       __builtin_ia32_pause();
+}
+
 #undef __DEFAULT_FN_ATTRS
 #undef __DEFAULT_FN_ATTRS_MMX