Browse Source

[dynarmic] fix sporadic crashes on high reg pressure

pull/128/head
lizzie 8 months ago
committed by crueter
parent
commit
e422fba453
  1. 7
      externals/dynarmic/src/dynarmic/backend/x64/hostloc.h
  2. 2
      externals/dynarmic/src/dynarmic/backend/x64/reg_alloc.cpp

7
externals/dynarmic/src/dynarmic/backend/x64/hostloc.h

@ -131,9 +131,12 @@ const HostLocList any_gpr = {
}; };
// XMM0 is reserved for use by instructions that implicitly use it as an argument // XMM0 is reserved for use by instructions that implicitly use it as an argument
// XMM1 is used by 128 mem accessors
// XMM2 is also used by that (and other stuff)
// Basically dont use either XMM0, XMM1 or XMM2 ever; they're left for the regsel
const HostLocList any_xmm = { const HostLocList any_xmm = {
HostLoc::XMM1,
HostLoc::XMM2,
//HostLoc::XMM1,
//HostLoc::XMM2,
HostLoc::XMM3, HostLoc::XMM3,
HostLoc::XMM4, HostLoc::XMM4,
HostLoc::XMM5, HostLoc::XMM5,

2
externals/dynarmic/src/dynarmic/backend/x64/reg_alloc.cpp

@ -573,7 +573,7 @@ HostLoc RegAlloc::FindFreeSpill(bool is_xmm) const noexcept {
if (!is_xmm) { if (!is_xmm) {
// TODO(lizzie): Using lower (xmm0 and such) registers results in issues/crashes - INVESTIGATE WHY // TODO(lizzie): Using lower (xmm0 and such) registers results in issues/crashes - INVESTIGATE WHY
// Intel recommends to spill GPR onto XMM registers IF POSSIBLE // Intel recommends to spill GPR onto XMM registers IF POSSIBLE
for (size_t i = size_t(HostLoc::XMM15); i >= size_t(HostLoc::XMM0); --i)
for (auto const i : any_xmm)
if (const auto loc = HostLoc(i); LocInfo(loc).IsEmpty()) if (const auto loc = HostLoc(i); LocInfo(loc).IsEmpty())
return loc; return loc;
} }

Loading…
Cancel
Save