Skip to content

[API Proposal]: SVE2 API for UQSHRNB and UQSHRNT #122022

@a74nh

Description

@a74nh

Background and motivation

Based on this comment.

The following was approved in #94015

  /// T: [sbyte, short], [short, int], [int, long], [byte, ushort], [ushort, uint], [uint, ulong]
  public static unsafe Vector<T>  ShiftRightArithmeticNarrowingSaturateEven(Vector<T2> value, [ConstantExpected] byte count); // SQSHRNB or UQSHRNB

  /// T: [sbyte, short], [short, int], [int, long], [byte, ushort], [ushort, uint], [uint, ulong]
  public static unsafe Vector<T>  ShiftRightArithmeticNarrowingSaturateOdd(Vector<T> even, Vector<T2> value, [ConstantExpected] byte count); // SQSHRNT or UQSHRNT

Only these were implemented:

  /// T: [sbyte, short], [short, int], [int, long]
  public static unsafe Vector<T>  ShiftRightArithmeticNarrowingSaturateEven(Vector<T2> value, [ConstantExpected] byte count); // SQSHRNB

  /// T: [sbyte, short], [short, int], [int, long]
  public static unsafe Vector<T>  ShiftRightArithmeticNarrowingSaturateOdd(Vector<T> even, Vector<T2> value, [ConstantExpected] byte count); // SQSHRNT

The unsigned version should be a different API

API Proposal

namespace System.Runtime.Intrinsics.Arm

 /// T: [byte, ushort], [ushort, uint], [uint, ulong]
  public static unsafe Vector<T>  ShiftRightLogicalNarrowingSaturateEven(Vector<T2> value, [ConstantExpected] byte count); // UQSHRNB

  /// T: [byte, ushort], [ushort, uint], [uint, ulong]
  public static unsafe Vector<T>  ShiftRightLogicalNarrowingSaturateOdd(Vector<T> even, Vector<T2> value, [ConstantExpected] byte count); // UQSHRNT

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions