mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
softjit: Cleanup, add other arch types to regcache.
This commit is contained in:
parent
c1882fa1c0
commit
4703b6cb56
2 changed files with 17 additions and 16 deletions
|
@ -645,9 +645,12 @@ void PixelRegCache::Reset(bool validate) {
|
|||
regs.clear();
|
||||
}
|
||||
|
||||
void PixelRegCache::Add(PixelRegCache::Reg r, PixelRegCache::Purpose p) {
|
||||
RegStatus *status = FindReg(r, (p & FLAG_GEN) != 0);
|
||||
_assert_msg_(status == nullptr, "softjit Add() reg duplicate (%04X)", p);
|
||||
void PixelRegCache::Add(Reg r, Purpose p) {
|
||||
for (auto ® : regs) {
|
||||
if (reg.reg == r && (reg.purpose & FLAG_GEN) == (p & FLAG_GEN)) {
|
||||
_assert_msg_(false, "softjit Add() reg duplicate (%04X)", p);
|
||||
}
|
||||
}
|
||||
_assert_msg_(r != REG_INVALID_VALUE, "softjit Add() invalid reg (%04X)", p);
|
||||
|
||||
RegStatus newStatus;
|
||||
|
@ -696,7 +699,7 @@ void PixelRegCache::Unlock(Reg &r, Purpose p) {
|
|||
_assert_msg_(false, "softjit Unlock() reg that isn't there (%04X)", p);
|
||||
}
|
||||
|
||||
bool PixelRegCache::Has(PixelRegCache::Purpose p) {
|
||||
bool PixelRegCache::Has(Purpose p) {
|
||||
for (auto ® : regs) {
|
||||
if (reg.purpose == p) {
|
||||
return true;
|
||||
|
@ -824,14 +827,4 @@ PixelRegCache::RegStatus *PixelRegCache::FindReg(Reg r, Purpose p) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
PixelRegCache::RegStatus *PixelRegCache::FindReg(Reg r, bool isGen) {
|
||||
for (auto ® : regs) {
|
||||
if (reg.reg == r && (reg.purpose & FLAG_GEN) == (isGen ? FLAG_GEN : 0)) {
|
||||
return ®
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -100,9 +100,18 @@ struct PixelRegCache {
|
|||
GEN_INVALID = 0xFFFF,
|
||||
};
|
||||
|
||||
#if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)
|
||||
#if PPSSPP_ARCH(ARM)
|
||||
typedef ArmGen::ARMReg Reg;
|
||||
static constexpr Reg REG_INVALID_VALUE = ArmGen::INVALID_REG;
|
||||
#elif PPSSPP_ARCH(ARM64)
|
||||
typedef Arm64Gen::ARM64Reg Reg;
|
||||
static constexpr Reg REG_INVALID_VALUE = Arm64Gen::INVALID_REG;
|
||||
#elif PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)
|
||||
typedef Gen::X64Reg Reg;
|
||||
static constexpr Reg REG_INVALID_VALUE = Gen::INVALID_REG;
|
||||
#elif PPSSPP_ARCH(MIPS)
|
||||
typedef MIPSGen::MIPSReg Reg;
|
||||
static constexpr Reg REG_INVALID_VALUE = MIPSGen::INVALID_REG;
|
||||
#else
|
||||
typedef int Reg;
|
||||
static constexpr Reg REG_INVALID_VALUE = -1;
|
||||
|
@ -131,7 +140,6 @@ struct PixelRegCache {
|
|||
|
||||
private:
|
||||
RegStatus *FindReg(Reg r, Purpose p);
|
||||
RegStatus *FindReg(Reg r, bool isGen);
|
||||
|
||||
std::vector<RegStatus> regs;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue