From ab5b90bf154dc6f0f233ec3f6714e294a9898cad Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Mar 2018 20:04:30 -0400 Subject: [PATCH 1/3] DSPCore: Move x64 JIT source files into an x64 subdirectory While the code is namespaced out properly, the files weren't separated into their own directory. This moves the files so that introducing a general interface is easier in the future for supporting other architectures. --- Source/Core/Core/CMakeLists.txt | 20 +++---- Source/Core/Core/Core.vcxproj | 24 ++++---- Source/Core/Core/Core.vcxproj.filters | 55 ++++++++++--------- Source/Core/Core/DSP/DSPCore.cpp | 2 +- Source/Core/Core/DSP/DSPTables.cpp | 2 +- Source/Core/Core/DSP/DSPTables.h | 2 +- .../Core/DSP/Jit/{ => x64}/DSPEmitter.cpp | 2 +- .../Core/Core/DSP/Jit/{ => x64}/DSPEmitter.h | 2 +- .../DSP/Jit/{ => x64}/DSPJitArithmetic.cpp | 2 +- .../Core/DSP/Jit/{ => x64}/DSPJitBranch.cpp | 2 +- .../Core/DSP/Jit/{ => x64}/DSPJitCCUtil.cpp | 2 +- .../Core/DSP/Jit/{ => x64}/DSPJitExtOps.cpp | 2 +- .../DSP/Jit/{ => x64}/DSPJitLoadStore.cpp | 2 +- .../Core/DSP/Jit/{ => x64}/DSPJitMisc.cpp | 2 +- .../DSP/Jit/{ => x64}/DSPJitMultiplier.cpp | 2 +- .../Core/DSP/Jit/{ => x64}/DSPJitRegCache.cpp | 4 +- .../Core/DSP/Jit/{ => x64}/DSPJitRegCache.h | 0 .../Core/DSP/Jit/{ => x64}/DSPJitUtil.cpp | 2 +- Source/Core/Core/HW/DSPLLE/DSPHost.cpp | 2 +- 19 files changed, 67 insertions(+), 64 deletions(-) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPEmitter.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPEmitter.h (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitArithmetic.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitBranch.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitCCUtil.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitExtOps.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitLoadStore.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitMisc.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitMultiplier.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitRegCache.cpp (99%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitRegCache.h (100%) rename Source/Core/Core/DSP/Jit/{ => x64}/DSPJitUtil.cpp (99%) diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 8631b6ab85..d7e25bc915 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -57,16 +57,16 @@ set(SRCS DSP/Interpreter/DSPIntLoadStore.cpp DSP/Interpreter/DSPIntMisc.cpp DSP/Interpreter/DSPIntMultiplier.cpp - DSP/Jit/DSPEmitter.cpp - DSP/Jit/DSPJitRegCache.cpp - DSP/Jit/DSPJitExtOps.cpp - DSP/Jit/DSPJitBranch.cpp - DSP/Jit/DSPJitCCUtil.cpp - DSP/Jit/DSPJitArithmetic.cpp - DSP/Jit/DSPJitLoadStore.cpp - DSP/Jit/DSPJitMultiplier.cpp - DSP/Jit/DSPJitUtil.cpp - DSP/Jit/DSPJitMisc.cpp + DSP/Jit/x64/DSPEmitter.cpp + DSP/Jit/x64/DSPJitRegCache.cpp + DSP/Jit/x64/DSPJitExtOps.cpp + DSP/Jit/x64/DSPJitBranch.cpp + DSP/Jit/x64/DSPJitCCUtil.cpp + DSP/Jit/x64/DSPJitArithmetic.cpp + DSP/Jit/x64/DSPJitLoadStore.cpp + DSP/Jit/x64/DSPJitMultiplier.cpp + DSP/Jit/x64/DSPJitUtil.cpp + DSP/Jit/x64/DSPJitMisc.cpp FifoPlayer/FifoAnalyzer.cpp FifoPlayer/FifoDataFile.cpp FifoPlayer/FifoPlaybackAnalyzer.cpp diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index f50a2811de..99f2b19876 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -81,16 +81,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -339,8 +339,8 @@ - - + + diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters index 5af2b51d8c..189b7d2088 100644 --- a/Source/Core/Core/Core.vcxproj.filters +++ b/Source/Core/Core/Core.vcxproj.filters @@ -47,7 +47,10 @@ {6204f663-bbd0-4eb5-bc15-e3778d8b6091} - {7042fb6f-9284-4469-bc7c-9302e0d984aa} + {5377680f-d667-4f1a-aa86-b616c19a5cd4} + + + {712e3a61-b818-434e-a724-ef8de1f09027} {d657188a-426d-46c8-af0a-caa148c6ed1b} @@ -236,35 +239,35 @@ DSPCore\Interpreter - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 FifoPlayer @@ -952,11 +955,11 @@ DSPCore\Interpreter - - DSPCore\Jit + + DSPCore\Jit\x64 - - DSPCore\Jit + + DSPCore\Jit\x64 FifoPlayer @@ -1561,4 +1564,4 @@ - + \ No newline at end of file diff --git a/Source/Core/Core/DSP/DSPCore.cpp b/Source/Core/Core/DSP/DSPCore.cpp index 3c92a4be54..db68a2c260 100644 --- a/Source/Core/Core/DSP/DSPCore.cpp +++ b/Source/Core/Core/DSP/DSPCore.cpp @@ -21,7 +21,7 @@ #include "Core/DSP/DSPHost.h" #include "Core/DSP/Interpreter/DSPIntUtil.h" #include "Core/DSP/Interpreter/DSPInterpreter.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" #include "Core/HW/DSP.h" namespace DSP diff --git a/Source/Core/Core/DSP/DSPTables.cpp b/Source/Core/Core/DSP/DSPTables.cpp index e8bf9d19f4..e06f69ce74 100644 --- a/Source/Core/Core/DSP/DSPTables.cpp +++ b/Source/Core/Core/DSP/DSPTables.cpp @@ -14,7 +14,7 @@ #include "Core/DSP/Interpreter/DSPIntExtOps.h" #include "Core/DSP/Interpreter/DSPInterpreter.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" namespace DSP { diff --git a/Source/Core/Core/DSP/DSPTables.h b/Source/Core/Core/DSP/DSPTables.h index d62022d972..41d5435a1c 100644 --- a/Source/Core/Core/DSP/DSPTables.h +++ b/Source/Core/Core/DSP/DSPTables.h @@ -11,7 +11,7 @@ #include #include "Core/DSP/DSPCommon.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" namespace DSP { diff --git a/Source/Core/Core/DSP/Jit/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPEmitter.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp index 16c794fcc7..5932f7c550 100644 --- a/Source/Core/Core/DSP/Jit/DSPEmitter.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" #include #include diff --git a/Source/Core/Core/DSP/Jit/DSPEmitter.h b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPEmitter.h rename to Source/Core/Core/DSP/Jit/x64/DSPEmitter.h index 5af802eed0..70585d513d 100644 --- a/Source/Core/Core/DSP/Jit/DSPEmitter.h +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h @@ -14,7 +14,7 @@ #include "Common/x64Emitter.h" #include "Core/DSP/DSPCommon.h" -#include "Core/DSP/Jit/DSPJitRegCache.h" +#include "Core/DSP/Jit/x64/DSPJitRegCache.h" class PointerWrap; diff --git a/Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp index 1802253e21..e787faaa69 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp @@ -8,7 +8,7 @@ #include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPMemoryMap.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitBranch.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp index 960b7c4482..80a7d81ced 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp @@ -8,7 +8,7 @@ #include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPMemoryMap.h" #include "Core/DSP/DSPTables.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitCCUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitCCUtil.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp index d296486327..13bb4fcea7 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitCCUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp @@ -5,7 +5,7 @@ // Additional copyrights go to Duddie and Tratax (c) 2004 #include "Core/DSP/DSPCore.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp index f20b68aefe..5893117f84 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitExtOps.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp @@ -5,7 +5,7 @@ #include "Common/CommonTypes.h" #include "Core/DSP/DSPCore.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp index 32f541a8aa..f750227c13 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp @@ -8,7 +8,7 @@ #include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPMemoryMap.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitMisc.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp index baea0d80e2..875febc466 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp @@ -6,7 +6,7 @@ #include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPMemoryMap.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitMultiplier.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitMultiplier.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp index 21b6120630..3051b11376 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitMultiplier.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp @@ -11,7 +11,7 @@ #include "Common/CommonTypes.h" #include "Core/DSP/DSPCore.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp index 2cda9196c1..87c2b8bf24 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitRegCache.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "Core/DSP/Jit/DSPJitRegCache.h" +#include "Core/DSP/Jit/x64/DSPJitRegCache.h" #include #include @@ -12,7 +12,7 @@ #include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPMemoryMap.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/DSP/Jit/DSPJitRegCache.h b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h similarity index 100% rename from Source/Core/Core/DSP/Jit/DSPJitRegCache.h rename to Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h diff --git a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp similarity index 99% rename from Source/Core/Core/DSP/Jit/DSPJitUtil.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp index 476637badb..0e63ddf670 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp @@ -6,7 +6,7 @@ #include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPHWInterface.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" using namespace Gen; diff --git a/Source/Core/Core/HW/DSPLLE/DSPHost.cpp b/Source/Core/Core/HW/DSPLLE/DSPHost.cpp index 281db0698b..9348f5aa4c 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPHost.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPHost.cpp @@ -13,7 +13,7 @@ #include "Core/DSP/DSPAnalyzer.h" #include "Core/DSP/DSPCodeUtil.h" #include "Core/DSP/DSPCore.h" -#include "Core/DSP/Jit/DSPEmitter.h" +#include "Core/DSP/Jit/x64/DSPEmitter.h" #include "Core/HW/DSP.h" #include "Core/HW/DSPLLE/DSPSymbols.h" #include "Core/Host.h" From b3fd79b45a6c5ee11b45b3e3cc5593462c07e371 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 13 Mar 2018 18:48:10 -0400 Subject: [PATCH 2/3] DSPCore: Rename namespace to match moved x64 JIT files Maintains consistency between location and code --- Source/Core/Core/DSP/DSPCore.cpp | 4 ++-- Source/Core/Core/DSP/DSPCore.h | 4 ++-- Source/Core/Core/DSP/DSPTables.cpp | 2 +- Source/Core/Core/DSP/DSPTables.h | 2 +- Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPEmitter.h | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h | 4 ++-- Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp | 4 ++-- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Source/Core/Core/DSP/DSPCore.cpp b/Source/Core/Core/DSP/DSPCore.cpp index db68a2c260..2a0727ff41 100644 --- a/Source/Core/Core/DSP/DSPCore.cpp +++ b/Source/Core/Core/DSP/DSPCore.cpp @@ -30,7 +30,7 @@ SDSP g_dsp; DSPBreakpoints g_dsp_breakpoints; static State core_state = State::Stopped; bool g_init_hax = false; -std::unique_ptr g_dsp_jit; +std::unique_ptr g_dsp_jit; std::unique_ptr g_dsp_cap; static Common::Event step_event; @@ -171,7 +171,7 @@ bool DSPCore_Init(const DSPInitOptions& opts) // Initialize JIT, if necessary if (opts.core_type == DSPInitOptions::CORE_JIT) - g_dsp_jit = std::make_unique(); + g_dsp_jit = std::make_unique(); g_dsp_cap.reset(opts.capture_logger); diff --git a/Source/Core/Core/DSP/DSPCore.h b/Source/Core/Core/DSP/DSPCore.h index 953dd210ad..d1e9ce2f0d 100644 --- a/Source/Core/Core/DSP/DSPCore.h +++ b/Source/Core/Core/DSP/DSPCore.h @@ -20,7 +20,7 @@ class Accelerator; namespace JIT { -namespace x86 +namespace x64 { class DSPEmitter; } @@ -317,7 +317,7 @@ struct SDSP extern SDSP g_dsp; extern DSPBreakpoints g_dsp_breakpoints; extern bool g_init_hax; -extern std::unique_ptr g_dsp_jit; +extern std::unique_ptr g_dsp_jit; extern std::unique_ptr g_dsp_cap; struct DSPInitOptions diff --git a/Source/Core/Core/DSP/DSPTables.cpp b/Source/Core/Core/DSP/DSPTables.cpp index e06f69ce74..92d4de9074 100644 --- a/Source/Core/Core/DSP/DSPTables.cpp +++ b/Source/Core/Core/DSP/DSPTables.cpp @@ -18,7 +18,7 @@ namespace DSP { -using JIT::x86::DSPEmitter; +using JIT::x64::DSPEmitter; // clang-format off const std::array s_opcodes = diff --git a/Source/Core/Core/DSP/DSPTables.h b/Source/Core/Core/DSP/DSPTables.h index 41d5435a1c..def79f28af 100644 --- a/Source/Core/Core/DSP/DSPTables.h +++ b/Source/Core/Core/DSP/DSPTables.h @@ -69,7 +69,7 @@ struct param2_t struct DSPOPCTemplate { using InterpreterFunction = void (*)(UDSPInstruction); - using JITFunction = void (DSP::JIT::x86::DSPEmitter::*)(UDSPInstruction); + using JITFunction = void (JIT::x64::DSPEmitter::*)(UDSPInstruction); const char* name; u16 opcode; diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp index 5932f7c550..8c886fb251 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp @@ -26,7 +26,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { constexpr size_t COMPILED_CODE_SIZE = 2097152; constexpr size_t MAX_BLOCK_SIZE = 250; @@ -485,6 +485,6 @@ Gen::OpArg DSPEmitter::M_SDSP_reg_stack_ptr(size_t index) return MDisp(R15, static_cast(offsetof(SDSP, reg_stack_ptr[index]))); } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h index 70585d513d..245fb1a9df 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h @@ -24,7 +24,7 @@ enum class StackRegister; namespace JIT { -namespace x86 +namespace x64 { class DSPEmitter : public Gen::X64CodeBlock { @@ -321,6 +321,6 @@ private: const u8* m_stub_entry_point; }; -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp index e787faaa69..47ac525d8c 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp @@ -16,7 +16,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // CLR $acR // 1000 r001 xxxx xxxx @@ -1676,6 +1676,6 @@ void DSPEmitter::asrnr(const UDSPInstruction opc) } } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp index 80a7d81ced..bd6837f4a0 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp @@ -16,7 +16,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { void DSPEmitter::ReJitConditional(const UDSPInstruction opc, void (DSPEmitter::*conditional_fn)(UDSPInstruction)) @@ -462,6 +462,6 @@ void DSPEmitter::bloopi(const UDSPInstruction opc) } } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp index 13bb4fcea7..7457e21377 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp @@ -13,7 +13,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // In: val: s64 _Value // Clobbers scratch @@ -168,6 +168,6 @@ void DSPEmitter::Update_SR_Register16_OverS32(Gen::X64Reg val) Update_SR_Register16(val); } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp index 5893117f84..e8c5bb4fc2 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp @@ -29,7 +29,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // DR $arR // xxxx xxxx 0000 01rr @@ -698,6 +698,6 @@ void DSPEmitter::popExtValueToReg() m_store_index2 = -1; } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp index f750227c13..4ddb24ab52 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp @@ -16,7 +16,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // SRS @M, $(0x18+S) // 0010 1sss mmmm mmmm @@ -355,6 +355,6 @@ void DSPEmitter::ilrrn(const UDSPInstruction opc) increase_addr_reg(reg, reg); } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp index 875febc466..7ecd866fe0 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp @@ -14,7 +14,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // MRR $D, $S // 0001 11dd ddds ssss @@ -195,6 +195,6 @@ void DSPEmitter::srbith(const UDSPInstruction opc) } } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp index 3051b11376..67456043df 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp @@ -19,7 +19,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // Returns s64 in RAX // In: RCX = s16 a, RAX = s16 b @@ -778,6 +778,6 @@ void DSPEmitter::msub(const UDSPInstruction opc) set_long_prod(); } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp index 87c2b8bf24..152e0b49d5 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp @@ -20,7 +20,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // Ordered in order of prefered use. // Not all of these are actually available @@ -993,6 +993,6 @@ void DSPJitRegCache::PutXReg(X64Reg reg) m_xregs[reg].guest_reg = DSP_REG_NONE; } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h index 9d55d37ff5..9e3d2cdbad 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h @@ -12,7 +12,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { class DSPEmitter; @@ -185,6 +185,6 @@ private: int m_use_ctr; }; -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp index 0e63ddf670..d66ebce825 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp @@ -14,7 +14,7 @@ namespace DSP { namespace JIT { -namespace x86 +namespace x64 { // clobbers: // EAX = (s8)g_dsp.reg_stack_ptr[reg_index] @@ -811,6 +811,6 @@ void DSPEmitter::get_ax_h(int _reg, X64Reg axh) m_gpr.ReadReg(_reg + DSP_REG_AXH0, axh, RegisterExtension::Sign); } -} // namespace x86 +} // namespace x64 } // namespace JIT } // namespace DSP From 9f2a46b08df88c28f45be921099c6324e30f4c4b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 13 Mar 2018 18:57:21 -0400 Subject: [PATCH 3/3] DSPCore: Use nested namespace specifiers for the x64 JIT Slims down the amount of lines needed for namespacing. --- Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPEmitter.h | 7 ++----- Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h | 10 ++-------- Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp | 10 ++-------- 12 files changed, 24 insertions(+), 93 deletions(-) diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp index 8c886fb251..642b229bbd 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp @@ -22,11 +22,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { constexpr size_t COMPILED_CODE_SIZE = 2097152; constexpr size_t MAX_BLOCK_SIZE = 250; @@ -485,6 +481,4 @@ Gen::OpArg DSPEmitter::M_SDSP_reg_stack_ptr(size_t index) return MDisp(R15, static_cast(offsetof(SDSP, reg_stack_ptr[index]))); } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h index 245fb1a9df..369da3ae37 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h @@ -22,9 +22,7 @@ namespace DSP { enum class StackRegister; -namespace JIT -{ -namespace x64 +namespace JIT::x64 { class DSPEmitter : public Gen::X64CodeBlock { @@ -321,6 +319,5 @@ private: const u8* m_stub_entry_point; }; -} // namespace x64 -} // namespace JIT +} // namespace JIT::x64 } // namespace DSP diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp index 47ac525d8c..7c159085d7 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp @@ -12,11 +12,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // CLR $acR // 1000 r001 xxxx xxxx @@ -1676,6 +1672,4 @@ void DSPEmitter::asrnr(const UDSPInstruction opc) } } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp index bd6837f4a0..e08a6ac57e 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp @@ -12,11 +12,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { void DSPEmitter::ReJitConditional(const UDSPInstruction opc, void (DSPEmitter::*conditional_fn)(UDSPInstruction)) @@ -462,6 +458,4 @@ void DSPEmitter::bloopi(const UDSPInstruction opc) } } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp index 7457e21377..c8d8522d0b 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp @@ -9,11 +9,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // In: val: s64 _Value // Clobbers scratch @@ -168,6 +164,4 @@ void DSPEmitter::Update_SR_Register16_OverS32(Gen::X64Reg val) Update_SR_Register16(val); } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp index e8c5bb4fc2..53b197045c 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitExtOps.cpp @@ -25,11 +25,7 @@ using namespace Gen; sign extension. */ -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // DR $arR // xxxx xxxx 0000 01rr @@ -698,6 +694,4 @@ void DSPEmitter::popExtValueToReg() m_store_index2 = -1; } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp index 4ddb24ab52..6db4cbefbc 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp @@ -12,11 +12,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // SRS @M, $(0x18+S) // 0010 1sss mmmm mmmm @@ -355,6 +351,4 @@ void DSPEmitter::ilrrn(const UDSPInstruction opc) increase_addr_reg(reg, reg); } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp index 7ecd866fe0..0adfb091a1 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp @@ -10,11 +10,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // MRR $D, $S // 0001 11dd ddds ssss @@ -195,6 +191,4 @@ void DSPEmitter::srbith(const UDSPInstruction opc) } } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp index 67456043df..79e6252f12 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp @@ -15,11 +15,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // Returns s64 in RAX // In: RCX = s16 a, RAX = s16 b @@ -778,6 +774,4 @@ void DSPEmitter::msub(const UDSPInstruction opc) set_long_prod(); } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp index 152e0b49d5..936f7ed41d 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp @@ -16,11 +16,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // Ordered in order of prefered use. // Not all of these are actually available @@ -993,6 +989,4 @@ void DSPJitRegCache::PutXReg(X64Reg reg) m_xregs[reg].guest_reg = DSP_REG_NONE; } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h index 9e3d2cdbad..7ef7d24078 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h @@ -8,11 +8,7 @@ #include "Common/x64Emitter.h" -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { class DSPEmitter; @@ -185,6 +181,4 @@ private: int m_use_ctr; }; -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp index d66ebce825..f9a95b534e 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp @@ -10,11 +10,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x64 +namespace DSP::JIT::x64 { // clobbers: // EAX = (s8)g_dsp.reg_stack_ptr[reg_index] @@ -811,6 +807,4 @@ void DSPEmitter::get_ax_h(int _reg, X64Reg axh) m_gpr.ReadReg(_reg + DSP_REG_AXH0, axh, RegisterExtension::Sign); } -} // namespace x64 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64