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

JIT ARM64-SVE: Add Sve.CreateFalseMask*() #102076

Merged
merged 6 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/coreclr/jit/hwintrinsiccodegenarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)

switch (intrin.numOperands)
{
case 0:
GetEmitter()->emitIns_R(ins, emitSize, targetReg, opt);
break;
case 1:
GetEmitter()->emitIns_R_R(ins, emitSize, targetReg, op1Reg, opt);
break;
Expand Down
10 changes: 10 additions & 0 deletions src/coreclr/jit/hwintrinsiclistarm64sve.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ HARDWARE_INTRINSIC(Sve, Count16BitElements,
HARDWARE_INTRINSIC(Sve, Count32BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cntw, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed)
HARDWARE_INTRINSIC(Sve, Count64BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cntd, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed)
HARDWARE_INTRINSIC(Sve, Count8BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cntb, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskByte, -1, 0, false, {INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskDouble, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskInt16, -1, 0, false, {INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskInt32, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskInt64, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskSByte, -1, 0, false, {INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskSingle, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskUInt16, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskUInt32, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateFalseMaskUInt64, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateTrueMaskByte, -1, 1, false, {INS_invalid, INS_sve_ptrue, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateTrueMaskDouble, -1, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_ptrue}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_ReturnsPerElementMask)
HARDWARE_INTRINSIC(Sve, CreateTrueMaskInt16, -1, 1, false, {INS_invalid, INS_invalid, INS_sve_ptrue, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_ReturnsPerElementMask)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,96 @@ internal Arm64() { }
public static unsafe ulong Count8BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.


/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<byte> CreateFalseMaskByte() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<double> CreateFalseMaskDouble() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<short> CreateFalseMaskInt16() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<int> CreateFalseMaskInt32() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<long> CreateFalseMaskInt64() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<sbyte> CreateFalseMaskSByte() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<float> CreateFalseMaskSingle() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<ushort> CreateFalseMaskUInt16() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<uint> CreateFalseMaskUInt32() { throw new PlatformNotSupportedException(); }


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<ulong> CreateFalseMaskUInt64() { throw new PlatformNotSupportedException(); }


/// CreateTrueMaskByte : Set predicate elements to true

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,96 @@ internal Arm64() { }
public static unsafe ulong Count8BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => Count8BitElements(pattern);


/// Set all predicate elements to false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This should really be written just once, just as we do for e.g. in /// BitwiseClear : Bitwise clear or /// BooleanNot : Logically invert boolean condition. Same applies for CreateTrue* APIs. @mikabl-arm - do you mind fixing it in your next PR please?


/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<byte> CreateFalseMaskByte() => CreateFalseMaskByte();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<double> CreateFalseMaskDouble() => CreateFalseMaskDouble();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<short> CreateFalseMaskInt16() => CreateFalseMaskInt16();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<int> CreateFalseMaskInt32() => CreateFalseMaskInt32();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<long> CreateFalseMaskInt64() => CreateFalseMaskInt64();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<sbyte> CreateFalseMaskSByte() => CreateFalseMaskSByte();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<float> CreateFalseMaskSingle() => CreateFalseMaskSingle();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<ushort> CreateFalseMaskUInt16() => CreateFalseMaskUInt16();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<uint> CreateFalseMaskUInt32() => CreateFalseMaskUInt32();


/// Set all predicate elements to false

/// <summary>
/// svbool_t svpfalse[_b]()
/// PFALSE Presult.B
/// </summary>
public static unsafe Vector<ulong> CreateFalseMaskUInt64() => CreateFalseMaskUInt64();


/// CreateTrueMaskByte : Set predicate elements to true

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4247,6 +4247,16 @@ internal Arm64() { }
public static System.Numerics.Vector<ulong> ConditionalSelect(System.Numerics.Vector<ulong> mask, System.Numerics.Vector<ulong> left, System.Numerics.Vector<ulong> right) { throw null; }
public static System.Numerics.Vector<float> ConditionalSelect(System.Numerics.Vector<float> mask, System.Numerics.Vector<float> left, System.Numerics.Vector<float> right) { throw null; }
public static System.Numerics.Vector<double> ConditionalSelect(System.Numerics.Vector<double> mask, System.Numerics.Vector<double> left, System.Numerics.Vector<double> right) { throw null; }
public static System.Numerics.Vector<byte> CreateFalseMaskByte() { throw null; }
public static System.Numerics.Vector<double> CreateFalseMaskDouble() { throw null; }
public static System.Numerics.Vector<short> CreateFalseMaskInt16() { throw null; }
public static System.Numerics.Vector<int> CreateFalseMaskInt32() { throw null; }
public static System.Numerics.Vector<long> CreateFalseMaskInt64() { throw null; }
public static System.Numerics.Vector<sbyte> CreateFalseMaskSByte() { throw null; }
public static System.Numerics.Vector<float> CreateFalseMaskSingle() { throw null; }
public static System.Numerics.Vector<ushort> CreateFalseMaskUInt16() { throw null; }
public static System.Numerics.Vector<uint> CreateFalseMaskUInt32() { throw null; }
public static System.Numerics.Vector<ulong> CreateFalseMaskUInt64() { throw null; }
public static System.Numerics.Vector<byte> CreateTrueMaskByte([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; }
public static System.Numerics.Vector<double> CreateTrueMaskDouble([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; }
public static System.Numerics.Vector<short> CreateTrueMaskInt16([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; }
Expand Down
Loading
Loading