1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Implemented fallback to PPU Interpreter

This commit is contained in:
S Gopal Rajagopal 2014-09-15 19:58:38 +05:30
parent aa614e83f2
commit 6135b450c2
3 changed files with 1044 additions and 2074 deletions

View File

@ -1,6 +1,12 @@
#pragma once
#include "Emu/Cell/PPUOpcodes.h"
#include "Emu/SysCalls/SysCalls.h"
#include "rpcs3/Ini.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Static.h"
#include "Emu/SysCalls/Modules.h"
#include "Emu/Memory/Memory.h"
#include <stdint.h>
#ifdef _MSC_VER
@ -50,6 +56,7 @@ u64 rotr64(const u64 x, const u8 n) { return (x >> n) | (x << (64 - n)); }
class PPUInterpreter : public PPUOpcodes
{
friend class PPULLVMRecompiler;
private:
PPUThread& CPU;

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
#include "Emu/Cell/PPUDecoder.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/PPUInterpreter.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
@ -448,6 +449,9 @@ private:
/// Module to which all generated code is output to
llvm::Module * m_module;
/// Global variable in m_module that corresponds to m_ppu.GPR
llvm::GlobalVariable * m_pc;
/// Global variable in m_module that corresponds to m_ppu.GPR
llvm::GlobalVariable * m_gpr;
@ -469,6 +473,9 @@ private:
/// Disassembler
LLVMDisasmContextRef m_disassembler;
/// PPU Interpreter
PPUInterpreter m_interpreter;
/// Get a bit
llvm::Value * GetBit(llvm::Value * val, u32 n);
@ -550,6 +557,34 @@ private:
/// Set VR to the specified value
void SetVr(u32 vr, llvm::Value * val_x128);
/// Call a member function with no arguments
template<class F, class C>
void ThisCall0(const char * name, F function, C * this_p);
/// Call a member function with one argument
template<class F, class C, class T1>
void ThisCall1(const char * name, F function, C * this_p, T1 arg1);
/// Call a member function with two arguments
template<class F, class C, class T1, class T2>
void ThisCall2(const char * name, F function, C * this_p, T1 arg1, T2 arg2);
/// Call a member function with three arguments
template<class F, class C, class T1, class T2, class T3>
void ThisCall3(const char * name, F function, C * this_p, T1 arg1, T2 arg2, T3 arg3);
/// Call a member function with four arguments
template<class F, class C, class T1, class T2, class T3, class T4>
void ThisCall4(const char * name, F function, C * this_p, T1 arg1, T2 arg2, T3 arg3, T4 arg4);
/// Call a member function with five arguments
template<class F, class C, class T1, class T2, class T3, class T4, class T5>
void ThisCall5(const char * name, F function, C * this_p, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
/// Call a member function with six arguments
template<class F, class C, class T1, class T2, class T3, class T4, class T5, class T6>
void ThisCall6(const char * name, F function, C * this_p, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
/// Excute a test
void RunTest(const char * name, std::function<void()> test_case, std::function<void()> input, std::function<bool(std::string & msg)> check_result);