/* This file is part of the dynarmic project. * Copyright (c) 2016 MerryMage * This software may be used and distributed according to the terms of the GNU * General Public License version 2 or any later version. */ #include "backend_x64/hostloc.h" namespace Dynarmic { namespace BackendX64 { Xbyak::Reg64 HostLocToReg64(HostLoc loc) { ASSERT(HostLocIsGPR(loc)); return Xbyak::Reg64(static_cast(loc)); } Xbyak::Xmm HostLocToXmm(HostLoc loc) { ASSERT(HostLocIsXMM(loc)); return Xbyak::Xmm(static_cast(loc) - static_cast(HostLoc::XMM0)); } Xbyak::Address SpillToOpArg(HostLoc loc) { using namespace Xbyak::util; static_assert(std::is_same::value, "Spill must be u64"); ASSERT(HostLocIsSpill(loc)); size_t i = static_cast(loc) - static_cast(HostLoc::FirstSpill); return qword[r15 + offsetof(JitState, Spill) + i * sizeof(u64)]; } } // namespace BackendX64 } // namespace Dynarmic