diff --git a/src/coreclr/jit/emitloongarch64.cpp b/src/coreclr/jit/emitloongarch64.cpp index 8d8ccbc2a88ed..63d4e9a975b9b 100644 --- a/src/coreclr/jit/emitloongarch64.cpp +++ b/src/coreclr/jit/emitloongarch64.cpp @@ -3848,8 +3848,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) } } -#ifdef DEBUG - if (emitComp->opts.disAsm || emitComp->verbose) + if (emitComp->opts.disAsm INDEBUG(|| emitComp->verbose)) { code_t* cp = (code_t*)(*dp + writeableOffset); while ((BYTE*)cp != dstRW) @@ -3859,6 +3858,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) } } +#ifdef DEBUG if (emitComp->compDebugBreak) { // For example, set JitBreakEmitOutputInstr=a6 will break when this method is called for @@ -3882,8 +3882,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) /*****************************************************************************/ /*****************************************************************************/ -#ifdef DEBUG - // clang-format off static const char* const RegNames[] = { @@ -3964,19 +3962,21 @@ void emitter::emitDisInsName(code_t code, const BYTE* addr, instrDesc* id) { const BYTE* insAdr = addr - writeableOffset; - bool disOpcode = !emitComp->opts.disDiffable; - bool disAddr = emitComp->opts.disAddr; - if (disAddr) +#ifdef DEBUG + if (emitComp->opts.disAddr) { printf(" 0x%llx", insAdr); } printf(" "); - if (disOpcode) + if (!emitComp->opts.disDiffable) { printf("%08X ", code); } +#else + printf(" "); +#endif const int regd = code & 0x1f; const int regj = (code >> 5) & 0x1f; @@ -4540,51 +4540,16 @@ void emitter::emitDispIns( } } +#ifdef DEBUG /***************************************************************************** * * Display a stack frame reference. */ - void emitter::emitDispFrameRef(int varx, int disp, int offs, bool asmfm) { - printf("["); - - if (varx < 0) - printf("TEMP_%02u", -varx); - else - emitComp->gtDispLclVar(+varx, false); - - if (disp < 0) - printf("-0x%02x", -disp); - else if (disp > 0) - printf("+0x%02x", +disp); - - printf("]"); - - if (varx >= 0 && emitComp->opts.varNames) - { - LclVarDsc* varDsc; - const char* varName; - - assert((unsigned)varx < emitComp->lvaCount); - varDsc = emitComp->lvaTable + varx; - varName = emitComp->compLocalVarName(varx, offs); - - if (varName) - { - printf("'%s", varName); - - if (disp < 0) - printf("-%d", -disp); - else if (disp > 0) - printf("+%d", +disp); - - printf("'"); - } - } + NYI_LOONGARCH64("emitDispFrameRef-----unused on LoongArch64."); } - -#endif // DEBUG +#endif // Generate code for a load or store operation with a potentially complex addressing mode // This method handles the case of a GT_IND with contained GT_LEA op1 of the x86 form [base + index*sccale + offset] diff --git a/src/coreclr/jit/emitloongarch64.h b/src/coreclr/jit/emitloongarch64.h index afaca5b2ba04b..bae6d188ca1f7 100644 --- a/src/coreclr/jit/emitloongarch64.h +++ b/src/coreclr/jit/emitloongarch64.h @@ -19,10 +19,6 @@ struct CnsVal bool cnsReloc; }; -#ifdef DEBUG -/************************************************************************/ -/* Debug-only routines to display instructions */ -/************************************************************************/ enum insDisasmFmt { DF_G_INVALID = 0, @@ -108,7 +104,6 @@ code_t emitGetInsMask(int ins); insDisasmFmt emitGetInsFmt(instruction ins); void emitDispInst(instruction ins); void emitDisInsName(code_t code, const BYTE* addr, instrDesc* id); -#endif // DEBUG void emitIns_J_cond_la(instruction ins, BasicBlock* dst, regNumber reg1 = REG_R0, regNumber reg2 = REG_R0); void emitIns_I_la(emitAttr attr, regNumber reg, ssize_t imm);