Skip to content

Commit

Permalink
[LoongArch64] change the branch's disasm-format. (dotnet#96229)
Browse files Browse the repository at this point in the history
  • Loading branch information
shushanhf authored Feb 6, 2024
1 parent 89bba37 commit a715719
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion src/coreclr/jit/emitloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4039,6 +4039,17 @@ void emitter::emitDisInsName(code_t code, const BYTE* addr, instrDesc* id)
{
printf("%s, %s, 0x%lx\n", RegNames[regd], RegNames[regj], offs16);
}
else if (INS_OPTS_NONE == id->idInsOpt())
{
if (offs16 < 0)
{
printf("-%d ins\n", -offs16 >> 2);
}
else
{
printf("+%d ins\n", offs16 >> 2);
}
}
else
{
printf("%s, %s, 0x%llx\n", RegNames[regj], RegNames[regd], (int64_t)insAdr + offs16);
Expand All @@ -4049,7 +4060,22 @@ void emitter::emitDisInsName(code_t code, const BYTE* addr, instrDesc* id)
{
tmp = (((code >> 10) & 0xffff) | ((code & 0x1f) << 16)) << 11;
tmp >>= 9;
printf("%s, 0x%llx\n", RegNames[regj], (int64_t)insAdr + tmp);
if (INS_OPTS_NONE == id->idInsOpt())
{
tmp >>= 2;
if (tmp < 0)
{
printf("%s, -%d ins\n", RegNames[regj], tmp);
}
else
{
printf("%s, +%d ins\n", RegNames[regj], tmp);
}
}
else
{
printf("%s, 0x%llx\n", RegNames[regj], (int64_t)insAdr + tmp);
}
return;
}
case DF_G_B0:
Expand All @@ -4063,6 +4089,18 @@ void emitter::emitDisInsName(code_t code, const BYTE* addr, instrDesc* id)
methodName = emitComp->eeGetMethodFullName((CORINFO_METHOD_HANDLE)id->idDebugOnlyInfo()->idMemCookie);
printf("# %s\n", methodName);
}
else if (INS_OPTS_NONE == id->idInsOpt())
{
tmp >>= 2;
if (tmp < 0)
{
printf("-%d ins\n", tmp);
}
else
{
printf("+%d ins\n", tmp);
}
}
else
{
printf("0x%llx\n", (int64_t)insAdr + tmp);
Expand Down

0 comments on commit a715719

Please sign in to comment.