Merge pull request #2101 from Tilka/intrinsics
Clean up the intrinsics #ifdef mess with a common header
This commit is contained in:
commit
b8edd8aedc
|
@ -6,10 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <intrin.h>
|
||||
#include <Windows.h>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
|
||||
// Atomic operations are performed in a single step by the CPU. It is
|
||||
// impossible for other threads to see the operation "half-done."
|
||||
|
|
|
@ -129,22 +129,6 @@ private:
|
|||
// wxWidgets does not have a true dummy macro for this.
|
||||
#define _trans(a) a
|
||||
|
||||
#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
|
||||
|
||||
// Host communication.
|
||||
enum HOST_COMM
|
||||
{
|
||||
|
|
|
@ -34,24 +34,6 @@ struct ArraySizeImpl : public std::extent<T>
|
|||
#define b32(x) (b16(x) | (b16(x) >>16) )
|
||||
#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
|
||||
|
||||
#ifndef __GNUC_PREREQ
|
||||
#define __GNUC_PREREQ(a, b) 0
|
||||
#endif
|
||||
|
||||
#if (defined __GNUC__ && !__GNUC_PREREQ(4,9)) && \
|
||||
!defined __SSSE3__ && defined _M_X86
|
||||
#include <emmintrin.h>
|
||||
static __inline __m128i __attribute__((__always_inline__))
|
||||
_mm_shuffle_epi8(__m128i a, __m128i mask)
|
||||
{
|
||||
__m128i result;
|
||||
__asm__("pshufb %1, %0"
|
||||
: "=x" (result)
|
||||
: "xm" (mask), "0" (a));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,11 +4,9 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/Hash.h"
|
||||
#if _M_SSE >= 0x402
|
||||
#include "Common/CPUDetect.h"
|
||||
#include <nmmintrin.h>
|
||||
#endif
|
||||
#include "Common/Hash.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
|
||||
static u64 (*ptrHashFunction)(const u8 *src, u32 len, u32 samples) = &GetMurmurHash3;
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright 2015 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _M_X86
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <intrin.h>
|
||||
#else
|
||||
#include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
#ifndef __GNUC_PREREQ
|
||||
#define __GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && !__GNUC_PREREQ(4, 9) && !defined __SSSE3__
|
||||
// GCC <= 4.8 only enables intrinsics based on the command-line.
|
||||
// GCC >= 4.9 always declares all intrinsics.
|
||||
// We only want to require SSE2 and thus compile with -msse2,
|
||||
// so define the one post-SSE2 intrinsic that we dispatch at runtime.
|
||||
static __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_shuffle_epi8(__m128i a, __m128i mask)
|
||||
{
|
||||
__m128i result;
|
||||
__asm__("pshufb %1, %0"
|
||||
: "=x" (result)
|
||||
: "xm" (mask), "0" (a));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined _M_GENERIC
|
||||
# define _M_SSE 0
|
||||
#elif _MSC_VER || __INTEL_COMPILER
|
||||
# define _M_SSE 0x402
|
||||
#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
|
||||
#endif
|
||||
|
||||
#endif // _M_X86
|
|
@ -7,13 +7,9 @@
|
|||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <intrin.h>
|
||||
#else
|
||||
|
||||
//#include <config/i386/cpuid.h>
|
||||
#include <xmmintrin.h>
|
||||
#ifndef _WIN32
|
||||
|
||||
#if defined __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -7,12 +7,7 @@
|
|||
#include "Common/CommonTypes.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/FPURoundMode.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <mmintrin.h>
|
||||
#else
|
||||
# include <xmmintrin.h>
|
||||
#endif
|
||||
#include "Common/Intrinsics.h"
|
||||
|
||||
namespace FPURoundMode
|
||||
{
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "Common/Atomic.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
#include "Common/MemoryUtil.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
|
@ -36,10 +37,6 @@
|
|||
#include "Core/DSP/DSPInterpreter.h"
|
||||
#include "Core/DSP/DSPTables.h"
|
||||
|
||||
#if _M_SSE >= 0x301 && !(defined __GNUC__ && !defined __SSSE3__)
|
||||
#include <tmmintrin.h>
|
||||
#endif
|
||||
|
||||
static void gdsp_do_dma();
|
||||
|
||||
void gdsp_ifx_init()
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
#include "Common/StdMakeUnique.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/PatchEngine.h"
|
||||
|
@ -135,11 +136,9 @@ ps_adds1
|
|||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <intrin.h>
|
||||
#else
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
#include <x86intrin.h>
|
||||
|
||||
#if defined(__clang__)
|
||||
#if !__has_builtin(__builtin_ia32_rdtsc)
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <emmintrin.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
#include "Common/MathUtil.h"
|
||||
|
||||
#include "Core/HW/MMIO.h"
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#include "Common/CommonPaths.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/Hash.h"
|
||||
|
|
|
@ -8,18 +8,12 @@
|
|||
#include "Common/Common.h"
|
||||
//#include "VideoCommon.h" // to get debug logs
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
|
||||
#include "VideoCommon/LookUpTables.h"
|
||||
#include "VideoCommon/TextureDecoder.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
#if _M_SSE >= 0x401
|
||||
#include <smmintrin.h>
|
||||
#include <emmintrin.h>
|
||||
#elif _M_SSE >= 0x301 && !(defined __GNUC__ && !defined __SSSE3__)
|
||||
#include <tmmintrin.h>
|
||||
#endif
|
||||
|
||||
// This avoids a harmless warning from a system header in Clang;
|
||||
// see http://llvm.org/bugs/show_bug.cgi?id=16093
|
||||
#if defined(__clang__) && (__clang_major__ * 100 + __clang_minor__ < 304)
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
#ifdef _MSC_VER
|
||||
#include <intrin.h>
|
||||
#else
|
||||
#include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/Intrinsics.h"
|
||||
#include "Common/JitRegister.h"
|
||||
#include "Common/x64ABI.h"
|
||||
#include "VideoCommon/VertexLoaderX64.h"
|
||||
|
|
Loading…
Reference in New Issue