[JIT]: Fix compilation

This commit is contained in:
SimoZ64
2025-02-26 10:40:27 +01:00
parent 7d27351609
commit 95bf6d292b
4 changed files with 5 additions and 17 deletions

View File

@@ -301,7 +301,7 @@ void Interpreter::Exec(const u32 instr) {
lui(instr); lui(instr);
break; break;
case COP0: case COP0:
regs.cop0.decode(*this, instr); regs.cop0.decode(instr);
break; break;
case COP1: case COP1:
{ {

View File

@@ -270,7 +270,7 @@ void JIT::Emit(const u32 instr) {
lui(instr); lui(instr);
break; break;
case COP0: case COP0:
regs.cop0.decode(*this, instr); Util::panic("[JIT]: Unimplemented Cop0 decode");
break; break;
case COP1: case COP1:
{ {

View File

@@ -451,18 +451,7 @@ ExceptionCode Cop0::GetTLBExceptionCode(const TLBError error, const TLBAccessTyp
} }
} }
template <class T> void Cop0::decode(const u32 instr) {
void Cop0::decode(T &cpu, u32 instr) {
if constexpr (std::is_same_v<decltype(cpu), Interpreter &>) {
decodeInterp(instr);
} else {
Util::panic("What the fuck did you just give me?!!");
}
}
template void Cop0::decode<Interpreter>(Interpreter &, u32);
void Cop0::decodeInterp(const u32 instr) {
const u8 mask_cop = instr >> 21 & 0x1F; const u8 mask_cop = instr >> 21 & 0x1F;
const u8 mask_cop2 = instr & 0x3F; const u8 mask_cop2 = instr & 0x3F;
switch (mask_cop) { switch (mask_cop) {

View File

@@ -229,8 +229,7 @@ struct Cop0 {
TLBEntry tlb[32]{}; TLBEntry tlb[32]{};
TLBError tlbError = NONE; TLBError tlbError = NONE;
s64 openbus{}; s64 openbus{};
template <class T>
void decode(T &, u32);
[[nodiscard]] FORCE_INLINE u32 GetRandom() const { [[nodiscard]] FORCE_INLINE u32 GetRandom() const {
u32 val = rand(); u32 val = rand();
const auto wired_ = GetWired(); const auto wired_ = GetWired();
@@ -270,13 +269,13 @@ struct Cop0 {
TLBEntry *TLBTryMatch(u64 vaddr) const; TLBEntry *TLBTryMatch(u64 vaddr) const;
void HandleTLBException(u64 vaddr) const; void HandleTLBException(u64 vaddr) const;
static ExceptionCode GetTLBExceptionCode(TLBError error, TLBAccessType accessType); static ExceptionCode GetTLBExceptionCode(TLBError error, TLBAccessType accessType);
void decode(u32);
private: private:
Registers &regs; Registers &regs;
[[nodiscard]] FORCE_INLINE u32 GetWired() const { return wired & 0x3F; } [[nodiscard]] FORCE_INLINE u32 GetWired() const { return wired & 0x3F; }
[[nodiscard]] FORCE_INLINE u32 GetCount() const { return u32(u64(count >> 1)); } [[nodiscard]] FORCE_INLINE u32 GetCount() const { return u32(u64(count >> 1)); }
void decodeInterp(u32);
void mtc0(u32); void mtc0(u32);
void dmtc0(u32); void dmtc0(u32);
void mfc0(u32); void mfc0(u32);