Skip to content

Add support for the Avx512 Compress/Expand intrinsics #116567

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

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

tannergooding
Copy link
Member

@tannergooding tannergooding commented Jun 11, 2025

This makes progress towards completing the remaining APIs from #87097

@tannergooding tannergooding marked this pull request as ready for review June 12, 2025 15:56
@Copilot Copilot AI review requested due to automatic review settings June 12, 2025 15:56
@tannergooding tannergooding added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed area-System.Runtime.Intrinsics labels Jun 12, 2025
@tannergooding
Copy link
Member Author

CC. @dotnet/jit-contrib, @EgorBo

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds support for the AVX512 Compress/Expand intrinsics by implementing new APIs in the runtime libraries, updating the reference assemblies, and modifying the JIT and emitter to handle the new instructions. Key changes include:

  • New definitions in System.Runtime.Intrinsics and System.Private.CoreLib for Compress and Expand intrinsics across multiple data types and vector sizes.
  • Updates to the JIT lowering, code generation, and hardware intrinsic lists to correctly recognize and handle the new AVX512 compress/expand operations.
  • Enhancements in test projects and intrinsic test generation to validate the new functionality.

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/tests/JIT/HardwareIntrinsics/X86_Avx512/Avx512Vbmi2/Program.Avx512Vbmi2.cs New test file for AVX512 Vbmi2 intrinsics support.
src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs Added reference signatures for Compress and Expand intrinsics.
src/libraries/System.Private.CoreLib/ (multiple files) Implementation of Compress/Expand intrinsics and platform stubs.
src/coreclr/jit/* and src/coreclr/jit/emitxarch.cpp, hwintrinsic* files JIT lowering and codegen updates to support new intrinsics.
src/coreclr/jit/hwintrinsiclistxarch.h New hardware intrinsic entries for Compress and Expand.
Comments suppressed due to low confidence (1)

src/coreclr/jit/lowerxarch.cpp:10492

  • The new case for NI_AVX512_CompressMask and NI_AVX512_ExpandMask efficiently optimizes merge with zero by containing the operand. Please verify that this zero merge optimization covers all expected scenarios and does not introduce side effects.
case NI_AVX512_CompressMask:

@tannergooding tannergooding requested a review from EgorBo June 12, 2025 15:57
Copy link
Contributor

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

@tannergooding tannergooding merged commit 6f3fd75 into dotnet:main Jun 13, 2025
159 of 161 checks passed
@tannergooding tannergooding deleted the fix-87097 branch June 13, 2025 03:13
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants