From f0d2ce4683abc5eece182802a6b78a3c6ec579f6 Mon Sep 17 00:00:00 2001 From: Zopolis4 Date: Mon, 8 Aug 2022 10:18:36 +1000 Subject: [PATCH] Remove _M_X86 in favour of _M_X86_64 --- CMakeLists.txt | 4 +--- Externals/liblzma/config.h | 4 ++-- Source/Core/Common/CMakeLists.txt | 2 +- Source/Core/Common/Hash.cpp | 4 ++-- Source/Core/Common/Intrinsics.h | 6 +++--- Source/Core/Core/CMakeLists.txt | 4 ++-- Source/Core/Core/DSP/Jit/DSPEmitterBase.cpp | 4 ++-- Source/Core/Core/HW/DSPLLE/DSPLLE.cpp | 2 +- Source/Core/Core/PowerPC/JitInterface.cpp | 4 ++-- Source/Core/DolphinQt/Debugger/JITWidget.cpp | 2 +- Source/Core/UICommon/CMakeLists.txt | 2 +- Source/Core/UICommon/Disassembler.cpp | 6 +++--- Source/Core/VideoCommon/CMakeLists.txt | 2 +- Source/Core/VideoCommon/TextureCacheBase.cpp | 6 +++--- Source/UnitTests/Common/CMakeLists.txt | 2 +- Source/UnitTests/Core/CMakeLists.txt | 2 +- 16 files changed, 27 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 935b61dc68..4e7e0b222e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,9 +219,7 @@ if(ENABLE_GENERIC) set(_M_GENERIC 1) add_definitions(-D_M_GENERIC=1) elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") - set(_M_X86 1) set(_M_X86_64 1) - add_definitions(-D_M_X86=1) add_definitions(-D_M_X86_64=1) check_and_add_flag(HAVE_SSE2 -msse2) elseif(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") @@ -625,7 +623,7 @@ endif() # - place the CMakeLists.txt in the first-level subdirectory, e.g. # Externals/zlib/CMakeLists.txt (that is: NOT in some Src/ subdirectory) # -if (_M_X86) +if (_M_X86_64) add_subdirectory(Externals/Bochs_disasm) endif() add_subdirectory(Externals/cpp-optparse) diff --git a/Externals/liblzma/config.h b/Externals/liblzma/config.h index 21f551ad7e..91d441010f 100644 --- a/Externals/liblzma/config.h +++ b/Externals/liblzma/config.h @@ -151,7 +151,7 @@ /* Define if you have the iconv() function and it works. */ /* #undef HAVE_ICONV */ -#ifdef _M_X86 +#ifdef _M_X86_64 /* Define to 1 if you have the header file. */ #define HAVE_IMMINTRIN_H 1 #endif @@ -367,7 +367,7 @@ sysctl(). */ /* #undef TUKLIB_CPUCORES_SYSCTL */ -#ifdef _M_X86 +#ifdef _M_X86_64 /* Define to 1 if the system supports fast unaligned access to 16-bit and 32-bit integers. */ #define TUKLIB_FAST_UNALIGNED_ACCESS 1 diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index d3e635925e..2c4ec7a6f1 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -220,7 +220,7 @@ if(_M_ARM_64) ArmFPURoundMode.cpp ) else() - if(_M_X86) #X86 + if(_M_X86_64) #X86 target_sources(common PRIVATE x64ABI.cpp x64ABI.h diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp index 51182a0463..683efc54fc 100644 --- a/Source/Core/Common/Hash.cpp +++ b/Source/Core/Common/Hash.cpp @@ -359,7 +359,7 @@ static u64 GetHash64_SSE42_CRC32(const u8* src, u32 len, u32 samples) return h[0] + (h[1] << 10) + (h[2] << 21) + (h[3] << 32); } -#elif defined(_M_X86) +#elif defined(_M_X86_64) FUNCTION_TARGET_SSE42 static u64 GetHash64_SSE42_CRC32(const u8* src, u32 len, u32 samples) @@ -433,7 +433,7 @@ static u64 SetHash64Function(const u8* src, u32 len, u32 samples) { if (cpu_info.bCRC32) { -#if defined(_M_X86_64) || defined(_M_X86) +#if defined(_M_X86_64) s_texture_hash_func = &GetHash64_SSE42_CRC32; #elif defined(_M_ARM_64) s_texture_hash_func = &GetHash64_ARMv8_CRC32; diff --git a/Source/Core/Common/Intrinsics.h b/Source/Core/Common/Intrinsics.h index 0a6e477bb7..f81bd49755 100644 --- a/Source/Core/Common/Intrinsics.h +++ b/Source/Core/Common/Intrinsics.h @@ -3,7 +3,7 @@ #pragma once -#if defined(_M_X86) +#if defined(_M_X86_64) /** * It is assumed that all compilers used to build Dolphin support intrinsics up to and including @@ -49,13 +49,13 @@ #endif // defined(_MSC_VER) || defined(__INTEL_COMPILER) -#endif // _M_X86 +#endif // _M_X86_64 /** * Define the FUNCTION_TARGET macros to nothing if they are not needed, or not on an X86 platform. * This way when a function is defined with FUNCTION_TARGET you don't need to define a second * version without the macro around a #ifdef guard. Be careful when using intrinsics, as all use - * should still be placed around a #ifdef _M_X86 if the file is compiled on all architectures. + * should still be placed around a #ifdef _M_X86_64 if the file is compiled on all architectures. */ #ifndef FUNCTION_TARGET_SSE42 #define FUNCTION_TARGET_SSE42 diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 976780879b..60650a573c 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -537,7 +537,7 @@ add_library(core WiiUtils.h ) -if(_M_X86) +if(_M_X86_64) target_sources(core PRIVATE DSP/Jit/x64/DSPEmitter.cpp DSP/Jit/x64/DSPEmitter.h @@ -640,7 +640,7 @@ PRIVATE ) if ((DEFINED CMAKE_ANDROID_ARCH_ABI AND CMAKE_ANDROID_ARCH_ABI MATCHES "x86|x86_64") OR - (NOT DEFINED CMAKE_ANDROID_ARCH_ABI AND _M_X86)) + (NOT DEFINED CMAKE_ANDROID_ARCH_ABI AND _M_X86_64)) target_link_libraries(core PRIVATE bdisasm) endif() diff --git a/Source/Core/Core/DSP/Jit/DSPEmitterBase.cpp b/Source/Core/Core/DSP/Jit/DSPEmitterBase.cpp index aa3c30a810..70de9caffe 100644 --- a/Source/Core/Core/DSP/Jit/DSPEmitterBase.cpp +++ b/Source/Core/Core/DSP/Jit/DSPEmitterBase.cpp @@ -3,7 +3,7 @@ #include "Core/DSP/Jit/DSPEmitterBase.h" -#if defined(_M_X86) || defined(_M_X86_64) +#if defined(_M_X86_64) #include "Core/DSP/Jit/x64/DSPEmitter.h" #endif @@ -13,7 +13,7 @@ DSPEmitter::~DSPEmitter() = default; std::unique_ptr CreateDSPEmitter([[maybe_unused]] DSPCore& dsp) { -#if defined(_M_X86) || defined(_M_X86_64) +#if defined(_M_X86_64) return std::make_unique(dsp); #else return std::make_unique(); diff --git a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp index 059926c7ff..7b3abdb14e 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPLLE.cpp @@ -120,7 +120,7 @@ static bool FillDSPInitOptions(DSPInitOptions* opts) return false; opts->core_type = DSPInitOptions::CoreType::Interpreter; -#ifdef _M_X86 +#ifdef _M_X86_64 if (Config::Get(Config::MAIN_DSP_JIT)) opts->core_type = DSPInitOptions::CoreType::JIT64; #endif diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index 568419a1e4..8e31ad9c4f 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -32,7 +32,7 @@ #include "Core/PowerPC/Profiler.h" #include "Core/System.h" -#if _M_X86 +#if _M_X86_64 #include "Core/PowerPC/Jit64/Jit.h" #endif @@ -61,7 +61,7 @@ CPUCoreBase* JitInterface::InitJitCore(PowerPC::CPUCore core) { switch (core) { -#if _M_X86 +#if _M_X86_64 case PowerPC::CPUCore::JIT64: m_jit = std::make_unique(m_system); break; diff --git a/Source/Core/DolphinQt/Debugger/JITWidget.cpp b/Source/Core/DolphinQt/Debugger/JITWidget.cpp index 898901f22c..771f72473c 100644 --- a/Source/Core/DolphinQt/Debugger/JITWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/JITWidget.cpp @@ -53,7 +53,7 @@ JITWidget::JITWidget(QWidget* parent) : QDockWidget(parent) ConnectWidgets(); -#if defined(_M_X86) +#if defined(_M_X86_64) m_disassembler = GetNewDisassembler("x86"); #elif defined(_M_ARM_64) m_disassembler = GetNewDisassembler("aarch64"); diff --git a/Source/Core/UICommon/CMakeLists.txt b/Source/Core/UICommon/CMakeLists.txt index 7505f9c9f5..22e01d8d76 100644 --- a/Source/Core/UICommon/CMakeLists.txt +++ b/Source/Core/UICommon/CMakeLists.txt @@ -38,7 +38,7 @@ PRIVATE ) if ((DEFINED CMAKE_ANDROID_ARCH_ABI AND CMAKE_ANDROID_ARCH_ABI MATCHES "x86|x86_64") OR - (NOT DEFINED CMAKE_ANDROID_ARCH_ABI AND _M_X86)) + (NOT DEFINED CMAKE_ANDROID_ARCH_ABI AND _M_X86_64)) target_link_libraries(uicommon PRIVATE bdisasm) endif() diff --git a/Source/Core/UICommon/Disassembler.cpp b/Source/Core/UICommon/Disassembler.cpp index a4cd3ad344..28857f6a6c 100644 --- a/Source/Core/UICommon/Disassembler.cpp +++ b/Source/Core/UICommon/Disassembler.cpp @@ -9,7 +9,7 @@ #include #include #include -#elif defined(_M_X86) +#elif defined(_M_X86_64) #include // Bochs #endif @@ -117,7 +117,7 @@ std::string HostDisassemblerLLVM::DisassembleHostBlock(const u8* code_start, con return x86_disasm.str(); } -#elif defined(_M_X86) +#elif defined(_M_X86_64) class HostDisassemblerX86 : public HostDisassembler { public: @@ -163,7 +163,7 @@ std::unique_ptr GetNewDisassembler(const std::string& arch) return std::make_unique("aarch64-none-unknown", 4, "cortex-a57"); if (arch == "armv7") return std::make_unique("armv7-none-unknown", 4, "cortex-a15"); -#elif defined(_M_X86) +#elif defined(_M_X86_64) if (arch == "x86") return std::make_unique(); #endif diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index be00900b99..ebc32ab0c0 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -216,7 +216,7 @@ PRIVATE glslang ) -if(_M_X86) +if(_M_X86_64) target_sources(videocommon PRIVATE TextureDecoder_x64.cpp VertexLoaderX64.cpp diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 849c032b71..c2ad4cda23 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -10,7 +10,7 @@ #include #include #include -#if defined(_M_X86) || defined(_M_X86_64) +#if defined(_M_X86_64) #include #endif @@ -2654,7 +2654,7 @@ void TextureCacheBase::UninitializeXFBMemory(u8* dst, u32 stride, u32 bytes_per_ // (Y=1,U=254,V=254) instead of dark green (Y=0,U=0,V=0) in YUV // like is done in the EFB path. -#if defined(_M_X86) || defined(_M_X86_64) +#if defined(_M_X86_64) __m128i sixteenBytes = _mm_set1_epi16((s16)(u16)0xFE01); #endif @@ -2662,7 +2662,7 @@ void TextureCacheBase::UninitializeXFBMemory(u8* dst, u32 stride, u32 bytes_per_ { u32 size = bytes_per_row; u8* rowdst = dst; -#if defined(_M_X86) || defined(_M_X86_64) +#if defined(_M_X86_64) while (size >= 16) { _mm_storeu_si128((__m128i*)rowdst, sixteenBytes); diff --git a/Source/UnitTests/Common/CMakeLists.txt b/Source/UnitTests/Common/CMakeLists.txt index a4c9a67ade..034e8ab6db 100644 --- a/Source/UnitTests/Common/CMakeLists.txt +++ b/Source/UnitTests/Common/CMakeLists.txt @@ -18,7 +18,7 @@ add_dolphin_test(SPSCQueueTest SPSCQueueTest.cpp) add_dolphin_test(StringUtilTest StringUtilTest.cpp) add_dolphin_test(SwapTest SwapTest.cpp) -if (_M_X86) +if (_M_X86_64) add_dolphin_test(x64EmitterTest x64EmitterTest.cpp) target_link_libraries(x64EmitterTest PRIVATE bdisasm) elseif (_M_ARM_64) diff --git a/Source/UnitTests/Core/CMakeLists.txt b/Source/UnitTests/Core/CMakeLists.txt index 57ad971140..f2de6f13ad 100644 --- a/Source/UnitTests/Core/CMakeLists.txt +++ b/Source/UnitTests/Core/CMakeLists.txt @@ -17,7 +17,7 @@ add_dolphin_test(FileSystemTest IOS/FS/FileSystemTest.cpp) add_dolphin_test(SkylandersTest IOS/USB/SkylandersTest.cpp) -if(_M_X86) +if(_M_X86_64) add_dolphin_test(PowerPCTest PowerPC/DivUtilsTest.cpp PowerPC/Jit64Common/ConvertDoubleToSingle.cpp