mirror of
https://github.com/azahar-emu/dynarmic
synced 2025-11-07 23:50:00 +01:00
abi: Add Rscratch{0,1}
This commit is contained in:
parent
8b41755db0
commit
01f28facbd
@ -15,4 +15,26 @@ constexpr oaknut::XReg Xhalt{27};
|
|||||||
constexpr oaknut::XReg Xscratch0{16}, Xscratch1{17};
|
constexpr oaknut::XReg Xscratch0{16}, Xscratch1{17};
|
||||||
constexpr oaknut::WReg Wscratch0{16}, Wscratch1{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
|
} // namespace Dynarmic::Backend::Arm64
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user