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

[API Proposal]: Arm64: FEAT_SVE_BitPerm #94424

Open
a74nh opened this issue Nov 6, 2023 · 2 comments
Open

[API Proposal]: Arm64: FEAT_SVE_BitPerm #94424

a74nh opened this issue Nov 6, 2023 · 2 comments
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation arch-arm64 area-System.Runtime.Intrinsics
Milestone

Comments

@a74nh
Copy link
Contributor

a74nh commented Nov 6, 2023

namespace System.Runtime.Intrinsics.Arm

/// VectorT Summary
public abstract class SveBitperm : AdvSimd /// Feature: FEAT_SVE_BitPerm
{

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<T> left, Vector<T> right); // BEXT

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<T> left, Vector<T> right); // BGRP

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<T> left, Vector<T> right); // BDEP

  /// total method signatures: 3


  /// Optional Entries:

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<T> left, T right); // BEXT

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<T> left, T right); // BGRP

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<T> left, T right); // BDEP

  /// total optional method signatures: 3

}


/// Full API
public abstract class SveBitperm : AdvSimd /// Feature: FEAT_SVE_BitPerm
{
    /// GatherLowerBitsFromPositionsSelectedByBitmask : Gather lower bits from positions selected by bitmask

    /// svuint8_t svbext[_u8](svuint8_t op1, svuint8_t op2) : "BEXT Zresult.B, Zop1.B, Zop2.B"
  public static unsafe Vector<byte> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<byte> left, Vector<byte> right);

    /// svuint16_t svbext[_u16](svuint16_t op1, svuint16_t op2) : "BEXT Zresult.H, Zop1.H, Zop2.H"
  public static unsafe Vector<ushort> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ushort> left, Vector<ushort> right);

    /// svuint32_t svbext[_u32](svuint32_t op1, svuint32_t op2) : "BEXT Zresult.S, Zop1.S, Zop2.S"
  public static unsafe Vector<uint> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<uint> left, Vector<uint> right);

    /// svuint64_t svbext[_u64](svuint64_t op1, svuint64_t op2) : "BEXT Zresult.D, Zop1.D, Zop2.D"
  public static unsafe Vector<ulong> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ulong> left, Vector<ulong> right);


    /// GroupBitsToRightOrLeftAsSelectedByBitmask : Group bits to right or left as selected by bitmask

    /// svuint8_t svbgrp[_u8](svuint8_t op1, svuint8_t op2) : "BGRP Zresult.B, Zop1.B, Zop2.B"
  public static unsafe Vector<byte> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<byte> left, Vector<byte> right);

    /// svuint16_t svbgrp[_u16](svuint16_t op1, svuint16_t op2) : "BGRP Zresult.H, Zop1.H, Zop2.H"
  public static unsafe Vector<ushort> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ushort> left, Vector<ushort> right);

    /// svuint32_t svbgrp[_u32](svuint32_t op1, svuint32_t op2) : "BGRP Zresult.S, Zop1.S, Zop2.S"
  public static unsafe Vector<uint> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<uint> left, Vector<uint> right);

    /// svuint64_t svbgrp[_u64](svuint64_t op1, svuint64_t op2) : "BGRP Zresult.D, Zop1.D, Zop2.D"
  public static unsafe Vector<ulong> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ulong> left, Vector<ulong> right);


    /// ScatterLowerBitsIntoPositionsSelectedByBitmask : Scatter lower bits into positions selected by bitmask

    /// svuint8_t svbdep[_u8](svuint8_t op1, svuint8_t op2) : "BDEP Zresult.B, Zop1.B, Zop2.B"
  public static unsafe Vector<byte> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<byte> left, Vector<byte> right);

    /// svuint16_t svbdep[_u16](svuint16_t op1, svuint16_t op2) : "BDEP Zresult.H, Zop1.H, Zop2.H"
  public static unsafe Vector<ushort> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ushort> left, Vector<ushort> right);

    /// svuint32_t svbdep[_u32](svuint32_t op1, svuint32_t op2) : "BDEP Zresult.S, Zop1.S, Zop2.S"
  public static unsafe Vector<uint> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<uint> left, Vector<uint> right);

    /// svuint64_t svbdep[_u64](svuint64_t op1, svuint64_t op2) : "BDEP Zresult.D, Zop1.D, Zop2.D"
  public static unsafe Vector<ulong> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ulong> left, Vector<ulong> right);


  /// total method signatures: 12
  /// total method names:      3
}

  /// Optional Entries:
  ///   public static unsafe Vector<byte> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<byte> left, byte right); // svbext[_n_u8]
  ///   public static unsafe Vector<ushort> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ushort> left, ushort right); // svbext[_n_u16]
  ///   public static unsafe Vector<uint> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<uint> left, uint right); // svbext[_n_u32]
  ///   public static unsafe Vector<ulong> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ulong> left, ulong right); // svbext[_n_u64]
  ///   public static unsafe Vector<byte> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<byte> left, byte right); // svbgrp[_n_u8]
  ///   public static unsafe Vector<ushort> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ushort> left, ushort right); // svbgrp[_n_u16]
  ///   public static unsafe Vector<uint> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<uint> left, uint right); // svbgrp[_n_u32]
  ///   public static unsafe Vector<ulong> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ulong> left, ulong right); // svbgrp[_n_u64]
  ///   public static unsafe Vector<byte> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<byte> left, byte right); // svbdep[_n_u8]
  ///   public static unsafe Vector<ushort> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ushort> left, ushort right); // svbdep[_n_u16]
  ///   public static unsafe Vector<uint> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<uint> left, uint right); // svbdep[_n_u32]
  ///   public static unsafe Vector<ulong> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ulong> left, ulong right); // svbdep[_n_u64]
  ///   Total Maybe: 12

  /// Total ACLE covered across API:      24
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 6, 2023
@ghost
Copy link

ghost commented Nov 6, 2023

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

Issue Details
namespace System.Runtime.Intrinsics.Arm

/// VectorT Summary
public abstract class SveBitperm : AdvSimd /// Feature: FEAT_SVE_BitPerm
{

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<T> left, Vector<T> right); // BEXT

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<T> left, Vector<T> right); // BGRP

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<T> left, Vector<T> right); // BDEP

  /// total method signatures: 3


  /// Optional Entries:

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<T> left, T right); // BEXT

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<T> left, T right); // BGRP

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<T> left, T right); // BDEP

  /// total optional method signatures: 3

}


/// Full API
public abstract class SveBitperm : AdvSimd /// Feature: FEAT_SVE_BitPerm
{
    /// GatherLowerBitsFromPositionsSelectedByBitmask : Gather lower bits from positions selected by bitmask

    /// svuint8_t svbext[_u8](svuint8_t op1, svuint8_t op2) : "BEXT Zresult.B, Zop1.B, Zop2.B"
  public static unsafe Vector<byte> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<byte> left, Vector<byte> right);

    /// svuint16_t svbext[_u16](svuint16_t op1, svuint16_t op2) : "BEXT Zresult.H, Zop1.H, Zop2.H"
  public static unsafe Vector<ushort> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ushort> left, Vector<ushort> right);

    /// svuint32_t svbext[_u32](svuint32_t op1, svuint32_t op2) : "BEXT Zresult.S, Zop1.S, Zop2.S"
  public static unsafe Vector<uint> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<uint> left, Vector<uint> right);

    /// svuint64_t svbext[_u64](svuint64_t op1, svuint64_t op2) : "BEXT Zresult.D, Zop1.D, Zop2.D"
  public static unsafe Vector<ulong> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ulong> left, Vector<ulong> right);


    /// GroupBitsToRightOrLeftAsSelectedByBitmask : Group bits to right or left as selected by bitmask

    /// svuint8_t svbgrp[_u8](svuint8_t op1, svuint8_t op2) : "BGRP Zresult.B, Zop1.B, Zop2.B"
  public static unsafe Vector<byte> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<byte> left, Vector<byte> right);

    /// svuint16_t svbgrp[_u16](svuint16_t op1, svuint16_t op2) : "BGRP Zresult.H, Zop1.H, Zop2.H"
  public static unsafe Vector<ushort> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ushort> left, Vector<ushort> right);

    /// svuint32_t svbgrp[_u32](svuint32_t op1, svuint32_t op2) : "BGRP Zresult.S, Zop1.S, Zop2.S"
  public static unsafe Vector<uint> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<uint> left, Vector<uint> right);

    /// svuint64_t svbgrp[_u64](svuint64_t op1, svuint64_t op2) : "BGRP Zresult.D, Zop1.D, Zop2.D"
  public static unsafe Vector<ulong> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ulong> left, Vector<ulong> right);


    /// ScatterLowerBitsIntoPositionsSelectedByBitmask : Scatter lower bits into positions selected by bitmask

    /// svuint8_t svbdep[_u8](svuint8_t op1, svuint8_t op2) : "BDEP Zresult.B, Zop1.B, Zop2.B"
  public static unsafe Vector<byte> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<byte> left, Vector<byte> right);

    /// svuint16_t svbdep[_u16](svuint16_t op1, svuint16_t op2) : "BDEP Zresult.H, Zop1.H, Zop2.H"
  public static unsafe Vector<ushort> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ushort> left, Vector<ushort> right);

    /// svuint32_t svbdep[_u32](svuint32_t op1, svuint32_t op2) : "BDEP Zresult.S, Zop1.S, Zop2.S"
  public static unsafe Vector<uint> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<uint> left, Vector<uint> right);

    /// svuint64_t svbdep[_u64](svuint64_t op1, svuint64_t op2) : "BDEP Zresult.D, Zop1.D, Zop2.D"
  public static unsafe Vector<ulong> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ulong> left, Vector<ulong> right);


  /// total method signatures: 12
  /// total method names:      3
}

  /// Optional Entries:
  ///   public static unsafe Vector<byte> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<byte> left, byte right); // svbext[_n_u8]
  ///   public static unsafe Vector<ushort> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ushort> left, ushort right); // svbext[_n_u16]
  ///   public static unsafe Vector<uint> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<uint> left, uint right); // svbext[_n_u32]
  ///   public static unsafe Vector<ulong> GatherLowerBitsFromPositionsSelectedByBitmask(Vector<ulong> left, ulong right); // svbext[_n_u64]
  ///   public static unsafe Vector<byte> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<byte> left, byte right); // svbgrp[_n_u8]
  ///   public static unsafe Vector<ushort> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ushort> left, ushort right); // svbgrp[_n_u16]
  ///   public static unsafe Vector<uint> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<uint> left, uint right); // svbgrp[_n_u32]
  ///   public static unsafe Vector<ulong> GroupBitsToRightOrLeftAsSelectedByBitmask(Vector<ulong> left, ulong right); // svbgrp[_n_u64]
  ///   public static unsafe Vector<byte> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<byte> left, byte right); // svbdep[_n_u8]
  ///   public static unsafe Vector<ushort> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ushort> left, ushort right); // svbdep[_n_u16]
  ///   public static unsafe Vector<uint> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<uint> left, uint right); // svbdep[_n_u32]
  ///   public static unsafe Vector<ulong> ScatterLowerBitsIntoPositionsSelectedByBitmask(Vector<ulong> left, ulong right); // svbdep[_n_u64]
  ///   Total Maybe: 12

  /// Total ACLE covered across API:      24
