Skip to content
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

[Breaking change]: Signed AdvSimd.ShiftRightLogicalRoundedNarrowingSaturate* methods marked as obsolete #40141

Closed
1 of 3 tasks
jeffhandley opened this issue Mar 20, 2024 · 0 comments · Fixed by #40834
Closed
1 of 3 tasks
Assignees
Labels
breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest. source incompatible Source code may encounter a breaking change in behavior when targeting the new version.

Comments

@jeffhandley
Copy link
Member

jeffhandley commented Mar 20, 2024

Description

The Arm Advanced SIMD UQRSHRN instruction performs an unsigned saturated narrow operation. As such, its result is always unsigned. However, the .NET intrinsics API for this instruction includes overloads that accept and return signed types.

These overloads will not work as expected if following the API description rather than the instruction description. Because the underlying implementation cannot be corrected to perform signed saturated narrow operations and return signed results, the methods are now marked as [Obsolete] with a message indicating the unsigned overloads should be used instead.

Version

.NET 9 Preview 4

Previous behavior

The methods would perform unsigned saturated narrow operations, even when operating on and returning signed types.

New behavior

The overloads are marked as [Obsolete] with a message citing the unexpected behavior. Build warnings will be produced if the obsolete overloads are used.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

These overloads will not work as expected if following the API description rather than the instruction description. Because the underlying implementation cannot be corrected to perform signed saturated narrow operations and return signed results, the methods are now marked as [Obsolete] with a message indicating the unsigned overloads should be used instead.

Recommended action

Call the unsigned method overloads instead, intentionally converting the data to/from unsigned types as needed.

Feature area

Core .NET libraries

Affected APIs

  1. System.Runtime.Intrinsics.Arm.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(Vector64<short> value, [ConstantExpected(Min = 1, Max = (byte)(32))] byte count)
  2. System.Runtime.Intrinsics.Arm.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(Vector64<int> value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte count)
  3. System.Runtime.Intrinsics.Arm.Arm64.ShiftRightLogicalRoundedNarrowingSaturateScalar(Vector64<long> value, [ConstantExpected(Min = 1, Max = (byte)(8))] byte count)
  4. System.Runtime.Intrinsics.Arm.ShiftRightLogicalRoundedNarrowingSaturateLower(Vector128<short> value, [ConstantExpected(Min = 1, Max = (byte)(64))] byte count)
  5. System.Runtime.Intrinsics.Arm.ShiftRightLogicalRoundedNarrowingSaturateLower(Vector128<int> value, [ConstantExpected(Min = 1, Max = (byte)(32))] byte count)
  6. System.Runtime.Intrinsics.Arm.ShiftRightLogicalRoundedNarrowingSaturateLower(Vector128<long> value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte count)
  7. System.Runtime.Intrinsics.Arm.ShiftRightLogicalRoundedNarrowingSaturateUpper(Vector64<sbyte> lower, Vector128<short> value, [ConstantExpected(Min = 1, Max = (byte)(64))] byte count)
  8. System.Runtime.Intrinsics.Arm.ShiftRightLogicalRoundedNarrowingSaturateUpper(Vector64<short> lower, Vector128<int> value, [ConstantExpected(Min = 1, Max = (byte)(32))] byte count)
  9. System.Runtime.Intrinsics.Arm.ShiftRightLogicalRoundedNarrowingSaturateUpper(Vector64<int> lower, Vector128<long> value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte count)

Associated WorkItem - 250220

@jeffhandley jeffhandley added doc-idea Indicates issues that are suggestions for new topics [org][type][category] breaking-change Indicates a .NET Core breaking change Pri1 High priority, do before Pri2 and Pri3 labels Mar 20, 2024
@dotnet-bot dotnet-bot added source incompatible Source code may encounter a breaking change in behavior when targeting the new version. ⌚ Not Triaged Not triaged labels Mar 20, 2024
@gewarren gewarren added the 🗺️ reQUEST Triggers an issue to be imported into Quest. label Apr 29, 2024
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Apr 30, 2024
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest. source incompatible Source code may encounter a breaking change in behavior when targeting the new version.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants