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

Return accurate size of addressing mode dsp/dsp+cnst instr descriptor #47284

Merged
merged 2 commits into from
Jan 25, 2021
Merged
Changes from 1 commit
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
26 changes: 24 additions & 2 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7416,8 +7416,6 @@ size_t emitter::emitSizeOfInsDsc(instrDesc* id)
case ID_OP_CNS:
case ID_OP_DSP:
case ID_OP_DSP_CNS:
case ID_OP_AMD:
case ID_OP_AMD_CNS:
if (id->idIsLargeCns())
{
if (id->idIsLargeDsp())
Expand All @@ -7440,6 +7438,30 @@ size_t emitter::emitSizeOfInsDsc(instrDesc* id)
return sizeof(instrDesc);
}
}
case ID_OP_AMD:
case ID_OP_AMD_CNS:
if (id->idIsLargeCns())
Copy link
Member

Choose a reason for hiding this comment

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

Based on emitNewInstrAmdCns, I would expect it to be:

            if (id->idIsLargeCns())
            {
                if (id->idIsLargeDsp())
                {
                    return sizeof(instrDescCnsAmd);
                }
                else
                {
                    return sizeof(instrDescCns);
                }
            }
            else
            {
                if (id->idIsLargeDsp())
                {
                    return sizeof(instrDescAmd);
                }
                else
                {
                    return sizeof(instrDesc);
                }
            }

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually yes.

{
if (id->idIsLargeDsp())
{
return sizeof(instrDescCnsAmd);
}
else
{
return sizeof(instrDescAmd);
}
}
else
{
if (id->idIsLargeDsp())
{
return sizeof(instrDescDsp);
}
else
{
return sizeof(instrDesc);
}
}

default:
NO_WAY("unexpected instruction descriptor format");
Expand Down