ReactOS  0.4.15-dev-1171-gab82533
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 #endif /* __clang__ */
59 
60 #else /* _MSC_VER */
61 
62 #if !defined(__INTRIN_INLINE) && !defined(__clang__)
63 #define __ATTRIBUTE_ARTIFICIAL __attribute__((artificial))
64 #define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) __ATTRIBUTE_ARTIFICIAL
65 #endif /* !__INTRIN_INLINE && !__clang__ */
66 
67 /*
68  * We can't use __builtin_ia32_* functions,
69  * are they are only available with the -msse2 compiler switch
70  */
71 __INTRIN_INLINE unsigned int _mm_getcsr(void)
72 {
73  unsigned int retval;
74  __asm__ __volatile__("stmxcsr %0" : "=m"(retval));
75  return retval;
76 }
77 
78 __INTRIN_INLINE void _mm_setcsr(unsigned int val)
79 {
80  __asm__ __volatile__("ldmxcsr %0" : : "m"(val));
81 }
82 #endif /* _MSC_VER */
83 
84 #ifdef __clang__
85 #define __INTRIN_INLINE __forceinline
86 
87 /*
88  * Clang implements these as inline functions in the header instead of real builtins
89  */
91 {
92  return (__m128)((__v4su)a ^ (__v4su)b);
93 }
94 
96 {
97  return (__m128)((__v4sf)a / (__v4sf)b);
98 }
99 #endif /* __clang__ */
100 
101 /* Alternate names */
102 #define _mm_cvtss_si32 _mm_cvt_ss2si
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 /* _mm_prefetch constants */
109 #define _MM_HINT_T0 1
110 #define _MM_HINT_T1 2
111 #define _MM_HINT_T2 3
112 #define _MM_HINT_NTA 0
113 #define _MM_HINT_ET1 6
114 
115 
116 #endif /* _INCLUDED_MM2 */
#define _DECLSPEC_INTRIN_TYPE
Definition: _mingw.h:237
__INTRIN_INLINE void _mm_setcsr(unsigned int val)
Definition: xmmintrin.h:78
#define __attribute__(x)
Definition: wpp_private.h:207
__m128 _mm_xor_ps(__m128 a, __m128 b)
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
__m128 _mm_div_ps(__m128 a, __m128 b)
#define __INTRIN_INLINE
Definition: xmmintrin.h:64
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:71
__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