diff --git a/Source/Core/Core/Src/DSP/DSPEmitter.cpp b/Source/Core/Core/Src/DSP/DSPEmitter.cpp index d42756dac4..2ce441bf31 100644 --- a/Source/Core/Core/Src/DSP/DSPEmitter.cpp +++ b/Source/Core/Core/Src/DSP/DSPEmitter.cpp @@ -80,7 +80,7 @@ void DSPEmitter::ClearIRAM() void DSPEmitter::ClearIRAMandDSPJITCodespaceReset() { - ResetCodePtr(); + ClearCodeSpace(); CompileDispatcher(); stubEntryPoint = CompileStub(); diff --git a/Source/Core/Core/Src/DSP/DSPEmitter.h b/Source/Core/Core/Src/DSP/DSPEmitter.h index 963bd0393d..7fcb9a74f6 100644 --- a/Source/Core/Core/Src/DSP/DSPEmitter.h +++ b/Source/Core/Core/Src/DSP/DSPEmitter.h @@ -82,7 +82,6 @@ public: void popExtValueToReg(); void pushExtValueFromMem(u16 dreg, u16 sreg); void pushExtValueFromMem2(u16 dreg, u16 sreg); - void zeroWriteBackLog(const UDSPInstruction opc); // Ext commands void l(const UDSPInstruction opc); diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp index 6cf38dacf1..0b75431de6 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitArithmetic.cpp @@ -957,7 +957,6 @@ void DSPEmitter::inc(const UDSPInstruction opc) else { set_long_acc(dreg); - Update_SR_Register64_Carry(EAX, tmp1);//why is this still done? } gpr.putXReg(tmp1); #else diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp index ce607c67c9..b33495ec7c 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitBranch.cpp @@ -41,24 +41,19 @@ static void ReJitConditional(const UDSPInstruction opc, DSPEmitter& emitter) case 0x0: // GE - Greater Equal case 0x1: // L - Less emitter.MOV(16, R(EDX), R(EAX)); - emitter.SHR(16, R(EDX), Imm8(3)); //SR_SIGN flag - emitter.SHR(16, R(EAX), Imm8(1)); //SR_OVERFLOW flag + emitter.SHL(16, R(EDX), Imm8(2)); emitter.XOR(16, R(EAX), R(EDX)); - emitter.TEST(16, R(EAX), Imm16(1)); + emitter.TEST(16, R(EAX), Imm16(8)); break; case 0x2: // G - Greater case 0x3: // LE - Less Equal emitter.MOV(16, R(EDX), R(EAX)); emitter.MOV(16, R(ECX), R(EAX)); - emitter.SHR(16, R(EDX), Imm8(3)); //SR_SIGN flag - emitter.SHR(16, R(EAX), Imm8(1)); //SR_OVERFLOW flag + emitter.SHL(16, R(EDX), Imm8(2)); emitter.XOR(16, R(EAX), R(EDX)); - emitter.NOT(16, R(EAX)); - emitter.SHR(16, R(ECX), Imm8(2)); //SR_ARITH_ZERO - emitter.NOT(16, R(ECX)); - emitter.AND(16, R(EAX), R(ECX)); - emitter.NOT(16, R(EAX)); - emitter.TEST(16, R(EAX), Imm16(1)); + emitter.SHL(16, R(ECX), Imm8(1)); + emitter.OR(16, R(EAX), R(ECX)); + emitter.TEST(16, R(EAX), Imm16(8)); break; case 0x4: // NZ - Not Zero case 0x5: // Z - Zero @@ -76,14 +71,13 @@ static void ReJitConditional(const UDSPInstruction opc, DSPEmitter& emitter) case 0xb: // ? emitter.MOV(16, R(EDX), R(EAX)); emitter.MOV(16, R(ECX), R(EAX)); - emitter.SHR(16, R(EDX), Imm8(4)); //SR_OVER_S32 flag - emitter.SHR(16, R(EAX), Imm8(5)); //SR_TOP2BITS flag + emitter.SHR(16, R(EDX), Imm8(1)); emitter.OR(16, R(EAX), R(EDX)); - emitter.SHR(16, R(ECX), Imm8(2)); //SR_ARITH_ZERO + emitter.SHL(16, R(ECX), Imm8(2)); emitter.NOT(16, R(ECX)); emitter.AND(16, R(EAX), R(ECX)); emitter.NOT(16, R(EAX)); - emitter.TEST(16, R(EAX), Imm16(1)); + emitter.TEST(16, R(EAX), Imm16(0x10)); break; case 0xc: // LNZ - Logic Not Zero case 0xd: // LZ - Logic Zero diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp index b85890c8fb..8203f7cde1 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitExtOps.cpp @@ -728,35 +728,3 @@ void DSPEmitter::popExtValueToReg() { } storeIndex2 = -1; } - -// This function is being called in the main op after all input regs were read -// and before it writes into any regs. This way we can always use bitwise or to -// apply the ext command output, because if the main op didn't change the value -// then 0 | ext output = ext output and if it did then bitwise or is still the -// right thing to do -//this is only needed as long as we do fallback for ext ops -void DSPEmitter::zeroWriteBackLog(const UDSPInstruction opc) -{ - const DSPOPCTemplate *tinst = GetOpTemplate(opc); - - // Call extended - if (!tinst->extended) - return; - - if ((opc >> 12) == 0x3) { - if (! extOpTable[opc & 0x7F]->jitFunc) - { - gpr.pushRegs(); - ABI_CallFunction((void*)::zeroWriteBackLog); - gpr.popRegs(); - } - } else { - if (! extOpTable[opc & 0xFF]->jitFunc) - { - gpr.pushRegs(); - ABI_CallFunction((void*)::zeroWriteBackLog); - gpr.popRegs(); - } - } - return; -} diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitMisc.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitMisc.cpp index a9c490c157..8d8a635536 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitMisc.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitMisc.cpp @@ -379,7 +379,6 @@ void DSPEmitter::lris(const UDSPInstruction opc) // an opcode extension but not do anything. At least according to duddie. void DSPEmitter::nx(const UDSPInstruction opc) { - zeroWriteBackLog(opc); } //---- @@ -479,7 +478,6 @@ void DSPEmitter::sbset(const UDSPInstruction opc) // but it's harder to know exactly what effect they have. void DSPEmitter::srbith(const UDSPInstruction opc) { - zeroWriteBackLog(opc); switch ((opc >> 8) & 0xf) { // M0/M2 change the multiplier mode (it can multiply by 2 for free).