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

Address review comments

This commit is contained in:
kd-11 2024-08-08 02:37:46 +03:00 committed by kd-11
parent fa7e0e4758
commit 1200bbe7cc
7 changed files with 21 additions and 31 deletions

View File

@ -21,21 +21,6 @@ LOG_CHANNEL(jit_log, "JIT");
namespace aarch64
{
// FIXME: This really should be part of fmt
static std::string join_strings(const std::vector<std::string>& v, const char* delim)
{
std::string result;
for (const auto& s : v)
{
if (!result.empty())
{
result += delim;
}
result += s;
}
return result;
}
using instruction_info_t = GHC_frame_preservation_pass::instruction_info_t;
using function_info_t = GHC_frame_preservation_pass::function_info_t;
@ -414,7 +399,7 @@ namespace aarch64
}
// Emit the branch
llvm_asm(irb, exit_fn, args, join_strings(constraints, ","), f.getContext());
llvm_asm(irb, exit_fn, args, fmt::merge(constraints, ","), f.getContext());
// Delete original call instruction
bit = ci->eraseFromParent();

View File

@ -4,6 +4,18 @@
namespace rpcs3
{
#if defined(ARCH_x64)
union hypervisor_context_t
{
u64 regs[1];
struct
{
u64 rsp;
} x86;
};
static_assert(sizeof(hypervisor_context_t) == 8);
#else
union alignas(16) hypervisor_context_t
{
u64 regs[16];
@ -29,12 +41,6 @@ namespace rpcs3
// x0-x17 unused
} aarch64;
struct
{
u64 sp;
// Other regs unused
} x86;
};
#endif
}

View File

@ -164,9 +164,6 @@ public:
using cpu_thread::operator=;
// Hypervisor context data
alignas(16) rpcs3::hypervisor_context_t hv_ctx; // HV context for gate enter exit. Keep at a low struct offset.
u64 gpr[32] = {}; // General-Purpose Registers
f64 fpr[32] = {}; // Floating Point Registers
v128 vr[32] = {}; // Vector Registers
@ -307,7 +304,8 @@ public:
// Thread name
atomic_ptr<std::string> ppu_tname;
u64 saved_native_sp = 0; // Host thread's stack pointer for emulated longjmp
// Hypervisor context data
rpcs3::hypervisor_context_t hv_ctx; // HV context for gate enter exit. Keep at a low struct offset.
u64 last_ftsc = 0;
u64 last_ftime = 0;

View File

@ -779,7 +779,7 @@ public:
u64 block_recover = 0;
u64 block_failure = 0;
alignas(16) rpcs3::hypervisor_context_t hv_ctx; // NOTE: The offset within the class must be within the first 1MiB
rpcs3::hypervisor_context_t hv_ctx; // NOTE: The offset within the class must be within the first 1MiB
u64 ftx = 0; // Failed transactions
u64 stx = 0; // Succeeded transactions (pure counters)

View File

@ -536,6 +536,7 @@
<ClInclude Include="Emu\Cell\Modules\libfs_utility_init.h" />
<ClInclude Include="Emu\Cell\Modules\sys_crashdump.h" />
<ClInclude Include="Emu\config_mode.h" />
<ClInclude Include="Emu\CPU\Hypervisor.h" />
<ClInclude Include="Emu\CPU\sse2neon.h" />
<ClInclude Include="Emu\games_config.h" />
<ClInclude Include="Emu\Io\Buzz.h" />

View File

@ -2569,8 +2569,8 @@
<ClInclude Include="Emu\RSX\NV47\FW\GRAPH_backend.h">
<Filter>Emu\GPU\RSX\NV47\FW</Filter>
</ClInclude>
<ClInclude Include="Emu\Io\mouse_config.h">
<Filter>Emu\Io</Filter>
<ClInclude Include="Emu\CPU\Hypervisor.h">
<Filter>Emu\CPU</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>