gs-merge: make xbyak intrinsics includes scoped, avoid cross project linking with x86_intrin

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-05-12 10:09:15 +02:00 committed by Kojin
parent bbcfc0ff1d
commit fef8dfd05b
9 changed files with 28 additions and 55 deletions

View File

@ -29,28 +29,6 @@
#endif #endif
// CPU information support
#if defined(_WIN32)
#define cpuid __cpuid
#define cpuidex __cpuidex
#else
#include "xbyak_intrin.h"
static __inline__ __attribute__((always_inline)) void cpuidex(int CPUInfo[], const int InfoType, const int count)
{
__cpuid_count(InfoType, count, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
}
static __inline__ __attribute__((always_inline)) void cpuid(int CPUInfo[], const int InfoType)
{
__cpuid(InfoType, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
}
#endif
// Rotate instruction // Rotate instruction
#if defined(__clang__) && __clang_major__ < 9 #if defined(__clang__) && __clang_major__ < 9
#pragma clang diagnostic push #pragma clang diagnostic push

View File

@ -1,26 +0,0 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// unfortunately both our x86 recompiler and xbyak requires cpuid on posix
// compatible systems, which has no include guards. As such we currently include
// xbyak inside our recompiler
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>
#define MIE_INTEGER_TYPE_DEFINED
#define XBYAK_ENABLE_OMITTED_OPERAND

View File

@ -12,8 +12,6 @@ set(CommonFlags
set(UtilitiesFinalFlags ${CommonFlags}) set(UtilitiesFinalFlags ${CommonFlags})
include_directories ("${CMAKE_SOURCE_DIR}/3rdparty/xbyak/")
# variable with all sources of this library # variable with all sources of this library
set(UtilitiesSources set(UtilitiesSources
VirtualMemory.cpp VirtualMemory.cpp

View File

@ -11,8 +11,6 @@ set(Output x86emitter)
set(CommonFlags set(CommonFlags
) )
include_directories ("${CMAKE_SOURCE_DIR}/3rdparty/xbyak/")
set(x86emitterFinalFlags ${CommonFlags}) set(x86emitterFinalFlags ${CommonFlags})
# variable with all sources of this library # variable with all sources of this library

View File

@ -18,6 +18,28 @@
#include "internal.h" #include "internal.h"
#include "x86_intrin.h" #include "x86_intrin.h"
// CPU information support
#if defined(_WIN32)
#define cpuid __cpuid
#define cpuidex __cpuidex
#else
#include <cpuid.h>
static __inline__ __attribute__((always_inline)) void cpuidex(int CPUInfo[], const int InfoType, const int count)
{
__cpuid_count(InfoType, count, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
}
static __inline__ __attribute__((always_inline)) void cpuid(int CPUInfo[], const int InfoType)
{
__cpuid(InfoType, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
}
#endif
using namespace x86Emitter; using namespace x86Emitter;
__aligned16 x86capabilities x86caps; __aligned16 x86capabilities x86caps;

View File

@ -22,7 +22,6 @@
#pragma once #pragma once
#include "GS.h" #include "GS.h"
#include "x86emitter/xbyak_intrin.h"
class GSUtil class GSUtil
{ {

View File

@ -1,6 +1,11 @@
#pragma once #pragma once
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>
#define MIE_INTEGER_TYPE_DEFINED
#define XBYAK_ENABLE_OMITTED_OPERAND
#include <cfloat> #include <cfloat>
typedef unsigned char uint8; typedef unsigned char uint8;

View File

@ -25,7 +25,6 @@
#include "../../GSCodeBuffer.h" #include "../../GSCodeBuffer.h"
#include "../SW/GSScanlineEnvironment.h" #include "../SW/GSScanlineEnvironment.h"
#include "x86emitter/xbyak_intrin.h"
template <class KEY, class VALUE> template <class KEY, class VALUE>
class GSFunctionMap class GSFunctionMap

View File

@ -75,7 +75,7 @@ bool GSC_DBZBT3(const GSFrameInfo& fi, int& skip)
bool GSC_DeathByDegreesTekkenNinaWilliams(const GSFrameInfo& fi, int& skip) bool GSC_DeathByDegreesTekkenNinaWilliams(const GSFrameInfo& fi, int& skip)
{ {
// Note: Game also has issues with texture shuffle not supported on strange clamp mode. // Note: Game also has issues with texture shuffle not supported on strange clamp mode.
// See https://forums.pcsx2.net/Thread-GS-Texture-Cache-Bug-Report-Death-By-Degrees-SLUS-20934-NTSC // See https://forums.pcsx2.net/Thread-GSDX-Texture-Cache-Bug-Report-Death-By-Degrees-SLUS-20934-NTSC
if (skip == 0) if (skip == 0)
{ {
if ((Aggressive || !s_nativeres) && fi.TME && fi.FBP == 0 && fi.TBP0 == 0x34a0 && fi.TPSM == PSM_PSMCT32) if ((Aggressive || !s_nativeres) && fi.TME && fi.FBP == 0 && fi.TBP0 == 0x34a0 && fi.TPSM == PSM_PSMCT32)