register constant check optimization + disable branch likely's for now

This commit is contained in:
irisz64
2025-07-07 10:36:16 +02:00
parent dd6c28c9d9
commit 6e69a37a62
3 changed files with 75 additions and 44 deletions

View File

@@ -14,17 +14,41 @@ struct Registers {
[[nodiscard]] bool IsRegConstant(const u32 index) const {
if (index == 0)
return true;
return gprIsConstant[index];
return regIsConstant & (1 << index);
}
[[nodiscard]] bool IsRegConstant(const u32 first, const u32 second) const {
return IsRegConstant(first) && IsRegConstant(second);
}
bool GetLOConstant() {
return regIsConstant & (1ull << 32);
}
bool GetHIConstant() {
return regIsConstant & (1ull << 33);
}
void SetLOConstant() {
regIsConstant |= (1ull << 32);
}
void SetHIConstant() {
regIsConstant |= (1ull << 33);
}
void UnsetLOConstant() {
regIsConstant &= ~(1ull << 32);
}
void UnsetHIConstant() {
regIsConstant &= ~(1ull << 33);
}
JIT *jit = nullptr;
std::array<bool, 32> gprIsConstant{};
bool loIsConstant = false, hiIsConstant = false;
uint64_t regIsConstant = 0;
Cop0 cop0;
Cop1 cop1;
s64 oldPC{}, pc{}, nextPC{};