-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix intrinsic testing add and subtract overflow helpers #122977
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
Conversation
|
@dotnet/arm64-contrib |
|
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
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 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
BigIntegerfor precise range checking - Reduces code duplication across sbyte, short, int, and long types
|
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. |
|
Got some failures to fix up.... |
Fixes #122728