abi: Add Rscratch{0,1}

This commit is contained in:
Merry 2022-07-23 11:46:43 +01:00 committed by merry
parent 8b41755db0
commit 01f28facbd

View file

@ -15,4 +15,26 @@ constexpr oaknut::XReg Xhalt{27};
constexpr oaknut::XReg Xscratch0{16}, Xscratch1{17};
constexpr oaknut::WReg Wscratch0{16}, Wscratch1{17};
template<size_t bitsize>
constexpr auto Rscratch0() {
if constexpr (bitsize == 32) {
return Wscratch0;
} else if constexpr (bitsize == 64) {
return Xscratch0;
} else {
static_assert(bitsize == 32 || bitsize == 64);
}
}
template<size_t bitsize>
constexpr auto Rscratch1() {
if constexpr (bitsize == 32) {
return Wscratch1;
} else if constexpr (bitsize == 64) {
return Xscratch1;
} else {
static_assert(bitsize == 32 || bitsize == 64);
}
}
} // namespace Dynarmic::Backend::Arm64