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

Ensure that IF_*WR_RRD formats support 4-byte SIMD instructions #85594

Merged
merged 2 commits into from
May 1, 2023

Conversation

tannergooding
Copy link
Member

This resolves #85586 and resolves #85469

The general issue is that we have some scenarios where the instruction opcode is baselined at 4-bytes. In this case, we put the opcode in the code byte that modr/m is normally stored and so we can't pre-fill that with the regcode.

This fixes the formats that are new to supporting this scenario with EVEX to handle it correctly.

@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 May 1, 2023
@ghost ghost assigned tannergooding May 1, 2023
@ghost
Copy link

ghost commented May 1, 2023

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

Issue Details

This resolves #85586 and resolves #85469

The general issue is that we have some scenarios where the instruction opcode is baselined at 4-bytes. In this case, we put the opcode in the code byte that modr/m is normally stored and so we can't pre-fill that with the regcode.

This fixes the formats that are new to supporting this scenario with EVEX to handle it correctly.

Author: tannergooding
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Comment on lines +16289 to +16304
code = insCodeMR(ins);

if (EncodedBySSE38orSSE3A(ins))
{
// Special case 4-byte AVX instructions as the
// regcode position conflicts with the opcode byte
dst = emitOutputAM(dst, id, code);
}
else
{
code = AddSimdPrefixIfNeeded(id, code, size);
regcode = (insEncodeReg345(id, id->idReg1(), size, &code) << 8);
dst = emitOutputAM(dst, id, code | regcode);
}

sz = emitSizeOfInsDsc(id);
Copy link
Member Author

Choose a reason for hiding this comment

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

There's actually a bit of code duplication that exists between these format specific handlers and the general emitOutput** methods.

I want to get that cleaned up and it should be easier once #85536 goes in.

@BruceForstall BruceForstall added the avx512 Related to the AVX-512 architecture label May 1, 2023
@tannergooding
Copy link
Member Author

/azp run runtime-coreclr jitstress-isas-x86, runtime-coreclr outerloop, runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, Fuzzlyn

@azure-pipelines
Copy link

Azure Pipelines successfully started running 5 pipeline(s).

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

LGTM when the CI is green.

@tannergooding
Copy link
Member Author

Fuzzlyn failure is pre-existing (at least back to .NET 8 P3): #85611

@tannergooding
Copy link
Member Author

Expecting a few JitStress failures due to #85608

  • EnableHWIntrinsic=0
  • EnableSSE=0
  • EnableSSE2=0

@tannergooding tannergooding merged commit 44aaeb2 into dotnet:main May 1, 2023
@tannergooding tannergooding deleted the fix-85469 branch May 1, 2023 20:22
@ghost ghost locked as resolved and limited conversation to collaborators Jun 1, 2023
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 avx512 Related to the AVX-512 architecture
Projects
None yet
3 participants