diff --git a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp index 4dda28cb55..9f37308fc7 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp @@ -4748,7 +4748,7 @@ CompiledCodeFragment RecompilationEngine::GetCompiledCodeFragment(u32 address) { return nullptr; } -void ReleaseCompiledCodeFragment(CompiledCodeFragment compiled_code_fragment) { +void RecompilationEngine::ReleaseCompiledCodeFragment(CompiledCodeFragment compiled_code_fragment) { } @@ -4778,7 +4778,6 @@ void Tracer::Trace(BranchType branch_type, u32 address) { ExecutionTrace * execution_trace = nullptr; BlockId block_id; int function; - int start; block_id.address = address; block_id.type = branch_type; @@ -4810,13 +4809,11 @@ void Tracer::Trace(BranchType branch_type, u32 address) { function = m_stack.back(); m_stack.pop_back(); - start = function; - execution_trace = new ExecutionTrace(); execution_trace->function_address = m_trace[function].address; execution_trace->type = ExecutionTrace::Linear; - execution_trace->blocks.insert(execution_trace->blocks.begin(), m_trace.begin() + start, m_trace.end()); - m_trace.erase(m_trace.begin() + start + 1, m_trace.end()); + execution_trace->blocks.insert(execution_trace->blocks.begin(), m_trace.begin() + function, m_trace.end()); + m_trace.erase(m_trace.begin() + function + 1, m_trace.end()); break; case None: break; @@ -4908,7 +4905,7 @@ u8 ppu_recompiler_llvm::ExecutionEngine::DecodeMemory(const u32 address) { return ret; } -BranchType GetBranchTypeFromInstruction(u32 instruction) { +BranchType ppu_recompiler_llvm::GetBranchTypeFromInstruction(u32 instruction) { auto type = BranchType::None; auto field1 = instruction >> 26; auto lk = instruction & 1; diff --git a/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp b/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp index d601503e1b..2b637c4b4c 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompilerTests.cpp @@ -11,9 +11,10 @@ //#define PPU_LLVM_RECOMPILER_UNIT_TESTS 1 using namespace llvm; +using namespace ppu_recompiler_llvm; #define VERIFY_INSTRUCTION_AGAINST_INTERPRETER(fn, tc, input, ...) \ -VerifyInstructionAgainstInterpreter(fmt::Format("%s.%d", #fn, tc).c_str(), &PPULLVMRecompiler::fn, &PPUInterpreter::fn, input, __VA_ARGS__) +VerifyInstructionAgainstInterpreter(fmt::Format("%s.%d", #fn, tc).c_str(), &Compiler::fn, &PPUInterpreter::fn, input, __VA_ARGS__) #define VERIFY_INSTRUCTION_AGAINST_INTERPRETER_USING_RANDOM_INPUT(fn, s, n, ...) { \ PPUState input; \ @@ -24,7 +25,7 @@ VerifyInstructionAgainstInterpreter(fmt::Format("%s.%d", #fn, tc).c_str(), &PPUL } /// Register state of a PPU -struct PPUState { + struct ppu_recompiler_llvm::PPUState { /// Floating point registers PPCdouble FPR[32]; @@ -201,8 +202,8 @@ static PPUThread * s_ppu_state = nullptr; static PPUInterpreter * s_interpreter = nullptr; #endif // PPU_LLVM_RECOMPILER_UNIT_TESTS -template -void PPULLVMRecompiler::VerifyInstructionAgainstInterpreter(const char * name, PPULLVMRecompilerFn recomp_fn, PPUInterpreterFn interp_fn, PPUState & input_state, Args... args) { +template +void Compiler::VerifyInstructionAgainstInterpreter(const char * name, CompilerFn recomp_fn, PPUInterpreterFn interp_fn, PPUState & input_state, Args... args) { #ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS auto test_case = [&]() { (this->*recomp_fn)(args...); @@ -232,7 +233,7 @@ void PPULLVMRecompiler::VerifyInstructionAgainstInterpreter(const char * name, P #endif // PPU_LLVM_RECOMPILER_UNIT_TESTS } -void PPULLVMRecompiler::RunTest(const char * name, std::function test_case, std::function input, std::function check_result) { +void Compiler::RunTest(const char * name, std::function test_case, std::function input, std::function check_result) { #ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS // Create the unit test function m_current_function = (Function *)m_module->getOrInsertFunction(name, m_ir_builder->getVoidTy(), @@ -311,7 +312,7 @@ void PPULLVMRecompiler::RunTest(const char * name, std::function test_ca #endif // PPU_LLVM_RECOMPILER_UNIT_TESTS } -void PPULLVMRecompiler::RunAllTests(PPUThread * ppu_state, PPUInterpreter * interpreter) { +void Compiler::RunAllTests(PPUThread * ppu_state, PPUInterpreter * interpreter) { #ifdef PPU_LLVM_RECOMPILER_UNIT_TESTS s_ppu_state = ppu_state; s_interpreter = interpreter; diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index f9d01a75a7..df7ce2740b 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -112,7 +112,7 @@ void PPUThread::DoRun() case 2: if (!m_dec) { - m_dec = new PPULLVMEmulator(*this); + m_dec = new ppu_recompiler_llvm::ExecutionEngine(*this); } break;