Skip to content
Permalink
Browse files
Merge pull request #6434 from lioncash/x86-dsp
DSPCore: Move x64 JIT source files into an x64 subdirectory
  • Loading branch information
leoetlino committed Mar 14, 2018
2 parents b6ef069 + 9f2a46b commit 6813c5e
Show file tree
Hide file tree
Showing 20 changed files with 97 additions and 163 deletions.
@@ -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
@@ -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" />
@@ -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>
@@ -1561,4 +1564,4 @@
<ItemGroup>
<Text Include="CMakeLists.txt" />
</ItemGroup>
</Project>
</Project>
@@ -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);

@@ -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
@@ -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 =
@@ -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;
@@ -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
@@ -14,17 +14,15 @@
#include "Common/x64Emitter.h"

#include "Core/DSP/DSPCommon.h"
#include "Core/DSP/Jit/DSPJitRegCache.h"
#include "Core/DSP/Jit/x64/DSPJitRegCache.h"

class PointerWrap;

namespace DSP
{
enum class StackRegister;

namespace JIT
{
namespace x86
namespace JIT::x64
{
class DSPEmitter : public Gen::X64CodeBlock
{
@@ -321,6 +319,5 @@ class DSPEmitter : public Gen::X64CodeBlock
const u8* m_stub_entry_point;
};

} // namespace x86
} // namespace JIT
} // namespace JIT::x64
} // namespace DSP
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit 6813c5e

Please sign in to comment.