JIT: Accelerate uint->floating casts on pre-AVX-512 x86#124114
Open
saucecontrol wants to merge 2 commits intodotnet:mainfrom
Open
JIT: Accelerate uint->floating casts on pre-AVX-512 x86#124114saucecontrol wants to merge 2 commits intodotnet:mainfrom
saucecontrol wants to merge 2 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the JIT’s cast handling to avoid helper calls for uint → floating-point conversions on pre-AVX-512 x86, while also centralizing the “cast requires helper” decision logic to simplify fgMorphExpandCast.
Changes:
- Add
Compiler::fgCastRequiresHelperand use it from importer/morph to consolidate helper-call decisions for casts. - Implement x86 lowering for
uint→float/doublecasts without helper calls when AVX-512 unsigned-convert is unavailable. - Adjust cast handling/refactoring in
fgMorphExpandCastand AVX-512 long→floating decomposition codepaths.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/morph.cpp | Refactors cast expansion to use fgCastRequiresHelper and simplifies helper selection logic. |
| src/coreclr/jit/lowerxarch.cpp | Adds x86 lowering sequence for uint→floating casts without helper calls (pre-AVX-512 path). |
| src/coreclr/jit/importer.cpp | Replaces ad-hoc helper decision logic with fgCastRequiresHelper. |
| src/coreclr/jit/flowgraph.cpp | Introduces fgCastRequiresHelper implementation. |
| src/coreclr/jit/decomposelongs.cpp | Minor refactor/clarification for AVX-512 long→floating cast decomposition. |
| src/coreclr/jit/compiler.h | Declares fgCastRequiresHelper. |
Member
Author
|
@dotnet/jit-contrib this is ready for review. Diffs show an odd throughput regression for Windows x64. Looks like it might just be lack of /LTCG? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is another one peeled from #116805 (only one more to go after this 😄)
It takes care of uint->floating casts without a helper call on pre-AVX-512 x86. Since baseline x86 is the only platform without native instructions for all 32-bit conversions, adding this allows some more simplification in
fgMorphExpandCastTypical diff: