From 86b82be8ef7ccc6a1a89fac9c835cf3b905ffcf0 Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Mon, 30 Jan 2023 06:30:29 +0100 Subject: [PATCH] PPCRec: Use agnostic breakpoints --- .../Recompiler/BackendX64/BackendX64.cpp | 6 +- src/Cafe/HW/Espresso/Recompiler/IML/IML.h | 1 - .../Espresso/Recompiler/IML/IMLAnalyzer.cpp | 60 ------------------- .../Recompiler/IML/IMLRegisterAllocator.cpp | 2 +- .../Recompiler/PPCRecompilerImlGen.cpp | 4 +- 5 files changed, 6 insertions(+), 67 deletions(-) diff --git a/src/Cafe/HW/Espresso/Recompiler/BackendX64/BackendX64.cpp b/src/Cafe/HW/Espresso/Recompiler/BackendX64/BackendX64.cpp index ef01c045..ec50b891 100644 --- a/src/Cafe/HW/Espresso/Recompiler/BackendX64/BackendX64.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/BackendX64/BackendX64.cpp @@ -642,7 +642,7 @@ bool PPCRecompilerX64Gen_imlInstruction_r_s32(PPCRecFunction_t* PPCRecFunction, } else if( imlInstruction->operation == PPCREC_IML_OP_MFCR ) { - __debugbreak(); + DEBUG_BREAK; //uint32 destRegister = imlInstruction->op_r_immS32.registerIndex; //x64Gen_xor_reg64Low32_reg64Low32(x64GenContext, destRegister, destRegister); //for(sint32 f=0; f<32; f++) @@ -653,7 +653,7 @@ bool PPCRecompilerX64Gen_imlInstruction_r_s32(PPCRecFunction_t* PPCRecFunction, } else if (imlInstruction->operation == PPCREC_IML_OP_MTCRF) { - __debugbreak(); + DEBUG_BREAK; //uint32 srcRegister = imlInstruction->op_r_immS32.registerIndex; //uint32 crBitMask = ppc_MTCRFMaskToCRBitMask((uint32)imlInstruction->op_r_immS32.immS32); //for (sint32 f = 0; f < 32; f++) @@ -896,7 +896,7 @@ bool PPCRecompilerX64Gen_imlInstruction_r_r_r(PPCRecFunction_t* PPCRecFunction, //if (rRegResult == rRegOperand2) //{ // if (rRegResult != rRegOperand1) - // __debugbreak(); // cannot handle yet (we use rRegResult as a temporary reg, but its not possible if it is shared with op2) + // DEBUG_BREAK; // cannot handle yet (we use rRegResult as a temporary reg, but its not possible if it is shared with op2) //} //if(rRegOperand1 != rRegResult) diff --git a/src/Cafe/HW/Espresso/Recompiler/IML/IML.h b/src/Cafe/HW/Espresso/Recompiler/IML/IML.h index fe81f574..f1820f57 100644 --- a/src/Cafe/HW/Espresso/Recompiler/IML/IML.h +++ b/src/Cafe/HW/Espresso/Recompiler/IML/IML.h @@ -12,7 +12,6 @@ struct PPCRecCRTracking_t bool IMLAnalyzer_IsTightFiniteLoop(IMLSegment* imlSegment); bool IMLAnalyzer_CanTypeWriteCR(IMLInstruction* imlInstruction); -void IMLAnalyzer_GetCRTracking(IMLInstruction* imlInstruction, PPCRecCRTracking_t* crTracking); // optimizer passes // todo - rename diff --git a/src/Cafe/HW/Espresso/Recompiler/IML/IMLAnalyzer.cpp b/src/Cafe/HW/Espresso/Recompiler/IML/IMLAnalyzer.cpp index eac36371..ca438c3c 100644 --- a/src/Cafe/HW/Espresso/Recompiler/IML/IMLAnalyzer.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/IML/IMLAnalyzer.cpp @@ -89,63 +89,3 @@ bool IMLAnalyzer_CanTypeWriteCR(IMLInstruction* imlInstruction) return false; } - -void IMLAnalyzer_GetCRTracking(IMLInstruction* imlInstruction, PPCRecCRTracking_t* crTracking) -{ - __debugbreak(); - //crTracking->readCRBits = 0; - //crTracking->writtenCRBits = 0; - //if (imlInstruction->type == PPCREC_IML_TYPE_CJUMP) - //{ - // if (imlInstruction->op_conditionalJump.condition != PPCREC_JUMP_CONDITION_NONE) - // { - // uint32 crBitFlag = 1 << (imlInstruction->op_conditionalJump.crRegisterIndex * 4 + imlInstruction->op_conditionalJump.crBitIndex); - // crTracking->readCRBits = (crBitFlag); - // } - //} - //else if (imlInstruction->type == PPCREC_IML_TYPE_CONDITIONAL_R_S32) - //{ - // uint32 crBitFlag = 1 << (imlInstruction->op_conditional_r_s32.crRegisterIndex * 4 + imlInstruction->op_conditional_r_s32.crBitIndex); - // crTracking->readCRBits = crBitFlag; - //} - //else if (imlInstruction->type == PPCREC_IML_TYPE_R_S32 && imlInstruction->operation == PPCREC_IML_OP_MFCR) - //{ - // crTracking->readCRBits = 0xFFFFFFFF; - //} - //else if (imlInstruction->type == PPCREC_IML_TYPE_R_S32 && imlInstruction->operation == PPCREC_IML_OP_MTCRF) - //{ - // crTracking->writtenCRBits |= ppc_MTCRFMaskToCRBitMask((uint32)imlInstruction->op_r_immS32.immS32); - //} - //else if (imlInstruction->type == PPCREC_IML_TYPE_CR) - //{ - // if (imlInstruction->operation == PPCREC_IML_OP_CR_CLEAR || - // imlInstruction->operation == PPCREC_IML_OP_CR_SET) - // { - // uint32 crBitFlag = 1 << (imlInstruction->op_cr.crD); - // crTracking->writtenCRBits = crBitFlag; - // } - // else if (imlInstruction->operation == PPCREC_IML_OP_CR_OR || - // imlInstruction->operation == PPCREC_IML_OP_CR_ORC || - // imlInstruction->operation == PPCREC_IML_OP_CR_AND || - // imlInstruction->operation == PPCREC_IML_OP_CR_ANDC) - // { - // uint32 crBitFlag = 1 << (imlInstruction->op_cr.crD); - // crTracking->writtenCRBits = crBitFlag; - // crBitFlag = 1 << (imlInstruction->op_cr.crA); - // crTracking->readCRBits = crBitFlag; - // crBitFlag = 1 << (imlInstruction->op_cr.crB); - // crTracking->readCRBits |= crBitFlag; - // } - // else - // assert_dbg(); - //} - //else if (IMLAnalyzer_CanTypeWriteCR(imlInstruction) && imlInstruction->crRegister >= 0 && imlInstruction->crRegister <= 7) - //{ - // crTracking->writtenCRBits |= (0xF << (imlInstruction->crRegister * 4)); - //} - //else if ((imlInstruction->type == PPCREC_IML_TYPE_STORE || imlInstruction->type == PPCREC_IML_TYPE_STORE_INDEXED) && imlInstruction->op_storeLoad.copyWidth == PPC_REC_STORE_STWCX_MARKER) - //{ - // // overwrites CR0 - // crTracking->writtenCRBits |= (0xF << 0); - //} -} \ No newline at end of file diff --git a/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp b/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp index c52878b7..5d11d0c2 100644 --- a/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp @@ -381,7 +381,7 @@ raLivenessSubrange_t* _GetSubrangeByInstructionIndexAndVirtualReg(IMLSegment* im void IMLRA_IsolateRangeOnInstruction(ppcImlGenContext_t* ppcImlGenContext, IMLSegment* imlSegment, raLivenessSubrange_t* subrange, sint32 instructionIndex) { - __debugbreak(); + DEBUG_BREAK; } void IMLRA_HandleFixedRegisters(ppcImlGenContext_t* ppcImlGenContext, IMLSegment* imlSegment) diff --git a/src/Cafe/HW/Espresso/Recompiler/PPCRecompilerImlGen.cpp b/src/Cafe/HW/Espresso/Recompiler/PPCRecompilerImlGen.cpp index 3cd1a1c6..c37126d5 100644 --- a/src/Cafe/HW/Espresso/Recompiler/PPCRecompilerImlGen.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/PPCRecompilerImlGen.cpp @@ -3079,7 +3079,7 @@ bool PPCRecompiler_GenerateIML(ppcImlGenContext_t& ppcImlGenContext, PPCFunction { debug_printf("---------------- SegmentDump (Suffix instruction at wrong pos in segment 0x%x):\n", (int)segIndex); IMLDebug_Dump(&ppcImlGenContext); - __debugbreak(); + DEBUG_BREAK; } } } @@ -3089,7 +3089,7 @@ bool PPCRecompiler_GenerateIML(ppcImlGenContext_t& ppcImlGenContext, PPCFunction { debug_printf("---------------- SegmentDump (NoSuffixInstruction in segment 0x%x):\n", (int)segIndex); IMLDebug_Dump(&ppcImlGenContext); - __debugbreak(); + DEBUG_BREAK; } } if (seg->nextSegmentBranchNotTaken)