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

Some minor cleanup post the addition of TYP_SIMD64 and ZMM support - P1 #83044

Merged
merged 6 commits into from
Mar 7, 2023

Conversation

tannergooding
Copy link
Member

The initial support was added in #80960 and a few unrelated cleanup opportunities were seen.

This is the first cleanup and covers the simpler things which can be easily relegated to TARGET_XARCH only.

There will be a separate PR cleaning up the SIMD handle logic to reduce code duplication and then another which ensures that simd32_t and simd64_t are xarch only as well.

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

ghost commented Mar 6, 2023

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

Issue Details

The initial support was added in #80960 and a few unrelated cleanup opportunities were seen.

This is the first cleanup and covers the simpler things which can be easily relegated to TARGET_XARCH only.

There will be a separate PR cleaning up the SIMD handle logic to reduce code duplication and then another which ensures that simd32_t and simd64_t are xarch only as well.

Author: tannergooding
Assignees: tannergooding
Labels:

area-CodeGen-coreclr

Milestone: -

@tannergooding
Copy link
Member Author

Minor TP impact is because we need to call compVerifyInstructionSetUnusable(InstructionSet_AVX512F); as part of maxSIMDStructBytes.

This is called for each SimdOrHWSimdClass field as part of Compiler::StructPromotionHelper::GetFieldInfo in lclvars.cpp

We only need to report that info "once" per compilation, so we should probably look at refactoring the maxSIMDStructBytes to record this once -or- ensure that callers (such as StructPromotionHelper) cache the info they need so it doesn't need to be repeatedly done...

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. Added couple of questions for better understanding.

src/coreclr/jit/compiler.h Show resolved Hide resolved
@@ -10709,7 +10709,6 @@ void CodeGen::genZeroInitFrameUsingBlockInit(int untrLclHi, int untrLclLo, regNu
assert(compiler->compGeneratingProlog);
assert(genUseBlockInit);
assert(untrLclHi > untrLclLo);
assert(compiler->getSIMDSupportLevel() >= SIMD_SSE2_Supported);
Copy link
Member

Choose a reason for hiding this comment

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

Replacing this assert is not needed? Is the idea that if AVX2 is not supported, then the default is SSE2 now?

Copy link
Member Author

Choose a reason for hiding this comment

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

The default has been SSE2 for many years (always for x64 and since around .NET Core 2.1 for x86). We require it and consider it part of the baseline ISA, so there is no need to check for its existence outside of supporting the DOTNET_EnableSSE2=0 switch for HWIntrinsic importation.

@tannergooding tannergooding merged commit 4699358 into dotnet:main Mar 7, 2023
@tannergooding tannergooding deleted the post-zmm-cleanup branch March 7, 2023 19:56
@BruceForstall BruceForstall added the avx512 Related to the AVX-512 architecture label Mar 27, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 26, 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
Development

Successfully merging this pull request may close these issues.

3 participants