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..2a0727ff41 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 @@ -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 e8bf9d19f4..92d4de9074 100644 --- a/Source/Core/Core/DSP/DSPTables.cpp +++ b/Source/Core/Core/DSP/DSPTables.cpp @@ -14,11 +14,11 @@ #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 { -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 d62022d972..def79f28af 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 { @@ -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/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp similarity index 98% rename from Source/Core/Core/DSP/Jit/DSPEmitter.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp index 16c794fcc7..642b229bbd 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 @@ -22,11 +22,7 @@ using namespace Gen; -namespace DSP -{ -namespace JIT -{ -namespace x86 +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 x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/DSPEmitter.h b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h similarity index 98% rename from Source/Core/Core/DSP/Jit/DSPEmitter.h rename to Source/Core/Core/DSP/Jit/x64/DSPEmitter.h index 5af802eed0..369da3ae37 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; @@ -22,9 +22,7 @@ namespace DSP { enum class StackRegister; -namespace JIT -{ -namespace x86 +namespace JIT::x64 { class DSPEmitter : public Gen::X64CodeBlock { @@ -321,6 +319,5 @@ private: const u8* m_stub_entry_point; }; -} // namespace x86 -} // namespace JIT +} // namespace JIT::x64 } // namespace DSP 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..7c159085d7 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitArithmetic.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp @@ -8,15 +8,11 @@ #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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +namespace DSP::JIT::x64 { // CLR $acR // 1000 r001 xxxx xxxx @@ -1676,6 +1672,4 @@ void DSPEmitter::asrnr(const UDSPInstruction opc) } } -} // namespace x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 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..e08a6ac57e 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitBranch.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitBranch.cpp @@ -8,15 +8,11 @@ #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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +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 x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/DSPJitCCUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp similarity index 97% rename from Source/Core/Core/DSP/Jit/DSPJitCCUtil.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp index d296486327..c8d8522d0b 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitCCUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitCCUtil.cpp @@ -5,15 +5,11 @@ // 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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +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 x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 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..53b197045c 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; @@ -25,11 +25,7 @@ using namespace Gen; sign extension. */ -namespace DSP -{ -namespace JIT -{ -namespace x86 +namespace DSP::JIT::x64 { // DR $arR // xxxx xxxx 0000 01rr @@ -698,6 +694,4 @@ void DSPEmitter::popExtValueToReg() m_store_index2 = -1; } -} // namespace x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp similarity index 98% rename from Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp index 32f541a8aa..6db4cbefbc 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitLoadStore.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitLoadStore.cpp @@ -8,15 +8,11 @@ #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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +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 x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp similarity index 97% rename from Source/Core/Core/DSP/Jit/DSPJitMisc.cpp rename to Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp index baea0d80e2..0adfb091a1 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitMisc.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMisc.cpp @@ -6,15 +6,11 @@ #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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +namespace DSP::JIT::x64 { // MRR $D, $S // 0001 11dd ddds ssss @@ -195,6 +191,4 @@ void DSPEmitter::srbith(const UDSPInstruction opc) } } -} // namespace x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 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..79e6252f12 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitMultiplier.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp @@ -11,15 +11,11 @@ #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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +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 x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 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..936f7ed41d 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,15 +12,11 @@ #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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +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 x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/DSPJitRegCache.h b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h similarity index 97% rename from Source/Core/Core/DSP/Jit/DSPJitRegCache.h rename to Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h index 9d55d37ff5..7ef7d24078 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitRegCache.h +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h @@ -8,11 +8,7 @@ #include "Common/x64Emitter.h" -namespace DSP -{ -namespace JIT -{ -namespace x86 +namespace DSP::JIT::x64 { class DSPEmitter; @@ -185,6 +181,4 @@ private: int m_use_ctr; }; -} // namespace x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 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..f9a95b534e 100644 --- a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp @@ -6,15 +6,11 @@ #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; -namespace DSP -{ -namespace JIT -{ -namespace x86 +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 x86 -} // namespace JIT -} // namespace DSP +} // namespace DSP::JIT::x64 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"