Fix intrinsic testing add and subtract overflow helpers#122977
Fix intrinsic testing add and subtract overflow helpers#122977tannergooding merged 9 commits intodotnet:mainfrom
Conversation
|
@dotnet/arm64-contrib |
|
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
There was a problem hiding this comment.
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