diff --git a/rpcs3/Emu/Cell/PPUAnalyser.cpp b/rpcs3/Emu/Cell/PPUAnalyser.cpp index 56de9f7374..5c57f380ae 100644 --- a/rpcs3/Emu/Cell/PPUAnalyser.cpp +++ b/rpcs3/Emu/Cell/PPUAnalyser.cpp @@ -36,19 +36,6 @@ void fmt_class_string>::format(std::string& out, u64 arg) format_bitset(out, arg, "[", ",", "]", &fmt_class_string::format); } -template <> -void fmt_class_string::format(std::string& out, u64 arg) -{ - // Decode instruction name from the enum value - for (u32 i = 0; i < 10; i++) - { - if (u64 value = (arg >> (54 - i * 6)) & 0x3f) - { - out += static_cast(value + 0x20); - } - } -} - void ppu_module::validate(u32 reloc) { // Load custom PRX configuration if available diff --git a/rpcs3/Emu/Cell/PPUAnalyser.h b/rpcs3/Emu/Cell/PPUAnalyser.h index 3877f3a690..b83a1e0b79 100644 --- a/rpcs3/Emu/Cell/PPUAnalyser.h +++ b/rpcs3/Emu/Cell/PPUAnalyser.h @@ -554,18 +554,9 @@ struct ppu_itype } }; -// Encode instruction name: 6 bits per character (0x20..0x5f), max 10 -static constexpr u64 ppu_iname_encode(const char* ptr, u64 value = 0) -{ - return *ptr == '\0' ? value : ppu_iname_encode(ptr + 1, (*ptr - 0x20) | (value << 6)); -} - struct ppu_iname { -#define NAME(x) x = ppu_iname_encode(#x), - - enum type : u64 - { +#define NAME(x) static constexpr const char& x = *#x; NAME(UNK) NAME(MFVSCR) NAME(MTVSCR) @@ -946,15 +937,7 @@ struct ppu_iname NAME(FCTID) NAME(FCTIDZ) NAME(FCFID) - }; - #undef NAME - - // Enable address-of operator for ppu_decoder<> - friend constexpr type operator &(type value) - { - return value; - } }; // PPU Analyser Context diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 666932a0e8..90cabcb4ea 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -10,6 +10,7 @@ using namespace llvm; constexpr ppu_decoder s_ppu_decoder; +constexpr ppu_decoder s_ppu_iname; PPUTranslator::PPUTranslator(LLVMContext& context, Module* module, const ppu_module& info, ExecutionEngine& engine) : cpu_translator(module, false) @@ -200,7 +201,7 @@ Function* PPUTranslator::Translate(const ppu_function& info) if (m_rel) { // This is very bad. m_rel is normally set to nullptr after a relocation is handled (so it wasn't) - ppu_log.error("LLVM: [0x%x] Unsupported relocation(%u) in '%s' (opcode=0x%x). Please report.", rel_found->first, m_rel->type, m_info.name, op); + ppu_log.error("LLVM: [0x%x] Unsupported relocation(%u) in '%s' (opcode=0x%x '%s'). Please report.", rel_found->first, m_rel->type, m_info.name, op, s_ppu_iname.decode(op)); return nullptr; } }