From 334bc6b27f4533d058d0266ee1d64341225d10a2 Mon Sep 17 00:00:00 2001 From: lif Date: Sat, 1 Aug 2020 01:03:22 -0700 Subject: [PATCH] WIP --- .../Core/PowerPC/JitKvm/CachedInterpreter.h | 45 +++++++++++++++++++ Source/Core/Core/PowerPC/JitKvm/JitKvm.cpp | 4 ++ lif-build.sh | 7 +++ 3 files changed, 56 insertions(+) create mode 100644 Source/Core/Core/PowerPC/JitKvm/CachedInterpreter.h create mode 100755 lif-build.sh diff --git a/Source/Core/Core/PowerPC/JitKvm/CachedInterpreter.h b/Source/Core/Core/PowerPC/JitKvm/CachedInterpreter.h new file mode 100644 index 0000000000..a8c5ef3439 --- /dev/null +++ b/Source/Core/Core/PowerPC/JitKvm/CachedInterpreter.h @@ -0,0 +1,45 @@ +// Copyright 2014 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include + +#include "Common/CommonTypes.h" +#include "Core/PowerPC/CachedInterpreter/InterpreterBlockCache.h" +#include "Core/PowerPC/JitCommon/JitBase.h" +#include "Core/PowerPC/PPCAnalyst.h" + +class CachedInterpreter : public JitBase +{ +public: + CachedInterpreter(); + ~CachedInterpreter(); + + void Init() override; + void Shutdown() override; + + bool HandleFault(uintptr_t access_address, SContext* ctx) override { return false; } + void ClearCache() override; + + void Run() override; + void SingleStep() override; + + void Jit(u32 address) override; + + JitBaseBlockCache* GetBlockCache() override { return &m_block_cache; } + const char* GetName() const override { return "Cached Interpreter"; } + const CommonAsmRoutinesBase* GetAsmRoutines() override { return nullptr; } + +private: + struct Instruction; + + u8* GetCodePtr(); + void ExecuteOneBlock(); + + bool HandleFunctionHooking(u32 address); + + BlockCache m_block_cache{*this}; + std::vector m_code; +}; diff --git a/Source/Core/Core/PowerPC/JitKvm/JitKvm.cpp b/Source/Core/Core/PowerPC/JitKvm/JitKvm.cpp index 25c78a342b..f5c70eb9b6 100644 --- a/Source/Core/Core/PowerPC/JitKvm/JitKvm.cpp +++ b/Source/Core/Core/PowerPC/JitKvm/JitKvm.cpp @@ -15,6 +15,10 @@ #include "Core/PowerPC/PPCAnalyst.h" #include "Core/PowerPC/PowerPC.h" +#include +#include +#include + struct JitKvm::Instruction { using CommonCallback = void (*)(UGeckoInstruction); diff --git a/lif-build.sh b/lif-build.sh new file mode 100755 index 0000000000..3fd07da915 --- /dev/null +++ b/lif-build.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -exo pipefail +#cmake -BBuild -H. -DENABLE_GENERIC=ON -DLINUX_LOCAL_DEV=true -DCMAKE_EXPORT_COMPILE_COMMANDS=ON +cmake -BBuild -H. -DLINUX_LOCAL_DEV=true -DCMAKE_EXPORT_COMPILE_COMMANDS=ON +make -CBuild -j`nproc` +cp -r Data/Sys Build/Binaries/ +touch Build/Binaries/portable.txt