From 8d19483b7e3837bc64a7190093f4cfab98e4d70d Mon Sep 17 00:00:00 2001 From: SachinVin <26602104+SachinVin@users.noreply.github.com> Date: Mon, 10 Apr 2023 00:33:48 +0530 Subject: [PATCH] externals: bump dynarmic to 6.4.6 (#6423) --- externals/dynarmic | 2 +- src/core/arm/dynarmic/arm_dynarmic.cpp | 48 +++++++++++++++----------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/externals/dynarmic b/externals/dynarmic index b3a92ab54..c08c5a936 160000 --- a/externals/dynarmic +++ b/externals/dynarmic @@ -1 +1 @@ -Subproject commit b3a92ab54dadd26a0c2a87d2677b80249d2e1a5a +Subproject commit c08c5a9362bb224dc343c2f616c24df027dfdf13 diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index eea63f07f..c43395296 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include "common/assert.h" #include "common/microprofile.h" @@ -26,36 +25,36 @@ public: ~DynarmicThreadContext() override = default; void Reset() override { - ctx.Regs() = {}; - ctx.SetCpsr(0); - ctx.ExtRegs() = {}; - ctx.SetFpscr(0); + regs = {}; + ext_regs = {}; + cpsr = 0; + fpscr = 0; fpexc = 0; } u32 GetCpuRegister(std::size_t index) const override { - return ctx.Regs()[index]; + return regs[index]; } void SetCpuRegister(std::size_t index, u32 value) override { - ctx.Regs()[index] = value; + regs[index] = value; } u32 GetCpsr() const override { - return ctx.Cpsr(); + return cpsr; } void SetCpsr(u32 value) override { - ctx.SetCpsr(value); + cpsr = value; } u32 GetFpuRegister(std::size_t index) const override { - return ctx.ExtRegs()[index]; + return ext_regs[index]; } void SetFpuRegister(std::size_t index, u32 value) override { - ctx.ExtRegs()[index] = value; + ext_regs[index] = value; } u32 GetFpscr() const override { - return ctx.Fpscr(); + return fpscr; } void SetFpscr(u32 value) override { - ctx.SetFpscr(value); + fpscr = value; } u32 GetFpexc() const override { return fpexc; @@ -67,7 +66,10 @@ public: private: friend class ARM_Dynarmic; - Dynarmic::A32::Context ctx; + std::array regs; + std::array ext_regs; + u32 cpsr; + u32 fpscr; u32 fpexc; }; @@ -291,7 +293,10 @@ void ARM_Dynarmic::SaveContext(const std::unique_ptr& arg) { DynarmicThreadContext* ctx = dynamic_cast(arg.get()); ASSERT(ctx); - jit->SaveContext(ctx->ctx); + ctx->regs = jit->Regs(); + ctx->ext_regs = jit->ExtRegs(); + ctx->cpsr = jit->Cpsr(); + ctx->fpscr = jit->Fpscr(); ctx->fpexc = fpexc; } @@ -299,7 +304,10 @@ void ARM_Dynarmic::LoadContext(const std::unique_ptr& arg) { const DynarmicThreadContext* ctx = dynamic_cast(arg.get()); ASSERT(ctx); - jit->LoadContext(ctx->ctx); + jit->Regs() = ctx->regs; + jit->ExtRegs() = ctx->ext_regs; + jit->SetCpsr(ctx->cpsr); + jit->SetFpscr(ctx->fpscr); fpexc = ctx->fpexc; } @@ -329,21 +337,21 @@ std::shared_ptr ARM_Dynarmic::GetPageTable() const { void ARM_Dynarmic::SetPageTable(const std::shared_ptr& page_table) { current_page_table = page_table; - Dynarmic::A32::Context ctx{}; + auto ctx{NewContext()}; if (jit) { - jit->SaveContext(ctx); + SaveContext(ctx); } auto iter = jits.find(current_page_table); if (iter != jits.end()) { jit = iter->second.get(); - jit->LoadContext(ctx); + LoadContext(ctx); return; } auto new_jit = MakeJit(); jit = new_jit.get(); - jit->LoadContext(ctx); + LoadContext(ctx); jits.emplace(current_page_table, std::move(new_jit)); }