Skip to content

[API Proposal]: Arm64: FEAT_SVE: mask part 2 #98184

Description

@tannergooding

This is a continuation of #93964

namespace System.Runtime.Intrinsics.Arm;

/// VectorT Summary
public abstract partial class Sve : AdvSimd /// Feature: FEAT_SVE  Category: mask
{
  /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> ConditionalSelect(Vector<T> mask, Vector<T> left, Vector<T> right); // SEL

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateBreakAfterMask(Vector<T> mask, Vector<T> from); // BRKA // predicated

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateBreakAfterPropagateMask(Vector<T> mask, Vector<T> left, Vector<T> right); // BRKPA

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateBreakBeforeMask(Vector<T> mask, Vector<T> from); // BRKB // predicated

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateBreakBeforePropagateMask(Vector<T> mask, Vector<T> left, Vector<T> right); // BRKPB

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateWhileLessThanMask(int left, int right); // WHILELT

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateWhileLessThanMask(long left, long right); // WHILELT

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

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

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateWhileLessThanOrEqualMask(int left, int right); // WHILELE

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> CreateWhileLessThanOrEqualMask(long left, long right); // WHILELE

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

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

  /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe T ExtractAfterLast(Vector<T> value); // LASTA // predicated

  /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe T ExtractLast(Vector<T> value); // LASTB // predicated

  /// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> ExtractVector(Vector<T> upper, Vector<T> lower, ulong index); // EXT // MOVPRFX

  public static unsafe Vector<byte> FalseMask(); // PFALSE

  /// T: byte, ushort, uint, ulong
  public static unsafe Vector<T> MaskGetFirstSet(Vector<T> mask, Vector<T> from); // PNEXT

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> MaskSetFirst(Vector<T> mask, Vector<T> from); // PFIRST

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe bool MaskTestAnyTrue(Vector<T> mask, Vector<T> from); // PTEST

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe bool MaskTestFirstTrue(Vector<T> mask, Vector<T> from); // PTEST

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe bool MaskTestLastTrue(Vector<T> mask, Vector<T> from); // PTEST

  /// T: sbyte, short, int, long, byte, ushort, uint, ulong
  public static unsafe Vector<T> PropagateBreak(Vector<T> left, Vector<T> right); // BRKN // predicated

  public static unsafe Vector<byte> TrueMask(); // PTRUE

  public static unsafe Vector<byte> TrueMask([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All); // PTRUE


  // All patterns used by PTRUE.
  public enum SveMaskPattern : byte
  {
    LargestPowerOf2 = 0,   // The largest power of 2.
    VectorCount1 = 1,    // 1 element.
    VectorCount2 = 2,    // 2 elements.
    VectorCount3 = 3,    // 3 elements.
    VectorCount4 = 4,    // 4 elements.
    VectorCount5 = 5,    // 5 elements.
    VectorCount6 = 6,    // 6 elements.
    VectorCount7 = 7,    // 7 elements.
    VectorCount8 = 8,    // 8 elements.
    VectorCount16 = 9,   // 16 elements.
    VectorCount32 = 10,  // 32 elements.
    VectorCount64 = 11,  // 64 elements.
    VectorCount128 = 12, // 128 elements.
    VectorCount256 = 13, // 256 elements.
    LargestMultipleOf4 = 29,  // The largest multiple of 4.
    LargestMultipleOf3 = 30,  // The largest multiple of 3.
    All  = 31    // All available (implicitly a multiple of two).
  };

  /// total method signatures: 45
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions