Skip to content

Comments

Rename SVE2 AddSaturate signed/unsigned addend API#122283

Merged
tannergooding merged 6 commits intodotnet:mainfrom
ylpoonlg:github-sve2_addsaturate
Feb 17, 2026
Merged

Rename SVE2 AddSaturate signed/unsigned addend API#122283
tannergooding merged 6 commits intodotnet:mainfrom
ylpoonlg:github-sve2_addsaturate

Conversation

@ylpoonlg
Copy link
Contributor

@ylpoonlg ylpoonlg commented Dec 8, 2025

Fixes #121961.

Rename Sve2.AddSaturateWithUnsignedAddend/AddSaturateWithSignedAddend to Sve2.AddSaturate so that it aligns with the approved SVE2 API.

Since the Sve2.AddSaturate intrinsic is used for multiple instructions, special intrinsics are used internally for the signed/unsigned addend variants. The AddSaturate intrinsic is marked with the SpecialImport flag so that the actual instruction can be decided based on the operand types during importing.

@dotnet/arm64-contrib @a74nh

Rename Sve2.AddSaturateWithUnsignedAddend/AddSaturateWithSignedAddend to
Sve2.AddSaturate so that it aligns with the approved SVE2 API.
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 8, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

Generated when building with `/p:ApiCompatGenerateSuppressionFile=true`.
Copy link
Contributor

@a74nh a74nh left a comment

Choose a reason for hiding this comment

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

LGTM now.
CI failures are CI issues - can't find spmidiff

Copy link
Contributor

@dhartglassMSFT dhartglassMSFT left a comment

Choose a reason for hiding this comment

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

I reviewed the files under jit/

lgtm

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

LGTM other than the compat suppressions

@jeffhandley
Copy link
Member

/ba-g BadExit on an ios test

Copy link
Contributor

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 PR updates the ARM64 SVE2 public API to match the approved design by consolidating the previously split saturating-add APIs (signed/unsigned addend variants) under a single Sve2.AddSaturate name, and adjusts the JIT/import/codegen and test generation accordingly.

Changes:

  • Rename Sve2.AddSaturateWithSignedAddend / Sve2.AddSaturateWithUnsignedAddend to additional overloads of Sve2.AddSaturate (public API + implementation + PNSE stubs).
  • Teach the CoreCLR ARM64 JIT to treat Sve2.AddSaturate as a special-import intrinsic and select SQADD/UQADD vs USQADD/SUQADD based on operand element types during import/codegen.
  • Update HWIntrinsic test generation inputs and add ApiCompat suppressions for the removed APIs.

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.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.cs Replaces the two specialized public APIs with AddSaturate overloads for mixed signed/unsigned addends; minor doc cleanup/reordering.
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs Mirrors the public API rename for non-supported platforms.
src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs Updates the reference surface to remove the old method names and add the new overloads.
src/coreclr/jit/hwintrinsiclistarm64sve.h Collapses the intrinsic IDs into Sve2.AddSaturate and marks it for special import/codegen.
src/coreclr/jit/hwintrinsicarm64.cpp Implements special-import handling to record operand-type info (aux type) for Sve2.AddSaturate.
src/coreclr/jit/hwintrinsiccodegenarm64.cpp Selects the concrete instruction form (SQADD/UQADD vs SUQADD/USQADD) based on operand types and handles optional mask behavior as needed.
src/tests/Common/GenerateHWIntrinsicTests/Arm/Sve2Tests.cs Updates generated test matrix entries to use the renamed API and adds coverage for mixed signed/unsigned addend overloads.
src/libraries/apicompat/ApiCompatBaseline.NetCoreAppLatestStable.xml Adds suppressions for the breaking removal of the old method names.

@tannergooding tannergooding merged commit dad8dcc into dotnet:main Feb 17, 2026
177 of 179 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Runtime.Intrinsics 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.

SVE2: Fixup SVE2 Math/bitmanipulate/FP APIs

5 participants