abi: Add Rscratch{0,1}
This commit is contained in:
parent
8b41755db0
commit
01f28facbd
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue