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

JIT: Reduce size of x86 intrinsic jump table fallbacks #112556

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

saucecontrol
Copy link
Member

@saucecontrol saucecontrol commented Feb 14, 2025

When generating jump table fallbacks for intrinsics that accept a control byte, we currently generate all 256 possible encodings for anything flagged HW_Flag_FullRangeIMM. Many of the corresponding instructions are documented to use a much smaller range of values, even though all values are allowed.

We can reduce the size of the generated fallback code significantly by masking or clamping the input byte and generating only useful instruction encodings.

Diffs:

Collection Base size (bytes) Diff size (bytes) PerfScore in Diffs
benchmarks.run_pgo.windows.x64.checked.mch 35,255,449 -2,377 -90.60%
benchmarks.run_tiered.windows.x64.checked.mch 12,509,672 -2,377 -90.60%
coreclr_tests.run.windows.x64.checked.mch 409,037,918 -1,097,265 -94.46%
libraries.pmi.windows.x64.checked.mch 60,479,093 -551,918 -94.86%
libraries_tests.run.windows.x64.Release.mch 329,101,604 -2,377 -90.60%

@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 Feb 14, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 14, 2025
Copy link
Contributor

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

@saucecontrol saucecontrol marked this pull request as ready for review February 14, 2025 17:49
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 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.

1 participant