Skip to content

Adding zmmStateSupport and AVX512F, AVX512CD, AVX512BW, AVX512DQ and AVX512VL ISAs. - #74113

Merged
tannergooding merged 3 commits into
dotnet:mainfrom
DeepakRajendrakumaran:Issue159
Sep 16, 2022
Merged

Adding zmmStateSupport and AVX512F, AVX512CD, AVX512BW, AVX512DQ and AVX512VL ISAs.#74113
tannergooding merged 3 commits into
dotnet:mainfrom
DeepakRajendrakumaran:Issue159

Conversation

@DeepakRajendrakumaran

Copy link
Copy Markdown
Contributor

This change adds logic for detecting avx512 support via zmmStateSupport and the logic in EEJitManager::SetCpuInfo()

For specifics of zmmStateSupport- see section 15.2 DETECTION OF AVX-512 FOUNDATION INSTRUCTIONS in Intel® 64 and IA-32 Architectures Software Developer’s Manual Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4 for details. 14.3 DETECTION OF AVX INSTRUCTIONS details logic used for AVX and SSE.

The other changes are to add new AVX512 ISAs. Most of these changes are autogenerated code via src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Aug 18, 2022
@ghost

ghost commented Aug 18, 2022

Copy link
Copy Markdown

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@DeepakRajendrakumaran

Copy link
Copy Markdown
Contributor Author

Comment thread src/coreclr/inc/clrconfigvalues.h Outdated
Comment thread src/coreclr/vm/amd64/AsmHelpers.asm Outdated
Comment thread src/coreclr/nativeaot/Runtime/amd64/GC.asm Outdated
Comment thread src/coreclr/vm/i386/cgenx86.cpp Outdated
Comment thread src/coreclr/inc/clrconfigvalues.h Outdated
Comment thread src/coreclr/nativeaot/Runtime/amd64/GC.asm Outdated
Comment thread src/coreclr/inc/clrconfigvalues.h Outdated
Comment thread src/coreclr/inc/clrconfigvalues.h Outdated
Comment thread src/coreclr/inc/clrconfigvalues.h Outdated
Comment thread src/coreclr/nativeaot/Runtime/amd64/GC.asm Outdated
Comment thread src/coreclr/vm/codeman.cpp Outdated
Comment thread src/coreclr/vm/codeman.cpp Outdated
Comment thread src/coreclr/vm/codeman.cpp Outdated
Comment thread src/coreclr/inc/clrconfigvalues.h Outdated
@DeepakRajendrakumaran

Copy link
Copy Markdown
Contributor Author

@tannergooding I cannot figure out where/how XmmYmmStateSupport in src/coreclr/pal/src/arch/amd64/processor.cpp is used. And why it's XmmYmmStateSupport as opposed to xmmYmmStateSupport . Are you familiar with this call?

Comment thread src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt Outdated
@tannergooding

Copy link
Copy Markdown
Member

I cannot figure out where/how XmmYmmStateSupport in src/coreclr/pal/src/arch/amd64/processor.cpp is used. And why it's XmmYmmStateSupport as opposed to xmmYmmStateSupport . Are you familiar with this call?

I don't see any existing consumers, it might be dead code.

@tannergooding

Copy link
Copy Markdown
Member

There's still a couple of pending comments above and we need to revise the JIT/EE Version Guid here: https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/jiteeversionguid.h

Otherwise the changes look good/correct to me and I think we can adjust the _VL handling if needed later. Would still be good if someone from @dotnet/crossgen-contrib could review those changes as well, however.

@DeepakRajendrakumaran
DeepakRajendrakumaran force-pushed the Issue159 branch 2 times, most recently from 975db44 to 5b0ef68 Compare September 2, 2022 19:15
@DeepakRajendrakumaran

Copy link
Copy Markdown
Contributor Author

There's still a couple of pending comments above and we need to revise the JIT/EE Version Guid here: https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/jiteeversionguid.h

Otherwise the changes look good/correct to me and I think we can adjust the _VL handling if needed later. Would still be good if someone from @dotnet/crossgen-contrib could review those changes as well, however.

Have added the requested changes.

@BruceForstall

Copy link
Copy Markdown
Contributor

Tagging the group... just to see it work... @dotnet/avx512-contrib

@DeepakRajendrakumaran

Copy link
Copy Markdown
Contributor Author

Tagging the group... just to see it work... @dotnet/avx512-contrib

Works for me. Got an email notification

@DeepakRajendrakumaran
DeepakRajendrakumaran force-pushed the Issue159 branch 2 times, most recently from ddaef19 to 57a793f Compare September 13, 2022 20:59
@DeepakRajendrakumaran

Copy link
Copy Markdown
Contributor Author

There's still a couple of pending comments above and we need to revise the JIT/EE Version Guid here: https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/jiteeversionguid.h

Otherwise the changes look good/correct to me and I think we can adjust the _VL handling if needed later. Would still be good if someone from @dotnet/crossgen-contrib could review those changes as well, however.

@tannergooding I had originally missed your comment re JIT/EE Version Guid. I have updated it now following instruction in the file(ran "uuidgen.exe -s" locally and replaced the GUID in file with that). Please let me know if there is anything else needed from us to push this forward.

Comment thread src/coreclr/tools/Common/JitInterface/CorInfoBase.cs Outdated
@davidwrighton

Copy link
Copy Markdown
Member

I've approved, but I'd like to see an approval from @tannergooding as well before we merge.

Comment thread src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs Outdated

@tannergooding tannergooding 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, minus the question about the NAOT instruction set names

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.

This needs to be hooked up here:

bool DetectCPUFeatures()

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.

Looks like the AVX512 ISA checks need to be mirrored there as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And the 'end' was in the wrong place :) . Have added the checks in startup.cpp

@tannergooding

Copy link
Copy Markdown
Member

Failures are #75667

super-pmi failures are due to the JIT/EE version guid update

timeouts are on a subset of arm/arm64 machines and are happening everywhere, this change is explicitly around xarch.

@tannergooding
tannergooding merged commit 242c95a into dotnet:main Sep 16, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Oct 17, 2022
@BruceForstall BruceForstall added the avx512 Related to the AVX-512 architecture label Mar 10, 2023
@DeepakRajendrakumaran
DeepakRajendrakumaran deleted the Issue159 branch August 3, 2026 23:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-coreclr avx512 Related to the AVX-512 architecture 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.

8 participants