Skip to content

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

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
SingleAccretion:Moffset-In-emitOutputAM
Dec 19, 2021
Merged

Implement the "moffset" encoding size optimization in emitOutputAM#62896
jakobbotsch merged 1 commit into
dotnet:mainfrom
SingleAccretion:Moffset-In-emitOutputAM

Conversation

@SingleAccretion

@SingleAccretionSingleAccretion commented Dec 16, 2021

Copy link
Copy Markdown
Contributor

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.

@ghostghost added community-contribution Indicates that the PR has been added by a community member area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Dec 16, 2021
@ghost

Copy link
Copy Markdown

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
Copy Markdown
ContributorAuthor

@dotnet/jit-contrib

@jakobbotschjakobbotsch left a comment

Copy link
Copy Markdown
Member

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:mainDec 19, 2021
@SingleAccretion
SingleAccretion deleted the Moffset-In-emitOutputAM branch December 20, 2021 09:23
@ghostghost locked as resolved and limited conversation to collaborators Jan 19, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIcommunity-contributionIndicates 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

@SingleAccretion@jakobbotsch