DSPCore: Use nested namespace specifiers for the x64 JIT

Slims down the amount of lines needed for namespacing.
This commit is contained in:
Lioncash 2018-03-13 18:57:21 -04:00
parent b3fd79b45a
commit 9f2a46b08d
12 changed files with 24 additions and 93 deletions

View File

@ -22,11 +22,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
constexpr size_t COMPILED_CODE_SIZE = 2097152; constexpr size_t COMPILED_CODE_SIZE = 2097152;
constexpr size_t MAX_BLOCK_SIZE = 250; 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]))); return MDisp(R15, static_cast<int>(offsetof(SDSP, reg_stack_ptr[index])));
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -22,9 +22,7 @@ namespace DSP
{ {
enum class StackRegister; enum class StackRegister;
namespace JIT namespace JIT::x64
{
namespace x64
{ {
class DSPEmitter : public Gen::X64CodeBlock class DSPEmitter : public Gen::X64CodeBlock
{ {
@ -321,6 +319,5 @@ private:
const u8* m_stub_entry_point; const u8* m_stub_entry_point;
}; };
} // namespace x64 } // namespace JIT::x64
} // namespace JIT
} // namespace DSP } // namespace DSP

View File

@ -12,11 +12,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// CLR $acR // CLR $acR
// 1000 r001 xxxx xxxx // 1000 r001 xxxx xxxx
@ -1676,6 +1672,4 @@ void DSPEmitter::asrnr(const UDSPInstruction opc)
} }
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -12,11 +12,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
void DSPEmitter::ReJitConditional(const UDSPInstruction opc, void DSPEmitter::ReJitConditional(const UDSPInstruction opc,
void (DSPEmitter::*conditional_fn)(UDSPInstruction)) void (DSPEmitter::*conditional_fn)(UDSPInstruction))
@ -462,6 +458,4 @@ void DSPEmitter::bloopi(const UDSPInstruction opc)
} }
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -9,11 +9,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// In: val: s64 _Value // In: val: s64 _Value
// Clobbers scratch // Clobbers scratch
@ -168,6 +164,4 @@ void DSPEmitter::Update_SR_Register16_OverS32(Gen::X64Reg val)
Update_SR_Register16(val); Update_SR_Register16(val);
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -25,11 +25,7 @@ using namespace Gen;
sign extension. sign extension.
*/ */
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// DR $arR // DR $arR
// xxxx xxxx 0000 01rr // xxxx xxxx 0000 01rr
@ -698,6 +694,4 @@ void DSPEmitter::popExtValueToReg()
m_store_index2 = -1; m_store_index2 = -1;
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -12,11 +12,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// SRS @M, $(0x18+S) // SRS @M, $(0x18+S)
// 0010 1sss mmmm mmmm // 0010 1sss mmmm mmmm
@ -355,6 +351,4 @@ void DSPEmitter::ilrrn(const UDSPInstruction opc)
increase_addr_reg(reg, reg); increase_addr_reg(reg, reg);
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -10,11 +10,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// MRR $D, $S // MRR $D, $S
// 0001 11dd ddds ssss // 0001 11dd ddds ssss
@ -195,6 +191,4 @@ void DSPEmitter::srbith(const UDSPInstruction opc)
} }
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -15,11 +15,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// Returns s64 in RAX // Returns s64 in RAX
// In: RCX = s16 a, RAX = s16 b // In: RCX = s16 a, RAX = s16 b
@ -778,6 +774,4 @@ void DSPEmitter::msub(const UDSPInstruction opc)
set_long_prod(); set_long_prod();
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -16,11 +16,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// Ordered in order of prefered use. // Ordered in order of prefered use.
// Not all of these are actually available // Not all of these are actually available
@ -993,6 +989,4 @@ void DSPJitRegCache::PutXReg(X64Reg reg)
m_xregs[reg].guest_reg = DSP_REG_NONE; m_xregs[reg].guest_reg = DSP_REG_NONE;
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -8,11 +8,7 @@
#include "Common/x64Emitter.h" #include "Common/x64Emitter.h"
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
class DSPEmitter; class DSPEmitter;
@ -185,6 +181,4 @@ private:
int m_use_ctr; int m_use_ctr;
}; };
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP

View File

@ -10,11 +10,7 @@
using namespace Gen; using namespace Gen;
namespace DSP namespace DSP::JIT::x64
{
namespace JIT
{
namespace x64
{ {
// clobbers: // clobbers:
// EAX = (s8)g_dsp.reg_stack_ptr[reg_index] // 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); m_gpr.ReadReg(_reg + DSP_REG_AXH0, axh, RegisterExtension::Sign);
} }
} // namespace x64 } // namespace DSP::JIT::x64
} // namespace JIT
} // namespace DSP