mirror of
https://github.com/azahar-emu/dynarmic
synced 2025-11-07 15:40:00 +01:00
reg_alloc: Reimplement ScratchHostLocReg
This commit is contained in:
parent
640faab8a7
commit
1ee4c07f14
@ -201,18 +201,9 @@ HostLoc RegAlloc::UseScratchHostLocReg(IR::Inst* use_inst, HostLocList desired_l
|
|||||||
}
|
}
|
||||||
|
|
||||||
HostLoc RegAlloc::ScratchHostLocReg(HostLocList desired_locations) {
|
HostLoc RegAlloc::ScratchHostLocReg(HostLocList desired_locations) {
|
||||||
DEBUG_ASSERT(std::all_of(desired_locations.begin(), desired_locations.end(), HostLocIsRegister));
|
|
||||||
|
|
||||||
HostLoc location = SelectARegister(desired_locations);
|
HostLoc location = SelectARegister(desired_locations);
|
||||||
|
MoveOutOfTheWay(location);
|
||||||
if (IsRegisterOccupied(location)) {
|
|
||||||
SpillRegister(location);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update state
|
|
||||||
LocInfo(location).Lock();
|
LocInfo(location).Lock();
|
||||||
|
|
||||||
DEBUG_ASSERT(LocInfo(location).IsScratch());
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user