Author: a74nh
Assignees: -
Labels:

area-System.Runtime.Intrinsics

Milestone: -

@a74nh
Copy link
Contributor Author

a74nh commented Nov 6, 2023

This contributes to #93095

It covers all of the instructions in FEAT_SVE_BitPerm.
This list was auto generated from the C ACLE for SVE, and is in three parts:

The methods list reduced down to Vector versions. All possible varaints of T are given above the method.
The complete list of all methods. The corresponding ACLE methods and SVE instructions are given above the method.
All rejected ACLE methods. These are methods we have agreed that do not need including in C#.
Where possible, existing C# naming conventions have been matched.

Many of the C functions include predicate argument(s), of type svbool_t as the first argument. These are missing from the C# method. It is expected that the Jit will create predicates where required, or combine with uses of conditionalSelect(). For more discussion see #88140 comment.

@kunalspathak kunalspathak added the api-ready-for-review API is ready for review, it is NOT ready for implementation label Feb 7, 2024
@kunalspathak kunalspathak added this to the Future milestone May 1, 2024
@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label May 3, 2024
@tannergooding tannergooding added api-suggestion Early API idea and discussion, it is NOT ready for implementation arch-arm64 and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation arch-arm64 area-System.Runtime.Intrinsics
Projects
None yet
Development

No branches or pull requests

4 participants