Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Consistently use '0x' as the hex specifier #89773

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4806,7 +4806,7 @@ void CodeGen::genEnregisterOSRArgsAndLocals()
offset += genSPtoFPdelta();
}

JITDUMP("---OSR--- V%02u (reg) old rbp offset %d old frame %d this frame sp-fp %d new offset %d (%02xH)\n",
JITDUMP("---OSR--- V%02u (reg) old rbp offset %d old frame %d this frame sp-fp %d new offset %d (0x%02x)\n",
varNum, stkOffs, originalFrameSize, genSPtoFPdelta(), offset, offset);

GetEmitter()->emitIns_R_AR(ins_Load(lclTyp), size, varDsc->GetRegNum(), genFramePointerReg(), offset);
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3532,11 +3532,11 @@ void emitter::emitDispVarSet()

if (of < 0)
{
printf("-%02XH", -of);
printf("-0x%02X", -of);
}
else if (of > 0)
{
printf("+%02XH", +of);
printf("+0x%02X", +of);
}

printf("]");
Expand Down Expand Up @@ -4113,7 +4113,7 @@ void emitter::emitDispIG(insGroup* ig, bool displayFunc, bool displayInstruction

if (jitdump)
{
printf("%soffs=%06XH, size=%04XH", separator, ig->igOffs, ig->igSize);
printf("%soffs=0x%06X, size=0x%04X", separator, ig->igOffs, ig->igSize);
separator = ", ";
}

Expand Down Expand Up @@ -7121,12 +7121,12 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
#ifdef DEBUG
if (emitComp->opts.disAddr)
{
printf(" ;; offset=%04XH", emitCurCodeOffs(cp));
printf(" ;; offset=0x%04X", emitCurCodeOffs(cp));
}
else
#endif // DEBUG
{
printf(" ;; offset=%04XH", emitCurCodeOffs(cp));
printf(" ;; offset=0x%04X", emitCurCodeOffs(cp));
}
}
printf("\n");
Expand All @@ -7138,7 +7138,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
printf("\n%s:", emitLabelString(ig));
if (!emitComp->opts.disDiffable)
{
printf(" ;; offset=%04XH", emitCurCodeOffs(cp));
printf(" ;; offset=0x%04X", emitCurCodeOffs(cp));
}
printf("\n");
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/emitarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5415,7 +5415,7 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i)
{
size_t sz = 4; // Thumb-2 pretends all instructions are 4-bytes long for computing jump offsets?
int distValSize = id->idjShort ? 4 : 8;
printf("; %s jump [%08X/%03u] from %0*X to %0*X: dist = %08XH\n", (dstOffs <= srcOffs) ? "Fwd" : "Bwd",
printf("; %s jump [%08X/%03u] from %0*X to %0*X: dist = 0x%08X\n", (dstOffs <= srcOffs) ? "Fwd" : "Bwd",
dspPtr(id), id->idDebugOnlyInfo()->idNum, distValSize, srcOffs + sz, distValSize, dstOffs, distVal);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/emitarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10141,7 +10141,7 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i)
{
size_t sz = 4;
int distValSize = id->idjShort ? 4 : 8;
printf("; %s jump [%08X/%03u] from %0*X to %0*X: dist = %08XH\n", (dstOffs <= srcOffs) ? "Fwd" : "Bwd",
printf("; %s jump [%08X/%03u] from %0*X to %0*X: dist = 0x%08X\n", (dstOffs <= srcOffs) ? "Fwd" : "Bwd",
dspPtr(id), id->idDebugOnlyInfo()->idNum, distValSize, srcOffs + sz, distValSize, dstOffs, distVal);
}
#endif
Expand Down
32 changes: 16 additions & 16 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10360,11 +10360,11 @@ void emitter::emitDispFrameRef(int varx, int disp, int offs, bool asmfm)

if (addr < 0)
{
printf("-%02XH", -addr);
printf("-0x%02X", -addr);
}
else if (addr > 0)
{
printf("+%02XH", addr);
printf("+0x%02X", addr);
}
}
else
Expand All @@ -10375,17 +10375,17 @@ void emitter::emitDispFrameRef(int varx, int disp, int offs, bool asmfm)

if (addr < 0)
{
printf("-%02XH", -addr);
printf("-0x%02X", -addr);
}
else if (addr > 0)
{
printf("+%02XH", addr);
printf("+0x%02X", addr);
}

#if !FEATURE_FIXED_OUT_ARGS

if (emitCurStackLvl)
printf("+%02XH", emitCurStackLvl);
printf("+0x%02X", emitCurStackLvl);

#endif // !FEATURE_FIXED_OUT_ARGS
}
Expand Down Expand Up @@ -10566,51 +10566,51 @@ void emitter::emitDispAddrMode(instrDesc* id, bool noDetail)
}
if (frameRef)
{
printf("%02XH", (unsigned)disp);
printf("0x%02X", (unsigned)disp);
}
else if (disp < 1000)
{
printf("%02XH", (unsigned)disp);
printf("0x%02X", (unsigned)disp);
}
else if (disp <= 0xFFFF)
{
printf("%04XH", (unsigned)disp);
printf("0x%04X", (unsigned)disp);
}
else
{
printf("%08XH", (unsigned)disp);
printf("0x%08X", (unsigned)disp);
}
}
else if (disp < 0)
{
if (frameRef)
{
printf("-%02XH", (unsigned)-disp);
printf("-0x%02X", (unsigned)-disp);
}
else if (disp > -1000)
{
printf("-%02XH", (unsigned)-disp);
printf("-0x%02X", (unsigned)-disp);
}
else if (disp >= -0xFFFF)
{
printf("-%04XH", (unsigned)-disp);
printf("-0x%04X", (unsigned)-disp);
}
else if (disp < -0xFFFFFF)
{
if (nsep)
{
printf("+");
}
printf("%08XH", (unsigned)disp);
printf("0x%08X", (unsigned)disp);
}
else
{
printf("-%08XH", (unsigned)-disp);
printf("-0x%08X", (unsigned)-disp);
}
}
else if (!nsep)
{
printf("%04XH", (unsigned)disp);
printf("0x%04X", (unsigned)disp);
}
}

