Skip to content

Additional cleanup and simplification of hwintrinsic instruction sets for xarch #116406

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

Conversation

tannergooding
Copy link
Member

This does the remaining follow up work on #116230 to reduce the number of InstructionSet_ on the JIT side and make things a bit simpler to handle

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 8, 2025
Copy link
Contributor

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

@tannergooding tannergooding force-pushed the more-hwintrinsic-simplification branch from 3211a43 to 0300942 Compare June 8, 2025 05:21
@tannergooding
Copy link
Member Author

@MihuBot

@tannergooding tannergooding marked this pull request as ready for review June 8, 2025 16:39
@Copilot Copilot AI review requested due to automatic review settings June 8, 2025 16:39
@tannergooding tannergooding requested a review from EgorBo June 8, 2025 16:39
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 simplifies and cleans up the handling of hardware intrinsic instruction sets on the JIT side by replacing several dependencies on SSE41 (and related sets like BMI1/BMI2/FMA) with newer ones (SSE42, AVX2, AVX512v2, etc.). The key changes include:

  • Updating intrinsic dependency checks and reset IDs from SSE41 to SSE42 throughout jit's lowering, codegen, and other components.
  • Replacing BMI1/BMI2/FMA references with AVX2 in several cases.
  • Removing the EnableIncompleteISAClass configuration from jitconfigvalues.h.

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.

File Description
src/coreclr/jit/lsrabuild.cpp Updated intrinsic dependency from InstructionSet_SSE41 to InstructionSet_SSE42.
src/coreclr/jit/importercalls.cpp Swapped FMA and POPCNT dependency checks to use AVX2/SSE42 intrinsics.
src/coreclr/jit/jitconfigvalues.h Removed the EnableIncompleteISAClass configuration setting.
(Other files) Similar updates across lowering, codegen, hwintrinsic*, emitter, etc.

@tannergooding
Copy link
Member Author

CC. @dotnet/jit-contrib, @EgorBo

Last of the JIT side cleanup related to the ISA simplification work. Was able to remove another ~1200 lines of code.

Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

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

LGTM, but I am not sure I understand why various Insert/Extract/Round instructions were moved under SSE42, could you explain?

@tannergooding
Copy link
Member Author

LGTM, but I am not sure I understand why various Insert/Extract/Round instructions were moved under SSE42, could you explain?

With the simplification, the JIT doesn't actually support targeting just SSE3, SSSE3, or SSE4.1 anymore. So the JIT is able to be simplified by combining all of these into SSE4.2. In some cases this allows fewer code paths to exist, because we no longer need to have a separate path to support SSE4.1 vs SSE3. It also makes it clearer that no JIT path needs to consider these differences, reduces the number of cases that switches need to handle, etc.

The downside is that the JIT InstructionSet no longer match the managed class names 1-to-1. But the throughput and other simplifications we get are worth it overall.

@tannergooding tannergooding merged commit 5415b73 into dotnet:main Jun 10, 2025
106 checks passed
@tannergooding tannergooding deleted the more-hwintrinsic-simplification branch June 10, 2025 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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