diff --git a/rpcs3/Emu/Cell/PPUAnalyser.cpp b/rpcs3/Emu/Cell/PPUAnalyser.cpp index b0d1f98bc5..3f61973d9e 100644 --- a/rpcs3/Emu/Cell/PPUAnalyser.cpp +++ b/rpcs3/Emu/Cell/PPUAnalyser.cpp @@ -10,7 +10,7 @@ LOG_CHANNEL(ppu_validator); -constexpr ppu_decoder s_ppu_itype; +const ppu_decoder s_ppu_itype; template<> void fmt_class_string::format(std::string& out, u64 arg) diff --git a/rpcs3/Emu/Cell/PPUDisAsm.cpp b/rpcs3/Emu/Cell/PPUDisAsm.cpp index e13ee3e3bc..79a33873c3 100644 --- a/rpcs3/Emu/Cell/PPUDisAsm.cpp +++ b/rpcs3/Emu/Cell/PPUDisAsm.cpp @@ -2,7 +2,7 @@ #include "PPUDisAsm.h" #include "PPUFunction.h" -constexpr ppu_decoder s_ppu_disasm; +const ppu_decoder s_ppu_disasm; u32 PPUDisAsm::disasm(u32 pc) { diff --git a/rpcs3/Emu/Cell/PPUOpcodes.h b/rpcs3/Emu/Cell/PPUOpcodes.h index 19039404cd..5526fed181 100644 --- a/rpcs3/Emu/Cell/PPUOpcodes.h +++ b/rpcs3/Emu/Cell/PPUOpcodes.h @@ -103,7 +103,7 @@ class ppu_decoder }; // Fill lookup table - constexpr void fill_table(u32 main_op, u32 count, u32 sh, std::initializer_list entries) + void fill_table(u32 main_op, u32 count, u32 sh, std::initializer_list 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& get_table() const + const std::array& get_table() const noexcept { return m_table; } - T decode(u32 inst) const + T decode(u32 inst) const noexcept { return m_table[ppu_decode(inst)]; } diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 9f7e311f33..acee0e540e 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -105,9 +105,9 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -constexpr ppu_decoder g_ppu_interpreter_precise; -constexpr ppu_decoder g_ppu_interpreter_fast; -constexpr ppu_decoder g_ppu_itype; +const ppu_decoder g_ppu_interpreter_precise; +const ppu_decoder g_ppu_interpreter_fast; +const ppu_decoder g_ppu_itype; extern void ppu_initialize(); extern void ppu_initialize(const ppu_module& info); diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 4d2e3ffee3..6d5f581b3e 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -10,8 +10,8 @@ using namespace llvm; -constexpr ppu_decoder s_ppu_decoder; -constexpr ppu_decoder s_ppu_iname; +const ppu_decoder s_ppu_decoder; +const ppu_decoder s_ppu_iname; PPUTranslator::PPUTranslator(LLVMContext& context, Module* _module, const ppu_module& info, ExecutionEngine& engine) : cpu_translator(_module, false) diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index cb419702fa..3e314edc32 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -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 g_spu_interpreter_fast; // TODO: avoid -constexpr spu_decoder s_spu_decoder; +extern const spu_decoder g_spu_interpreter_fast{}; // TODO: avoid +const spu_decoder s_spu_decoder; extern u64 get_timebased_time(); diff --git a/rpcs3/Emu/Cell/SPUDisAsm.cpp b/rpcs3/Emu/Cell/SPUDisAsm.cpp index ffce4726d8..9413e0f20a 100644 --- a/rpcs3/Emu/Cell/SPUDisAsm.cpp +++ b/rpcs3/Emu/Cell/SPUDisAsm.cpp @@ -3,9 +3,9 @@ #include "SPUAnalyser.h" #include "SPUThread.h" -constexpr spu_decoder s_spu_disasm; -constexpr spu_decoder s_spu_itype; -constexpr spu_decoder s_spu_iflag; +const spu_decoder s_spu_disasm; +const spu_decoder s_spu_itype; +const spu_decoder s_spu_iflag; u32 SPUDisAsm::disasm(u32 pc) { diff --git a/rpcs3/Emu/Cell/SPUOpcodes.h b/rpcs3/Emu/Cell/SPUOpcodes.h index 097486b873..8e89195e30 100644 --- a/rpcs3/Emu/Cell/SPUOpcodes.h +++ b/rpcs3/Emu/Cell/SPUOpcodes.h @@ -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 instructions { @@ -291,12 +291,12 @@ public: } } - const std::array& get_table() const + const std::array& get_table() const noexcept { return m_table; } - T decode(u32 inst) const + T decode(u32 inst) const noexcept { return m_table[spu_decode(inst)]; } diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index c36861e8a9..17d64c9c77 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -22,12 +22,12 @@ extern atomic_t g_progr; extern atomic_t g_progr_ptotal; extern atomic_t g_progr_pdone; -constexpr spu_decoder s_spu_itype; -constexpr spu_decoder s_spu_iname; -constexpr spu_decoder s_spu_iflag; +const spu_decoder s_spu_itype; +const spu_decoder s_spu_iname; +const spu_decoder s_spu_iflag; -constexpr spu_decoder g_spu_interpreter_precise; -constexpr spu_decoder g_spu_interpreter_fast; +extern const spu_decoder g_spu_interpreter_precise{}; +extern const spu_decoder g_spu_interpreter_fast; extern u64 get_timebased_time(); @@ -8799,7 +8799,7 @@ std::unique_ptr spu_recompiler_base::make_llvm_recompiler(u return std::make_unique(magn); } -constexpr spu_decoder g_spu_llvm_decoder; +const spu_decoder g_spu_llvm_decoder; decltype(&spu_llvm_recompiler::UNK) spu_llvm_recompiler::decode(u32 op) { diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index a441dd55f1..3f3c4da698 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -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 s_spu_itype; +const spu_decoder s_spu_itype; namespace spu {