[SDK] Define some constants for use with _mm_prefetch (#1147)
authorMark Jansen <mark.jansen@reactos.org>
Sun, 16 Dec 2018 22:25:52 +0000 (23:25 +0100)
committerGitHub <noreply@github.com>
Sun, 16 Dec 2018 22:25:52 +0000 (23:25 +0100)
* [SDK] Define some constants for use with _mm_prefetch
This should fix the build for x64
Add __INTRIN_INLINE for gcc and clang

sdk/include/crt/intrin.h
sdk/include/crt/xmmintrin.h

index 8dc1944..3a03d02 100644 (file)
@@ -11,6 +11,7 @@
 #if defined(_M_IX86) || defined(_M_X64)
 //#include <immintrin.h>
 //#include <ammintrin.h>
+#include <xmmintrin.h> // native headers: immintrin.h -> wmmintrin.h -> nmmintrin.h -> smmintrin.h -> tmmintrin.h -> pmmintrin.h -> emmintrin.h
 #endif /* _M_IX86 || _M_X64 */
 
 #if defined(_M_IX86)
index 19eff23..8bb7c7b 100644 (file)
@@ -34,6 +34,16 @@ unsigned int _mm_getcsr(void);
 void _mm_setcsr(unsigned int);
 #pragma intrinsic(_mm_setcsr)
 #else
+
+#ifndef __INTRIN_INLINE
+#ifdef __clang__
+#define __INTRIN_INLINE __forceinline
+#else
+#define __ATTRIBUTE_ARTIFICIAL __attribute__((artificial))
+#define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) __ATTRIBUTE_ARTIFICIAL
+#endif
+#endif
+
 /* 
  * We can't use __builtin_ia32_* functions,
  * are they are only available with the -msse2 compiler switch
@@ -55,4 +65,12 @@ __INTRIN_INLINE void _mm_setcsr(unsigned int val)
 #define _mm_cvtss_si32 _mm_cvt_ss2si
 
 
+/* _mm_prefetch constants */
+#define _MM_HINT_T0 1
+#define _MM_HINT_T1 2
+#define _MM_HINT_T2 3
+#define _MM_HINT_NTA 0
+#define _MM_HINT_ET1 6
+
+
 #endif /* _INCLUDED_MM2 */