diff --git a/src/common/common.h b/src/common/common.h index 00d1d14f94053b7d9cdba2af5600cc89993b7d36..e8d32bc937078bd5129d9768dbb7b6859fe88e24 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 0624dab8dfadbe147107ffe52b0b799d549ef0dc..3e62beff41dfd6d700e12537c1bc8097df84e636 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 fc680d549aa75ea0fb601e1cd594cb928db46153..1516dc88a73ba0b20861039d143ea5a92cc45886 100644 --- a/src/common/platform.h +++ b/src/common/platform.h @@ -63,6 +63,25 @@ #define EMU_ARCHITECTURE_X86 #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