[RXCE]
[reactos.git] / reactos / sdk / include / crt / xmmintrin.h
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6
7 #pragma once
8 #ifndef _INCLUDED_MM2
9 #define _INCLUDED_MM2
10
11 #include <crtdefs.h>
12 #include <mmintrin.h>
13
14 typedef union _DECLSPEC_INTRIN_TYPE _CRT_ALIGN(16) __m128
15 {
16 float m128_f32[4];
17 unsigned __int64 m128_u64[2];
18 __int8 m128_i8[16];
19 __int16 m128_i16[8];
20 __int32 m128_i32[4];
21 __int64 m128_i64[2];
22 unsigned __int8 m128_u8[16];
23 unsigned __int16 m128_u16[8];
24 unsigned __int32 m128_u32[4];
25 } __m128;
26
27
28 extern __m128 _mm_load_ss(float const*);
29 extern int _mm_cvt_ss2si(__m128);
30
31 #ifdef _MSC_VER
32 unsigned int _mm_getcsr(void);
33 #pragma intrinsic(_mm_getcsr)
34 void _mm_setcsr(unsigned int);
35 #pragma intrinsic(_mm_setcsr)
36 #else
37 /*
38 * We can't use __builtin_ia32_* functions,
39 * are they are only available with the -msse2 compiler switch
40 */
41 __INTRIN_INLINE unsigned int _mm_getcsr(void)
42 {
43 unsigned int retval;
44 __asm__ __volatile__("stmxcsr %0" : "=m"(retval));
45 return retval;
46 }
47
48 __INTRIN_INLINE void _mm_setcsr(unsigned int val)
49 {
50 __asm__ __volatile__("ldmxcsr %0" : : "m"(val));
51 }
52 #endif
53
54 /* Alternate names */
55 #define _mm_cvtss_si32 _mm_cvt_ss2si
56
57
58 #endif /* _INCLUDED_MM2 */