summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/common.h16
-rw-r--r--src/common/hash.cpp2
-rw-r--r--src/common/platform.h19
3 files changed, 21 insertions, 16 deletions
diff --git a/src/common/common.h b/src/common/common.h
index 00d1d14f9..e8d32bc93 100644
--- a/src/common/common.h
+++ b/src/common/common.h
@@ -39,20 +39,4 @@
39 #define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x 39 #define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x
40#endif 40#endif
41 41
42#if defined _M_GENERIC
43# define _M_SSE 0x0
44#elif defined __GNUC__
45# if defined __SSE4_2__
46# define _M_SSE 0x402
47# elif defined __SSE4_1__
48# define _M_SSE 0x401
49# elif defined __SSSE3__
50# define _M_SSE 0x301
51# elif defined __SSE3__
52# define _M_SSE 0x300
53# endif
54#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008
55# define _M_SSE 0x402
56#endif
57
58#include "swap.h" 42#include "swap.h"
diff --git a/src/common/hash.cpp b/src/common/hash.cpp
index 0624dab8d..3e62beff4 100644
--- a/src/common/hash.cpp
+++ b/src/common/hash.cpp
@@ -5,6 +5,8 @@
5#include <algorithm> 5#include <algorithm>
6 6
7#include "common/hash.h" 7#include "common/hash.h"
8#include "common/platform.h"
9
8#if _M_SSE >= 0x402 10#if _M_SSE >= 0x402
9#include "common/cpu_detect.h" 11#include "common/cpu_detect.h"
10#include <nmmintrin.h> 12#include <nmmintrin.h>
diff --git a/src/common/platform.h b/src/common/platform.h
index fc680d549..1516dc88a 100644
--- a/src/common/platform.h
+++ b/src/common/platform.h
@@ -64,6 +64,25 @@
64#endif 64#endif
65 65
66//////////////////////////////////////////////////////////////////////////////////////////////////// 66////////////////////////////////////////////////////////////////////////////////////////////////////
67// Feature detection
68
69#if defined _M_GENERIC
70# define _M_SSE 0x0
71#elif defined __GNUC__
72# if defined __SSE4_2__
73# define _M_SSE 0x402
74# elif defined __SSE4_1__
75# define _M_SSE 0x401
76# elif defined __SSSE3__
77# define _M_SSE 0x301
78# elif defined __SSE3__
79# define _M_SSE 0x300
80# endif
81#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008
82# define _M_SSE 0x402
83#endif
84
85////////////////////////////////////////////////////////////////////////////////////////////////////
67// Compiler-Specific Definitions 86// Compiler-Specific Definitions
68 87
69#define GCC_VERSION_AVAILABLE(major, minor) (defined(__GNUC__) && (__GNUC__ > (major) || \ 88#define GCC_VERSION_AVAILABLE(major, minor) (defined(__GNUC__) && (__GNUC__ > (major) || \