Skip to content

Conversation

@a74nh
Copy link
Contributor

@a74nh a74nh commented Jan 7, 2026

Fixes #122728

Copilot AI review requested due to automatic review settings January 7, 2026 16:20
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 7, 2026
@a74nh
Copy link
Contributor Author

a74nh commented Jan 7, 2026

@dotnet/arm64-contrib

@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.

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 refactors overflow detection and saturating arithmetic helper methods in the ARM hardware intrinsics test helpers. It replaces multiple type-specific implementations with generic methods using IBinaryInteger<T> and BigInteger for accurate overflow detection.

Key changes:

  • Consolidates duplicate overflow detection logic into generic methods
  • Fixes overflow detection bugs by using BigInteger for precise range checking
  • Reduces code duplication across sbyte, short, int, and long types

@a74nh
Copy link
Contributor Author

a74nh commented Jan 13, 2026

Re-wrote the mixed signed unsigned helpers. Called down to the other helpers where we can to simplify logic. Had to use TUnsigned.AllBitsSet because checking against TSigned.MaxValue errors with static abstract interface members issues. Added asserts to check the types are the same size.

@a74nh
Copy link
Contributor Author

a74nh commented Jan 13, 2026

Got some failures to fix up....

@tannergooding tannergooding merged commit ee0778f into dotnet:main Jan 14, 2026
87 checks passed
@a74nh a74nh deleted the saturate_github branch January 14, 2026 17:18
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.

Test failure: _Sve_ro::JIT.HardwareIntrinsics.Arm._Sve.Program.Sve_AddSaturate_short()

2 participants