Skip to content

Implement SVE2 ShiftArithmeticRounded, ShiftArithmeticRoundedSaturate, ShiftArithmeticSaturate #115774

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/coreclr/jit/hwintrinsiclistarm64sve.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ HARDWARE_INTRINSIC(Sve, ZipLow,
// SVE2 Intrinsics
#define FIRST_NI_Sve2 NI_Sve2_BitwiseClearXor
HARDWARE_INTRINSIC(Sve2, BitwiseClearXor, -1, 3, {INS_sve_bcax, INS_sve_bcax, INS_sve_bcax, INS_sve_bcax, INS_sve_bcax, INS_sve_bcax, INS_sve_bcax, INS_sve_bcax, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_HasRMWSemantics)
#define LAST_NI_Sve2 NI_Sve2_BitwiseClearXor
HARDWARE_INTRINSIC(Sve2, ShiftArithmeticRounded, -1, -1, {INS_sve_srshl, INS_invalid, INS_sve_srshl, INS_invalid, INS_sve_srshl, INS_invalid, INS_sve_srshl, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics)
HARDWARE_INTRINSIC(Sve2, ShiftArithmeticRoundedSaturate, -1, -1, {INS_sve_sqrshl, INS_invalid, INS_sve_sqrshl, INS_invalid, INS_sve_sqrshl, INS_invalid, INS_sve_sqrshl, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics)
HARDWARE_INTRINSIC(Sve2, ShiftArithmeticSaturate, -1, -1, {INS_sve_sqshl, INS_invalid, INS_sve_sqshl, INS_invalid, INS_sve_sqshl, INS_invalid, INS_sve_sqshl, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics)
#define LAST_NI_Sve2 NI_Sve2_ShiftArithmeticSaturate

// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
// ISA Function name SIMD size NumArg Instructions Category Flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,86 @@ internal Arm64() { }
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
/// </summary>
public static unsafe Vector<ulong> BitwiseClearXor(Vector<ulong> xor, Vector<ulong> value, Vector<ulong> mask) { throw new PlatformNotSupportedException(); }


// Rounding shift left

/// <summary>
/// svint16_t svrshl[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2)
/// SRSHL Ztied1.H, Pg/M, Ztied1.H, Zop2.H
/// </summary>
public static unsafe Vector<short> ShiftArithmeticRounded(Vector<short> value, Vector<short> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint32_t svrshl[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2)
/// SRSHL Ztied1.S, Pg/M, Ztied1.S, Zop2.S
/// </summary>
public static unsafe Vector<int> ShiftArithmeticRounded(Vector<int> value, Vector<int> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint64_t svrshl[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2)
/// SRSHL Ztied1.D, Pg/M, Ztied1.D, Zop2.D
/// </summary>
public static unsafe Vector<long> ShiftArithmeticRounded(Vector<long> value, Vector<long> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint8_t svrshl[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2)
/// SRSHL Ztied1.B, Pg/M, Ztied1.B, Zop2.B
/// </summary>
public static unsafe Vector<sbyte> ShiftArithmeticRounded(Vector<sbyte> value, Vector<sbyte> count) { throw new PlatformNotSupportedException(); }


// Saturating rounding shift left

/// <summary>
/// svint16_t svqrshl[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2)
/// SQRSHL Ztied1.H, Pg/M, Ztied1.H, Zop2.H
/// </summary>
public static unsafe Vector<short> ShiftArithmeticRoundedSaturate(Vector<short> value, Vector<short> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint32_t svqrshl[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2)
/// SQRSHL Ztied1.S, Pg/M, Ztied1.S, Zop2.S
/// </summary>
public static unsafe Vector<int> ShiftArithmeticRoundedSaturate(Vector<int> value, Vector<int> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint64_t svqrshl[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2)
/// SQRSHL Ztied1.D, Pg/M, Ztied1.D, Zop2.D
/// </summary>
public static unsafe Vector<long> ShiftArithmeticRoundedSaturate(Vector<long> value, Vector<long> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint8_t svqrshl[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2)
/// SQRSHL Ztied1.B, Pg/M, Ztied1.B, Zop2.B
/// </summary>
public static unsafe Vector<sbyte> ShiftArithmeticRoundedSaturate(Vector<sbyte> value, Vector<sbyte> count) { throw new PlatformNotSupportedException(); }


// Saturating shift left

/// <summary>
/// svint16_t svqshl[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2)
/// SQSHL Ztied1.H, Pg/M, Ztied1.H, Zop2.H
/// </summary>
public static unsafe Vector<short> ShiftArithmeticSaturate(Vector<short> value, Vector<short> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint32_t svqshl[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2)
/// SQSHL Ztied1.S, Pg/M, Ztied1.S, Zop2.S
/// </summary>
public static unsafe Vector<int> ShiftArithmeticSaturate(Vector<int> value, Vector<int> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint64_t svqshl[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2)
/// SQSHL Ztied1.D, Pg/M, Ztied1.D, Zop2.D
/// </summary>
public static unsafe Vector<long> ShiftArithmeticSaturate(Vector<long> value, Vector<long> count) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint8_t svqshl[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2)
/// SQSHL Ztied1.B, Pg/M, Ztied1.B, Zop2.B
/// </summary>
public static unsafe Vector<sbyte> ShiftArithmeticSaturate(Vector<sbyte> value, Vector<sbyte> count) { throw new PlatformNotSupportedException(); }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,86 @@ internal Arm64() { }
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
/// </summary>
public static unsafe Vector<ulong> BitwiseClearXor(Vector<ulong> xor, Vector<ulong> value, Vector<ulong> mask) => BitwiseClearXor(xor, value, mask);


// Rounding shift left

/// <summary>
/// svint16_t svrshl[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2)
/// SRSHL Ztied1.H, Pg/M, Ztied1.H, Zop2.H
/// </summary>
public static unsafe Vector<short> ShiftArithmeticRounded(Vector<short> value, Vector<short> count) => ShiftArithmeticRounded(value, count);

/// <summary>
/// svint32_t svrshl[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2)
/// SRSHL Ztied1.S, Pg/M, Ztied1.S, Zop2.S
/// </summary>
public static unsafe Vector<int> ShiftArithmeticRounded(Vector<int> value, Vector<int> count) => ShiftArithmeticRounded(value, count);

/// <summary>
/// svint64_t svrshl[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2)
/// SRSHL Ztied1.D, Pg/M, Ztied1.D, Zop2.D
/// </summary>
public static unsafe Vector<long> ShiftArithmeticRounded(Vector<long> value, Vector<long> count) => ShiftArithmeticRounded(value, count);

/// <summary>
/// svint8_t svrshl[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2)
/// SRSHL Ztied1.B, Pg/M, Ztied1.B, Zop2.B
/// </summary>
public static unsafe Vector<sbyte> ShiftArithmeticRounded(Vector<sbyte> value, Vector<sbyte> count) => ShiftArithmeticRounded(value, count);


// Saturating rounding shift left

/// <summary>
/// svint16_t svqrshl[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2)
/// SQRSHL Ztied1.H, Pg/M, Ztied1.H, Zop2.H
/// </summary>
public static unsafe Vector<short> ShiftArithmeticRoundedSaturate(Vector<short> value, Vector<short> count) => ShiftArithmeticRoundedSaturate(value, count);

/// <summary>
/// svint32_t svqrshl[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2)
/// SQRSHL Ztied1.S, Pg/M, Ztied1.S, Zop2.S
/// </summary>
public static unsafe Vector<int> ShiftArithmeticRoundedSaturate(Vector<int> value, Vector<int> count) => ShiftArithmeticRoundedSaturate(value, count);

/// <summary>
/// svint64_t svqrshl[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2)
/// SQRSHL Ztied1.D, Pg/M, Ztied1.D, Zop2.D
/// </summary>
public static unsafe Vector<long> ShiftArithmeticRoundedSaturate(Vector<long> value, Vector<long> count) => ShiftArithmeticRoundedSaturate(value, count);

/// <summary>
/// svint8_t svqrshl[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2)
/// SQRSHL Ztied1.B, Pg/M, Ztied1.B, Zop2.B
/// </summary>
public static unsafe Vector<sbyte> ShiftArithmeticRoundedSaturate(Vector<sbyte> value, Vector<sbyte> count) => ShiftArithmeticRoundedSaturate(value, count);


// Saturating shift left

/// <summary>
/// svint16_t svqshl[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2)
/// SQSHL Ztied1.H, Pg/M, Ztied1.H, Zop2.H
/// </summary>
public static unsafe Vector<short> ShiftArithmeticSaturate(Vector<short> value, Vector<short> count) => ShiftArithmeticSaturate(value, count);

/// <summary>
/// svint32_t svqshl[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2)
/// SQSHL Ztied1.S, Pg/M, Ztied1.S, Zop2.S
/// </summary>
public static unsafe Vector<int> ShiftArithmeticSaturate(Vector<int> value, Vector<int> count) => ShiftArithmeticSaturate(value, count);

/// <summary>
/// svint64_t svqshl[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2)
/// SQSHL Ztied1.D, Pg/M, Ztied1.D, Zop2.D
/// </summary>
public static unsafe Vector<long> ShiftArithmeticSaturate(Vector<long> value, Vector<long> count) => ShiftArithmeticSaturate(value, count);

/// <summary>
/// svint8_t svqshl[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2)
/// SQSHL Ztied1.B, Pg/M, Ztied1.B, Zop2.B
/// </summary>
public static unsafe Vector<sbyte> ShiftArithmeticSaturate(Vector<sbyte> value, Vector<sbyte> count) => ShiftArithmeticSaturate(value, count);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6047,6 +6047,18 @@ internal Arm64() { }
public static System.Numerics.Vector<ushort> BitwiseClearXor(System.Numerics.Vector<ushort> xor, System.Numerics.Vector<ushort> value, System.Numerics.Vector<ushort> mask) { throw null; }
public static System.Numerics.Vector<uint> BitwiseClearXor(System.Numerics.Vector<uint> xor, System.Numerics.Vector<uint> value, System.Numerics.Vector<uint> mask) { throw null; }
public static System.Numerics.Vector<ulong> BitwiseClearXor(System.Numerics.Vector<ulong> xor, System.Numerics.Vector<ulong> value, System.Numerics.Vector<ulong> mask) { throw null; }
public static System.Numerics.Vector<short> ShiftArithmeticRounded(System.Numerics.Vector<short> value, System.Numerics.Vector<short> count) { throw null; }
public static System.Numerics.Vector<int> ShiftArithmeticRounded(System.Numerics.Vector<int> value, System.Numerics.Vector<int> count) { throw null; }
public static System.Numerics.Vector<long> ShiftArithmeticRounded(System.Numerics.Vector<long> value, System.Numerics.Vector<long> count) { throw null; }
public static System.Numerics.Vector<sbyte> ShiftArithmeticRounded(System.Numerics.Vector<sbyte> value, System.Numerics.Vector<sbyte> count) { throw null; }
public static System.Numerics.Vector<short> ShiftArithmeticRoundedSaturate(System.Numerics.Vector<short> value, System.Numerics.Vector<short> count) { throw null; }
public static System.Numerics.Vector<int> ShiftArithmeticRoundedSaturate(System.Numerics.Vector<int> value, System.Numerics.Vector<int> count) { throw null; }
public static System.Numerics.Vector<long> ShiftArithmeticRoundedSaturate(System.Numerics.Vector<long> value, System.Numerics.Vector<long> count) { throw null; }
public static System.Numerics.Vector<sbyte> ShiftArithmeticRoundedSaturate(System.Numerics.Vector<sbyte> value, System.Numerics.Vector<sbyte> count) { throw null; }
public static System.Numerics.Vector<short> ShiftArithmeticSaturate(System.Numerics.Vector<short> value, System.Numerics.Vector<short> count) { throw null; }
public static System.Numerics.Vector<int> ShiftArithmeticSaturate(System.Numerics.Vector<int> value, System.Numerics.Vector<int> count) { throw null; }
public static System.Numerics.Vector<long> ShiftArithmeticSaturate(System.Numerics.Vector<long> value, System.Numerics.Vector<long> count) { throw null; }
public static System.Numerics.Vector<sbyte> ShiftArithmeticSaturate(System.Numerics.Vector<sbyte> value, System.Numerics.Vector<sbyte> count) { throw null; }
}

public enum SveMaskPattern : byte
Expand Down
Loading
Loading