|
|
@ -163,13 +163,24 @@ alignas(64) static constinit std::array<HostLoc, ABI_AllCallerSaveSize() - 1> AB |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
void ABI_PushCallerSaveRegistersAndAdjustStackExcept(BlockOfCode& code, const HostLoc exception) { |
|
|
void ABI_PushCallerSaveRegistersAndAdjustStackExcept(BlockOfCode& code, const HostLoc exception) { |
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
|
std::vector<HostLoc> regs; |
|
|
|
|
|
std::remove_copy(ABI_ALL_CALLER_SAVE.begin(), ABI_ALL_CALLER_SAVE.end(), std::back_inserter(regs), exception); |
|
|
|
|
|
ABI_PushRegistersAndAdjustStack(code, 0, regs); |
|
|
|
|
|
#else
|
|
|
ASSUME(size_t(exception) < 32); |
|
|
ASSUME(size_t(exception) < 32); |
|
|
ABI_PushRegistersAndAdjustStack(code, 0, ABI_CALLER_SAVED_EXCEPT_TABLE[size_t(exception)]); |
|
|
ABI_PushRegistersAndAdjustStack(code, 0, ABI_CALLER_SAVED_EXCEPT_TABLE[size_t(exception)]); |
|
|
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void ABI_PopCallerSaveRegistersAndAdjustStackExcept(BlockOfCode& code, const HostLoc exception) { |
|
|
void ABI_PopCallerSaveRegistersAndAdjustStackExcept(BlockOfCode& code, const HostLoc exception) { |
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
|
std::vector<HostLoc> regs; |
|
|
|
|
|
std::remove_copy(ABI_ALL_CALLER_SAVE.begin(), ABI_ALL_CALLER_SAVE.end(), std::back_inserter(regs), exception); |
|
|
|
|
|
ABI_PopRegistersAndAdjustStack(code, 0, regs); |
|
|
|
|
|
#else
|
|
|
ASSUME(size_t(exception) < 32); |
|
|
ASSUME(size_t(exception) < 32); |
|
|
ABI_PopRegistersAndAdjustStack(code, 0, ABI_CALLER_SAVED_EXCEPT_TABLE[size_t(exception)]); |
|
|
ABI_PopRegistersAndAdjustStack(code, 0, ABI_CALLER_SAVED_EXCEPT_TABLE[size_t(exception)]); |
|
|
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} // namespace Dynarmic::Backend::X64
|
|
|
} // namespace Dynarmic::Backend::X64
|