backend/x64: Move spill from JitState onto the stack

This commit is contained in:
MerryMage 2021-05-04 14:15:35 +01:00
parent f8d8ea0deb
commit ddbc50cee0
11 changed files with 52 additions and 40 deletions

View file

@ -5,7 +5,9 @@
#include <xbyak.h>
#include "backend/x64/abi.h"
#include "backend/x64/hostloc.h"
#include "backend/x64/stack_layout.h"
namespace Dynarmic::Backend::X64 {
@ -19,4 +21,14 @@ Xbyak::Xmm HostLocToXmm(HostLoc loc) {
return Xbyak::Xmm(static_cast<int>(loc) - static_cast<int>(HostLoc::XMM0));
}
Xbyak::Address SpillToOpArg(HostLoc loc) {
ASSERT(HostLocIsSpill(loc));
size_t i = static_cast<size_t>(loc) - static_cast<size_t>(HostLoc::FirstSpill);
ASSERT_MSG(i < SpillCount, "Spill index greater than number of available spill locations");
using namespace Xbyak::util;
return xword[rsp + ABI_SHADOW_SPACE + offsetof(StackLayout, spill) + i * sizeof(u64) * 2];
}
} // namespace Dynarmic::Backend::X64