[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT/INTEL-INTRINSICS PATCH 1/3] Implement _mm_pause
From: Sharan Santhanam <sharan.santhanam@xxxxxxxxx> Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx> Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx> --- include/emmintrin.h | 9 --------- include/xmmintrin.h | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/include/emmintrin.h b/include/emmintrin.h index 8703b9a..c0573a1 100644 --- a/include/emmintrin.h +++ b/include/emmintrin.h @@ -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 diff --git a/include/xmmintrin.h b/include/xmmintrin.h index e2543a7..2dfa4d5 100644 --- a/include/xmmintrin.h +++ b/include/xmmintrin.h @@ -25,6 +25,15 @@ #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))); @@ -3086,6 +3095,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 -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |