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

Implement the "moffset" encoding size optimization in emitOutputAM #62896

Merged
merged 1 commit into from
Dec 19, 2021

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Dec 16, 2021

The x86 encoding for direct addressing modes permits a short form for the case of mov eax, [addr], mov [addr], eax, without the ModR/M byte. We were already taking advantage of it when emitting statics (in emitOutputCV). This change ports that optimization to emitOutputAM (the "general" method handling all address modes, not just M ones).

There is an unfortunate part to this change and that is the fact it consists of essentially copying code (verbatim, to signify that). I don't know what is the intention behind the CV/AM split (they emit the same code on x64, and on x86, except for this special case), and I do not have the expertise necessary to refactor this with confidence, so that is why that is.

There is a fortunate part to this change too though, and that is the fact it has some nice diffs attached to it. For unclear reasons, SPMI in CI did not capture them, so here is my locally obtained version: diffs.

As one would guess, this is another step in the direction of deleting CLS_VAR.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Dec 16, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 16, 2021
@ghost
Copy link

ghost commented Dec 16, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Let's see what the CI thinks.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion SingleAccretion marked this pull request as ready for review December 17, 2021 11:11
@SingleAccretion
Copy link
Contributor Author

@dotnet/jit-contrib

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks. Nice x86 diffs.

@jakobbotsch jakobbotsch merged commit a891aed into dotnet:main Dec 19, 2021
@SingleAccretion SingleAccretion deleted the Moffset-In-emitOutputAM branch December 20, 2021 09:23
@ghost ghost locked as resolved and limited conversation to collaborators Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants