1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Remove constexpr from ppu/spu decoders.

We don't need them at compile time (yet).
But can reduce compile time and complexity.
This commit is contained in:
Nekotekina 2020-12-10 15:06:01 +03:00
parent b382d3b3e9
commit 65c04e4ddd
10 changed files with 28 additions and 28 deletions

View File

@ -10,7 +10,7 @@
LOG_CHANNEL(ppu_validator);
constexpr ppu_decoder<ppu_itype> s_ppu_itype;
const ppu_decoder<ppu_itype> s_ppu_itype;
template<>
void fmt_class_string<ppu_attr>::format(std::string& out, u64 arg)

View File

@ -2,7 +2,7 @@
#include "PPUDisAsm.h"
#include "PPUFunction.h"
constexpr ppu_decoder<PPUDisAsm> s_ppu_disasm;
const ppu_decoder<PPUDisAsm> s_ppu_disasm;
u32 PPUDisAsm::disasm(u32 pc)
{

View File

@ -103,7 +103,7 @@ class ppu_decoder
};
// Fill lookup table
constexpr void fill_table(u32 main_op, u32 count, u32 sh, std::initializer_list<instruction_info> entries)
void fill_table(u32 main_op, u32 count, u32 sh, std::initializer_list<instruction_info> entries) noexcept
{
if (sh < 11)
{
@ -132,7 +132,7 @@ class ppu_decoder
}
public:
constexpr ppu_decoder()
ppu_decoder() noexcept
{
for (auto& x : m_table)
{
@ -576,12 +576,12 @@ public:
});
}
const std::array<T, 0x20000>& get_table() const
const std::array<T, 0x20000>& get_table() const noexcept
{
return m_table;
}
T decode(u32 inst) const
T decode(u32 inst) const noexcept
{
return m_table[ppu_decode(inst)];
}

View File

@ -105,9 +105,9 @@ void fmt_class_string<ppu_join_status>::format(std::string& out, u64 arg)
});
}
constexpr ppu_decoder<ppu_interpreter_precise> g_ppu_interpreter_precise;
constexpr ppu_decoder<ppu_interpreter_fast> g_ppu_interpreter_fast;
constexpr ppu_decoder<ppu_itype> g_ppu_itype;
const ppu_decoder<ppu_interpreter_precise> g_ppu_interpreter_precise;
const ppu_decoder<ppu_interpreter_fast> g_ppu_interpreter_fast;
const ppu_decoder<ppu_itype> g_ppu_itype;
extern void ppu_initialize();
extern void ppu_initialize(const ppu_module& info);

View File

@ -10,8 +10,8 @@
using namespace llvm;
constexpr ppu_decoder<PPUTranslator> s_ppu_decoder;
constexpr ppu_decoder<ppu_iname> s_ppu_iname;
const ppu_decoder<PPUTranslator> s_ppu_decoder;
const ppu_decoder<ppu_iname> s_ppu_iname;
PPUTranslator::PPUTranslator(LLVMContext& context, Module* _module, const ppu_module& info, ExecutionEngine& engine)
: cpu_translator(_module, false)

View File

@ -23,8 +23,8 @@
#define SPU_OFF_16(x, ...) asmjit::x86::word_ptr(*cpu, offset32(&spu_thread::x, ##__VA_ARGS__))
#define SPU_OFF_8(x, ...) asmjit::x86::byte_ptr(*cpu, offset32(&spu_thread::x, ##__VA_ARGS__))
constexpr spu_decoder<spu_interpreter_fast> g_spu_interpreter_fast; // TODO: avoid
constexpr spu_decoder<spu_recompiler> s_spu_decoder;
extern const spu_decoder<spu_interpreter_fast> g_spu_interpreter_fast{}; // TODO: avoid
const spu_decoder<spu_recompiler> s_spu_decoder;
extern u64 get_timebased_time();

View File

@ -3,9 +3,9 @@
#include "SPUAnalyser.h"
#include "SPUThread.h"
constexpr spu_decoder<SPUDisAsm> s_spu_disasm;
constexpr spu_decoder<spu_itype> s_spu_itype;
constexpr spu_decoder<spu_iflag> s_spu_iflag;
const spu_decoder<SPUDisAsm> s_spu_disasm;
const spu_decoder<spu_itype> s_spu_itype;
const spu_decoder<spu_iflag> s_spu_iflag;
u32 SPUDisAsm::disasm(u32 pc)
{

View File

@ -56,14 +56,14 @@ class spu_decoder
u32 value;
T pointer;
constexpr instruction_info(u32 m, u32 v, T p)
instruction_info(u32 m, u32 v, T p) noexcept
: magn(m)
, value(v)
, pointer(p)
{
}
constexpr instruction_info(u32 m, u32 v, const T* p)
instruction_info(u32 m, u32 v, const T* p) noexcept
: magn(m)
, value(v)
, pointer(*p)
@ -72,7 +72,7 @@ class spu_decoder
};
public:
constexpr spu_decoder()
spu_decoder() noexcept
{
const std::initializer_list<instruction_info> instructions
{
@ -291,12 +291,12 @@ public:
}
}
const std::array<T, 2048>& get_table() const
const std::array<T, 2048>& get_table() const noexcept
{
return m_table;
}
T decode(u32 inst) const
T decode(u32 inst) const noexcept
{
return m_table[spu_decode(inst)];
}

View File

@ -22,12 +22,12 @@ extern atomic_t<const char*> g_progr;
extern atomic_t<u32> g_progr_ptotal;
extern atomic_t<u32> g_progr_pdone;
constexpr spu_decoder<spu_itype> s_spu_itype;
constexpr spu_decoder<spu_iname> s_spu_iname;
constexpr spu_decoder<spu_iflag> s_spu_iflag;
const spu_decoder<spu_itype> s_spu_itype;
const spu_decoder<spu_iname> s_spu_iname;
const spu_decoder<spu_iflag> s_spu_iflag;
constexpr spu_decoder<spu_interpreter_precise> g_spu_interpreter_precise;
constexpr spu_decoder<spu_interpreter_fast> g_spu_interpreter_fast;
extern const spu_decoder<spu_interpreter_precise> g_spu_interpreter_precise{};
extern const spu_decoder<spu_interpreter_fast> g_spu_interpreter_fast;
extern u64 get_timebased_time();
@ -8799,7 +8799,7 @@ std::unique_ptr<spu_recompiler_base> spu_recompiler_base::make_llvm_recompiler(u
return std::make_unique<spu_llvm_recompiler>(magn);
}
constexpr spu_decoder<spu_llvm_recompiler> g_spu_llvm_decoder;
const spu_decoder<spu_llvm_recompiler> g_spu_llvm_decoder;
decltype(&spu_llvm_recompiler::UNK) spu_llvm_recompiler::decode(u32 op)
{

View File

@ -291,7 +291,7 @@ void do_cell_atomic_128_store(u32 addr, const void* to_write);
extern thread_local u64 g_tls_fault_spu;
constexpr spu_decoder<spu_itype> s_spu_itype;
const spu_decoder<spu_itype> s_spu_itype;
namespace spu
{