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

Fix the ARM's double register name displayed in JitDisasm/JitDump #79949

Merged
merged 2 commits into from
Dec 28, 2022
Merged
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
21 changes: 19 additions & 2 deletions src/coreclr/jit/emitarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6927,8 +6927,25 @@ void emitter::emitDispReg(regNumber reg, emitAttr attr, bool addComma)
{
if (isFloatReg(reg))
{
const char* size = attr == EA_8BYTE ? "d" : "s";
printf("%s%s", size, emitFloatRegName(reg, attr) + 1);
if (attr == EA_8BYTE)
{
unsigned regIndex = reg - REG_F0;
regIndex >>= 1;

if (regIndex < 10)
{
printf("d%c", regIndex + '0');
}
else
{
assert(regIndex < 100);
printf("d%c%c", (regIndex / 10), (regIndex % 10));
}
}
else
{
printf("s%s", emitFloatRegName(reg, attr) + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this side also incorrect? I could easily have misread the chain of calls, but it looked like emitFloatRegName is going to return "f" so it would be "sf", which doesn't seem right.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but since we do + 1, we remove the extra f character that gets printed. This portion is unchanged actually.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will just use something manual version of _itoa to convert from int -> string.

}
}
else
{
Expand Down