From 7b3c89b8bba431683bfed6d9186f7d26914af311 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 27 Apr 2020 17:11:20 +0100 Subject: [PATCH] arm_interface: Reduce serializing of VFP/CP15 registers to essentials --- src/core/arm/arm_interface.h | 50 +++++++++--------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 40bfc5543..626bbe91e 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -266,26 +266,10 @@ private: const auto r = GetVFPReg(i); ar << r; } - for (std::size_t i = 0; i < VFPSystemRegister::VFP_SYSTEM_REGISTER_COUNT; i++) { - const auto reg = static_cast(i); - u32 r = 0; - switch (reg) { - case VFP_FPSCR: - case VFP_FPEXC: - r = GetVFPSystemReg(reg); - } - ar << r; - } - for (std::size_t i = 0; i < CP15Register::CP15_REGISTER_COUNT; i++) { - const auto reg = static_cast(i); - u32 r = 0; - switch (reg) { - case CP15_THREAD_UPRW: - case CP15_THREAD_URO: - r = GetCP15Register(reg); - } - ar << r; - } + ar << GetVFPSystemReg(VFP_FPSCR); + ar << GetVFPSystemReg(VFP_FPEXC); + ar << GetCP15Register(CP15_THREAD_UPRW); + ar << GetCP15Register(CP15_THREAD_URO); } template @@ -310,24 +294,14 @@ private: ar >> r; SetVFPReg(i, r); } - for (std::size_t i = 0; i < VFPSystemRegister::VFP_SYSTEM_REGISTER_COUNT; i++) { - ar >> r; - const auto reg = static_cast(i); - switch (reg) { - case VFP_FPSCR: - case VFP_FPEXC: - SetVFPSystemReg(reg, r); - } - } - for (std::size_t i = 0; i < CP15Register::CP15_REGISTER_COUNT; i++) { - ar >> r; - const auto reg = static_cast(i); - switch (reg) { - case CP15_THREAD_UPRW: - case CP15_THREAD_URO: - SetCP15Register(reg, r); - } - } + ar >> r; + SetVFPSystemReg(VFP_FPSCR, r); + ar >> r; + SetVFPSystemReg(VFP_FPEXC, r); + ar >> r; + SetCP15Register(CP15_THREAD_UPRW, r); + ar >> r; + SetCP15Register(CP15_THREAD_URO, r); } BOOST_SERIALIZATION_SPLIT_MEMBER()