Merge pull request #6434 from lioncash/x86-dsp

DSPCore: Move x64 JIT source files into an x64 subdirectory
This commit is contained in:
Léo Lam 2018-03-14 10:54:46 +01:00 committed by GitHub
commit 6813c5e1e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 97 additions and 163 deletions

View File

@ -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

View File

@ -81,16 +81,16 @@
<ClCompile Include="DSP\Interpreter\DSPIntLoadStore.cpp" />
<ClCompile Include="DSP\Interpreter\DSPIntMisc.cpp" />
<ClCompile Include="DSP\Interpreter\DSPIntMultiplier.cpp" />
<ClCompile Include="DSP\Jit\DSPEmitter.cpp" />
<ClCompile Include="DSP\Jit\DSPJitArithmetic.cpp" />
<ClCompile Include="DSP\Jit\DSPJitBranch.cpp" />
<ClCompile Include="DSP\Jit\DSPJitCCUtil.cpp" />
<ClCompile Include="DSP\Jit\DSPJitExtOps.cpp" />
<ClCompile Include="DSP\Jit\DSPJitLoadStore.cpp" />
<ClCompile Include="DSP\Jit\DSPJitMisc.cpp" />
<ClCompile Include="DSP\Jit\DSPJitMultiplier.cpp" />
<ClCompile Include="DSP\Jit\DSPJitRegCache.cpp" />
<ClCompile Include="DSP\Jit\DSPJitUtil.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPEmitter.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitArithmetic.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitBranch.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitCCUtil.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitExtOps.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitLoadStore.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitMisc.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitMultiplier.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitRegCache.cpp" />
<ClCompile Include="DSP\Jit\x64\DSPJitUtil.cpp" />
<ClCompile Include="DSP\LabelMap.cpp" />
<ClCompile Include="FifoPlayer\FifoAnalyzer.cpp" />
<ClCompile Include="FifoPlayer\FifoDataFile.cpp" />
@ -339,8 +339,8 @@
<ClInclude Include="DSP\Interpreter\DSPInterpreter.h" />
<ClInclude Include="DSP\Interpreter\DSPIntExtOps.h" />
<ClInclude Include="DSP\Interpreter\DSPIntUtil.h" />
<ClInclude Include="DSP\Jit\DSPEmitter.h" />
<ClInclude Include="DSP\Jit\DSPJitRegCache.h" />
<ClInclude Include="DSP\Jit\x64\DSPEmitter.h" />
<ClInclude Include="DSP\Jit\x64\DSPJitRegCache.h" />
<ClInclude Include="DSP\LabelMap.h" />
<ClInclude Include="FifoPlayer\FifoAnalyzer.h" />
<ClInclude Include="FifoPlayer\FifoDataFile.h" />

View File

@ -47,7 +47,10 @@
<UniqueIdentifier>{6204f663-bbd0-4eb5-bc15-e3778d8b6091}</UniqueIdentifier>
</Filter>
<Filter Include="DSPCore\Jit">
<UniqueIdentifier>{7042fb6f-9284-4469-bc7c-9302e0d984aa}</UniqueIdentifier>
<UniqueIdentifier>{5377680f-d667-4f1a-aa86-b616c19a5cd4}</UniqueIdentifier>
</Filter>
<Filter Include="DSPCore\Jit\x64">
<UniqueIdentifier>{712e3a61-b818-434e-a724-ef8de1f09027}</UniqueIdentifier>
</Filter>
<Filter Include="HW %28Flipper/Hollywood%29\AI - Audio Interface">
<UniqueIdentifier>{d657188a-426d-46c8-af0a-caa148c6ed1b}</UniqueIdentifier>
@ -236,35 +239,35 @@
<ClCompile Include="DSP\Interpreter\DSPIntMultiplier.cpp">
<Filter>DSPCore\Interpreter</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPEmitter.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitRegCache.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitArithmetic.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitMultiplier.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitBranch.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitMisc.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitCCUtil.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitLoadStore.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitExtOps.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitExtOps.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitLoadStore.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitCCUtil.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitMisc.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitArithmetic.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitMultiplier.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitBranch.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitRegCache.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPEmitter.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="DSP\Jit\DSPJitUtil.cpp">
<Filter>DSPCore\Jit</Filter>
<ClCompile Include="DSP\Jit\x64\DSPJitUtil.cpp">
<Filter>DSPCore\Jit\x64</Filter>
</ClCompile>
<ClCompile Include="FifoPlayer\FifoAnalyzer.cpp">
<Filter>FifoPlayer</Filter>
@ -952,11 +955,11 @@
<ClInclude Include="DSP\Interpreter\DSPIntUtil.h">
<Filter>DSPCore\Interpreter</Filter>
</ClInclude>
<ClInclude Include="DSP\Jit\DSPEmitter.h">
<Filter>DSPCore\Jit</Filter>
<ClInclude Include="DSP\Jit\x64\DSPJitRegCache.h">
<Filter>DSPCore\Jit\x64</Filter>
</ClInclude>
<ClInclude Include="DSP\Jit\DSPJitRegCache.h">
<Filter>DSPCore\Jit</Filter>
<ClInclude Include="DSP\Jit\x64\DSPEmitter.h">
<Filter>DSPCore\Jit\x64</Filter>
</ClInclude>
<ClInclude Include="FifoPlayer\FifoAnalyzer.h">
<Filter>FifoPlayer</Filter>

View File

@ -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<JIT::x86::DSPEmitter> g_dsp_jit;
std::unique_ptr<JIT::x64::DSPEmitter> g_dsp_jit;
std::unique_ptr<DSPCaptureLogger> 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<JIT::x86::DSPEmitter>();
g_dsp_jit = std::make_unique<JIT::x64::DSPEmitter>();
g_dsp_cap.reset(opts.capture_logger);

View File

@ -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<JIT::x86::DSPEmitter> g_dsp_jit;
extern std::unique_ptr<JIT::x64::DSPEmitter> g_dsp_jit;
extern std::unique_ptr<DSPCaptureLogger> g_dsp_cap;
struct DSPInitOptions

View File

@ -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<DSPOPCTemplate, 214> s_opcodes =

View File

@ -11,7 +11,7 @@
#include <string>
#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;

View File

@ -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 <algorithm>
#include <cstddef>
@ -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<int>(offsetof(SDSP, reg_stack_ptr[index])));
}
} // namespace x86
} // namespace JIT
} // namespace DSP
} // namespace DSP::JIT::x64

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <cinttypes>
#include <cstddef>
@ -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

View File

@ -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

View File

@ -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

View File

@ -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"