Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

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

Closed

Description

@jeffhandley

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

Activity

  1. added
    breaking-change
    on Mar 20, 2024
  2. added
    source incompatible
    ⌚ Not Triaged
    on Mar 20, 2024
  3. added
    🗺️ reQUEST
    on Apr 29, 2024
  4. added
    📌 seQUESTered
    and removed
    🗺️ reQUEST
    on Apr 30, 2024
  5. moved this from 🔖 Ready to 🏗 In progress in dotnet/docs May 2024 sprinton May 9, 2024
  6. moved this from 🏗 In progress to 👀 In review in dotnet/docs May 2024 sprinton May 9, 2024
  7. moved this from 👀 In review to ✅ Done in dotnet/docs May 2024 sprinton May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

📌 seQUESTeredbreaking-changesource incompatible

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions