mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-07 09:38:18 +00:00
arm64: Only clobber HI and LO together.
We can't clobber LO if HI is still needed. Fixes a crash in Trails in the Sky on new game (due to a mfhi getting the wrong result.)
This commit is contained in:
parent
6c31612b1d
commit
387ebf3ddd
@ -236,8 +236,15 @@ ARM64Reg Arm64RegCache::FindBestToSpill(bool unusedOnly, bool *clobbered) {
|
||||
|
||||
// Awesome, a clobbered reg. Let's use it.
|
||||
if (MIPSAnalyst::IsRegisterClobbered(ar[reg].mipsReg, compilerPC_, UNUSED_LOOKAHEAD_OPS)) {
|
||||
*clobbered = true;
|
||||
return reg;
|
||||
bool canClobber = true;
|
||||
// HI is stored inside the LO reg. They both have to clobber at the same time.
|
||||
if (ar[reg].mipsReg == MIPS_REG_LO) {
|
||||
canClobber = MIPSAnalyst::IsRegisterClobbered(MIPS_REG_HI, compilerPC_, UNUSED_LOOKAHEAD_OPS);
|
||||
}
|
||||
if (canClobber) {
|
||||
*clobbered = true;
|
||||
return reg;
|
||||
}
|
||||
}
|
||||
|
||||
// Not awesome. A used reg. Let's try to avoid spilling.
|
||||
|
Loading…
x
Reference in New Issue
Block a user