summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-05-07 04:18:04 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-05-07 20:45:20 +0200
commitae963d75f8ac37dd870054c20ff14f4e5418f661 (patch)
tree6209719ebaf0729292cdc97b4ac952dab1773b7b /src
parentCommon: Remove more unused compatibility defines (diff)
downloadyuzu-ae963d75f8ac37dd870054c20ff14f4e5418f661.tar
yuzu-ae963d75f8ac37dd870054c20ff14f4e5418f661.tar.gz
yuzu-ae963d75f8ac37dd870054c20ff14f4e5418f661.tar.bz2
yuzu-ae963d75f8ac37dd870054c20ff14f4e5418f661.tar.lz
yuzu-ae963d75f8ac37dd870054c20ff14f4e5418f661.tar.xz
yuzu-ae963d75f8ac37dd870054c20ff14f4e5418f661.tar.zst
yuzu-ae963d75f8ac37dd870054c20ff14f4e5418f661.zip
Diffstat (limited to '')
-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 @@
#define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x
#endif
-#if defined _M_GENERIC
-# define _M_SSE 0x0
-#elif defined __GNUC__
-# if defined __SSE4_2__
-# define _M_SSE 0x402
-# elif defined __SSE4_1__
-# define _M_SSE 0x401
-# elif defined __SSSE3__
-# define _M_SSE 0x301
-# elif defined __SSE3__
-# define _M_SSE 0x300
-# endif
-#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008
-# define _M_SSE 0x402
-#endif
-
#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 @@
#include <algorithm>
#include "common/hash.h"
+#include "common/platform.h"
+
#if _M_SSE >= 0x402
#include "common/cpu_detect.h"
#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 @@
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////
+// Feature detection
+
+#if defined _M_GENERIC
+# define _M_SSE 0x0
+#elif defined __GNUC__
+# if defined __SSE4_2__
+# define _M_SSE 0x402
+# elif defined __SSE4_1__
+# define _M_SSE 0x401
+# elif defined __SSSE3__
+# define _M_SSE 0x301
+# elif defined __SSE3__
+# define _M_SSE 0x300
+# endif
+#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008
+# define _M_SSE 0x402
+#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
// Compiler-Specific Definitions
#define GCC_VERSION_AVAILABLE(major, minor) (defined(__GNUC__) && (__GNUC__ > (major) || \