-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Arm64 SVE: Allow SVE nodes to be treated as generic ops #119352
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
base: main
Are you sure you want to change the base?
Conversation
Enables all standard arithmetic operations. Does not include compare operations.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
I plan on putting compares in a later PR as there is some extra debugging I need to do first. |
|
@tannergooding @EgorBo : I'm happy with this now |
|
We will review .NET 11 PRs when we are done with .NET 10 last minute works and less busy. |
|
Hi @EgorBo , this PR slipped through our radar. Could you take a look at it, please? |
|
@EgorBo, PTAL. |
EgorBo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delayed response, LGTM, let's run Fuzzlyn on this
|
/azp run Fuzzlyn |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this 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 PR enables ARM64 SVE (Scalable Vector Extension) nodes to be treated as generic operations, allowing all standard arithmetic operations to be processed through the common value numbering and optimization paths. The changes align SVE intrinsics with existing AdvSimd intrinsics by mapping them to generic tree operations.
Key Changes
- Added mappings for 13 SVE intrinsics (And, Or, Xor, Not, BitwiseClear, Add, Subtract, Multiply, Divide, Negate, ShiftLeftLogical, ShiftRightArithmetic, ShiftRightLogical) to their corresponding generic tree operations
- Relaxed GT_AND_NOT assertions to allow this operation before lowering on ARM64 (needed for SVE BitwiseClear)
- Added ARM64-specific shift handling for "wide elements" variants using a new NarrowSimdLong template function
- Restructured conditional compilation to check for shift operations before platform-specific code paths
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/coreclr/jit/gentree.cpp | Added SVE intrinsic to generic operation mappings and ARM64 shift narrowing logic; moved GT_AND_NOT assertion to be XARCH-specific |
| src/coreclr/jit/valuenum.cpp | Added ARM64 shift narrowing in value numbering; relaxed GT_AND_NOT assertions across three evaluation functions; restructured shift handling to be checked before platform-specific conditionals |
| src/coreclr/jit/simd.h | Added NarrowSimdLong template functions to handle narrowing of uint64_t vector elements to smaller types during shift operations |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
This looks like it might be missing some handling in In particular, looks like we have a lack of handling in It's possible there is "more" work to be done here too, so that all the end to end transforms can light up, but that should be the bulk of it. |
Head branch was pushed to by a user without write access
What is happening right now is that it ends up with a NI_AdvSimd_Arm64_BitwiseClear` node:
In both cases, because the size is Once SVE is variable then yes we will need SVE nodes. I've added a few asserts on the sizes so that these are caught later down the line. Alternatively, we could pause this to post variable length SVE. |
Enables all standard arithmetic operations.
Does not include compare operations.