[SVE2] CreateWhileWriteAfterRead* and SaturatingExtract*#128233
Open
dhartglassMSFT wants to merge 10 commits into
Open
[SVE2] CreateWhileWriteAfterRead* and SaturatingExtract*#128233dhartglassMSFT wants to merge 10 commits into
dhartglassMSFT wants to merge 10 commits into
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the SVE2 CreateWhileWriteAfterReadMask* (WHILEWR) intrinsic family alongside the existing CreateWhileReadAfterWriteMask* (WHILERW) family, and extends the shared test template to cover both, including a new "reverse offset by one" scenario that exercises the asymmetric behavior between the two instructions.
Changes:
- Adds 10 new
CreateWhileWriteAfterReadMask{Type}public APIs (Sve2) in ref assembly, the throwing PlatformNotSupported stubs, and the recursive forwarding stubs inSve2.cs. - Wires up the new intrinsics in
hwintrinsiclistarm64sve.h(mapping each base type toINS_sve_whilewr) and extends theEA_8BYTEpointer-operand codegen case inhwintrinsiccodegenarm64.cppto cover the new IDs. - Renames the shared SVE RW test template to
SveCreateWhileDependencyMaskTest, parameterizes it withIsWriteAfterRead, adds aRunReverseOffsetByOneScenariodistinguishing WHILEWR vs WHILERW, and adds 10 generator entries for the new WHILEWR tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs | Adds 10 new ref APIs for CreateWhileWriteAfterReadMask*. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs | Adds throwing stubs and XML docs for the new intrinsics. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.cs | Adds the runtime intrinsic forwarding entry points. |
| src/coreclr/jit/hwintrinsiclistarm64sve.h | Registers the 10 new intrinsic IDs mapped to INS_sve_whilewr per base type. |
| src/coreclr/jit/hwintrinsiccodegenarm64.cpp | Routes the new IDs through the existing 64-bit pointer codegen path (comment updated to WHILERW/WHILEWR). |
| src/tests/Common/GenerateHWIntrinsicTests/Arm/Templates.cs | Renames the template config to SveCreateWhileDependencyMaskTest. |
| src/tests/Common/GenerateHWIntrinsicTests/Arm/Sve2Tests.cs | Updates RW entries with IsWriteAfterRead=false and adds 10 WHILEWR entries with IsWriteAfterRead=true. |
| src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveCreateWhileDependencyMaskTest.template | Renames the test class, adds RunReverseOffsetByOneScenario, and documents the WHILEWR/WHILERW spec semantics. |
This was referenced May 15, 2026
Open
This was referenced May 27, 2026
a74nh
reviewed
May 29, 2026
a74nh
reviewed
May 29, 2026
a74nh
left a comment
Contributor
There was a problem hiding this comment.
Other than the comments above, everything else LGTM
tannergooding
approved these changes
Jun 15, 2026
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.
Reamining missing sve2 mask instructions.
CreateWhileWriteAfterRead*:
Same as CreateWhileReadAfterWriteMask, except this doesn't use Abs(...) to compute ptrdiff. So behavior differs if
op2ptr=op1ptr-1, added a test for that.SaturatingExtract*:
Lower* variants are boilerplate. Upper variants take implicit out param, so it needs special RMW handling. We do similar things for other instructions like AddHighNarrowingOdd (INS_sve_addhnt)