Expand Down Expand Up @@ -15667,7 +15667,7 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i)
{
size_t sz = id->idjShort ? ssz : lsz;
int distValSize = id->idjShort ? 4 : 8;
printf("; %s jump [%08X/%03u] from %0*X to %0*X: dist = %08XH\n", (dstOffs <= srcOffs) ? "Fwd" : "Bwd",
printf("; %s jump [%08X/%03u] from %0*X to %0*X: dist = 0x%08X\n", (dstOffs <= srcOffs) ? "Fwd" : "Bwd",
emitComp->dspPtr(id), id->idDebugOnlyInfo()->idNum, distValSize, srcOffs + sz, distValSize, dstOffs,
distVal);
}
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/gcencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ void GCInfo::gcDumpVarPtrDsc(varPtrDsc* desc)

if (offs < 0)
{
printf("-%02XH", -offs);
printf("-0x%02X", -offs);
}
else if (offs > 0)
{
printf("+%02XH", +offs);
printf("+0x%02X", +offs);
}

printf("] live from %04X to %04X\n", desc->vpdBegOfs, desc->vpdEndOfs);
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/jit/gcinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@ void GCInfo::gcCountForHeader(UNALIGNED unsigned int* pUntrackedCount, UNALIGNED

if (offs < 0)
{
printf("-%02XH", -offs);
printf("-0x%02X", -offs);
}
else if (offs > 0)
{
printf("+%02XH", +offs);
printf("+0x%02X", +offs);
}

printf("]\n");
Expand Down Expand Up @@ -500,11 +500,11 @@ void GCInfo::gcCountForHeader(UNALIGNED unsigned int* pUntrackedCount, UNALIGNED

if (offs < 0)
{
printf("-%02XH", -offs);
printf("-0x%02X", -offs);
}
else if (offs > 0)
{
printf("+%02XH", +offs);
printf("+0x%02X", +offs);
}

printf("]\n");
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7394,7 +7394,7 @@ void Compiler::lvaDumpFrameLocation(unsigned lclNum)
baseReg = EBPbased ? REG_FPBASE : REG_SPBASE;
#endif

printf("[%2s%1s%02XH] ", getRegName(baseReg), (offset < 0 ? "-" : "+"), (offset < 0 ? -offset : offset));
printf("[%2s%1s0x%02X] ", getRegName(baseReg), (offset < 0 ? "-" : "+"), (offset < 0 ? -offset : offset));
}

/*****************************************************************************
Expand Down
Loading