ReactOS  0.4.15-dev-3207-ga415bd4
xmmintrin.h
Go to the documentation of this file.
1 
7 #pragma once
8 #ifndef _INCLUDED_MM2
9 #define _INCLUDED_MM2
10 
11 #include <crtdefs.h>
12 #include <mmintrin.h>
13 
14 #ifdef __clang__
15 
16 typedef float __v4sf __attribute__((__vector_size__(16)));
17 typedef signed int __v4si __attribute__((__vector_size__(16)));
18 typedef unsigned int __v4su __attribute__((__vector_size__(16)));
19 
20 typedef float __m128 __attribute__((__vector_size__(16), __aligned__(16)));
21 
22 #else /* __clang__ */
23 
25 {
26  float m128_f32[4];
27  unsigned __int64 m128_u64[2];
28  __int8 m128_i8[16];
29  __int16 m128_i16[8];
30  __int32 m128_i32[4];
31  __int64 m128_i64[2];
32  unsigned __int8 m128_u8[16];
33  unsigned __int16 m128_u16[8];
34  unsigned __int32 m128_u32[4];
36 
37 #endif /* __clang__ */
38 
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 extern __m128 _mm_load_ss(float const*);
45 extern int _mm_cvt_ss2si(__m128);
48 
49 #ifdef _MSC_VER
50 unsigned int _mm_getcsr(void);
51 #pragma intrinsic(_mm_getcsr)
52 void _mm_setcsr(unsigned int);
53 #pragma intrinsic(_mm_setcsr)
54 
55 #ifndef __clang__
56 #pragma intrinsic(_mm_xor_ps)
57 #pragma intrinsic(_mm_div_ps)
58 #else
59 
60 /*
61  * Clang implements these as inline functions in the header instead of real builtins
62  */
63 __forceinline __m128 _mm_xor_ps(__m128 a, __m128 b)
64 {
65  return (__m128)((__v4su)a ^ (__v4su)b);
66 }
67 
68 __forceinline __m128 _mm_div_ps(__m128 a, __m128 b)
69 {
70  return (__m128)((__v4sf)a / (__v4sf)b);
71 }
72 #endif /* __clang__ */
73 
74 #else /* _MSC_VER */
75 
76 #if !defined(__INTRIN_INLINE)
77 # ifdef __clang__
78 # define __ATTRIBUTE_ARTIFICIAL
79 # else
80 # define __ATTRIBUTE_ARTIFICIAL __attribute__((artificial))
81 # endif
82 # define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) __ATTRIBUTE_ARTIFICIAL
83 #endif /* !__INTRIN_INLINE */
84 
85 #ifndef HAS_BUILTIN
86 #ifdef __clang__
87 #define HAS_BUILTIN(x) __has_builtin(x)
88 #else
89 #define HAS_BUILTIN(x) 0
90 #endif
91 #endif
92 
93 /*
94  * We can't use __builtin_ia32_* functions,
95  * are they are only available with the -msse2 compiler switch
96  */
97 #if !HAS_BUILTIN(_mm_getcsr)
98 __INTRIN_INLINE unsigned int _mm_getcsr(void)
99 {
100  unsigned int retval;
101  __asm__ __volatile__("stmxcsr %0" : "=m"(retval));
102  return retval;
103 }
104 #endif
105 
106 #if !HAS_BUILTIN(_mm_setcsr)
107 __INTRIN_INLINE void _mm_setcsr(unsigned int val)
108 {
109  __asm__ __volatile__("ldmxcsr %0" : : "m"(val));
110 }
111 #endif
112 #endif /* _MSC_VER */
113 
114 /* Alternate names */
115 #define _mm_cvtss_si32 _mm_cvt_ss2si
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 /* _mm_prefetch constants */
122 #define _MM_HINT_T0 1
123 #define _MM_HINT_T1 2
124 #define _MM_HINT_T2 3
125 #define _MM_HINT_NTA 0
126 #define _MM_HINT_ET1 6
127 
128 
129 #endif /* _INCLUDED_MM2 */
#define _DECLSPEC_INTRIN_TYPE
Definition: _mingw.h:234
__INTRIN_INLINE void _mm_setcsr(unsigned int val)
Definition: xmmintrin.h:107
__asm__("\n\t \ NewInt3Handler:\n\t \ pushl $" STR(REASON_INT3) "\n\t \ // call debugger loop\n\t \ jmp NewInt31Handler\n\t \ ")
#define __attribute__(x)
Definition: wpp_private.h:207
__m128 _mm_xor_ps(__m128 a, __m128 b)
__m128 _mm_div_ps(__m128 a, __m128 b)
#define __INTRIN_INLINE
Definition: xmmintrin.h:82
union _DECLSPEC_INTRIN_TYPE _CRT_ALIGN(16) __m128
Definition: xmmintrin.h:24
#define b
Definition: ke_i.h:79
GLuint GLfloat * val
Definition: glext.h:7180
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
__INTRIN_INLINE unsigned int _mm_getcsr(void)
Definition: xmmintrin.h:98
__m128
Definition: xmmintrin.h:35
__m128 _mm_load_ss(float const *)
#define __int32
Definition: basetyps.h:19
#define __int8
Definition: basetyps.h:25
int _mm_cvt_ss2si(__m128)
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define __int64
Definition: basetyps.h:16
#define __int16
Definition: basetyps.h:22