Skip to content

Commit 60e900b

Browse files
Implement SVE2 ShiftLeftAndInsert (#115776)
* Implement SVE2 ShiftLeftAndInsert * Remove explicit immediate bounds setting
1 parent 4090180 commit 60e900b

File tree

6 files changed

+120
-1
lines changed

6 files changed

+120
-1
lines changed

src/coreclr/jit/hwintrinsiclistarm64sve.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ HARDWARE_INTRINSIC(Sve, ZipLow,
310310
// SVE2 Intrinsics
311311
#define FIRST_NI_Sve2 NI_Sve2_BitwiseClearXor
312312
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)
313-
#define LAST_NI_Sve2 NI_Sve2_BitwiseClearXor
313+
HARDWARE_INTRINSIC(Sve2, ShiftLeftAndInsert, -1, 3, {INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_sve_sli, INS_invalid, INS_invalid}, HW_Category_ShiftLeftByImmediate, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics)
314+
#define LAST_NI_Sve2 NI_Sve2_ShiftLeftAndInsert
314315

315316
// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
316317
// ISA Function name SIMD size NumArg Instructions Category Flags

src/coreclr/jit/lowerarmarch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3827,6 +3827,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)
38273827
case NI_Sve_ExtractVector:
38283828
case NI_Sve_AddRotateComplex:
38293829
case NI_Sve_TrigonometricMultiplyAddCoefficient:
3830+
case NI_Sve2_ShiftLeftAndInsert:
38303831
assert(hasImmediateOperand);
38313832
assert(varTypeIsIntegral(intrin.op3));
38323833
if (intrin.op3->IsCnsIntOrI())

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,55 @@ internal Arm64() { }
7777
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
7878
/// </summary>
7979
public static unsafe Vector<ulong> BitwiseClearXor(Vector<ulong> xor, Vector<ulong> value, Vector<ulong> mask) { throw new PlatformNotSupportedException(); }
80+
81+
// Shift left and insert
82+
83+
/// <summary>
84+
/// svuint8_t svsli[_n_u8](svuint8_t op1, svuint8_t op2, uint64_t imm3)
85+
/// SLI Ztied1.B, Zop2.B, #imm3
86+
/// </summary>
87+
public static Vector<byte> ShiftLeftAndInsert(Vector<byte> left, Vector<byte> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
88+
89+
/// <summary>
90+
/// svint16_t svsli[_n_s16](svint16_t op1, svint16_t op2, uint64_t imm3)
91+
/// SLI Ztied1.H, Zop2.H, #imm3
92+
/// </summary>
93+
public static Vector<short> ShiftLeftAndInsert(Vector<short> left, Vector<short> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
94+
95+
/// <summary>
96+
/// svint32_t svsli[_n_s32](svint32_t op1, svint32_t op2, uint64_t imm3)
97+
/// SLI Ztied1.S, Zop2.S, #imm3
98+
/// </summary>
99+
public static Vector<int> ShiftLeftAndInsert(Vector<int> left, Vector<int> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
100+
101+
/// <summary>
102+
/// svint64_t svsli[_n_s64](svint64_t op1, svint64_t op2, uint64_t imm3)
103+
/// SLI Ztied1.D, Zop2.D, #imm3
104+
/// </summary>
105+
public static Vector<long> ShiftLeftAndInsert(Vector<long> left, Vector<long> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
106+
107+
/// <summary>
108+
/// svint8_t svsli[_n_s8](svint8_t op1, svint8_t op2, uint64_t imm3)
109+
/// SLI Ztied1.B, Zop2.B, #imm3
110+
/// </summary>
111+
public static Vector<sbyte> ShiftLeftAndInsert(Vector<sbyte> left, Vector<sbyte> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
112+
113+
/// <summary>
114+
/// svuint16_t svsli[_n_u16](svuint16_t op1, svuint16_t op2, uint64_t imm3)
115+
/// SLI Ztied1.H, Zop2.H, #imm3
116+
/// </summary>
117+
public static Vector<ushort> ShiftLeftAndInsert(Vector<ushort> left, Vector<ushort> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
118+
119+
/// <summary>
120+
/// svuint32_t svsli[_n_u32](svuint32_t op1, svuint32_t op2, uint64_t imm3)
121+
/// SLI Ztied1.S, Zop2.S, #imm3
122+
/// </summary>
123+
public static Vector<uint> ShiftLeftAndInsert(Vector<uint> left, Vector<uint> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
124+
125+
/// <summary>
126+
/// svuint64_t svsli[_n_u64](svuint64_t op1, svuint64_t op2, uint64_t imm3)
127+
/// SLI Ztied1.D, Zop2.D, #imm3
128+
/// </summary>
129+
public static Vector<ulong> ShiftLeftAndInsert(Vector<ulong> left, Vector<ulong> right, [ConstantExpected] byte shift) { throw new PlatformNotSupportedException(); }
80130
}
81131
}

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,55 @@ internal Arm64() { }
7777
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
7878
/// </summary>
7979
public static unsafe Vector<ulong> BitwiseClearXor(Vector<ulong> xor, Vector<ulong> value, Vector<ulong> mask) => BitwiseClearXor(xor, value, mask);
80+
81+
// Shift left and insert
82+
83+
/// <summary>
84+
/// svuint8_t svsli[_n_u8](svuint8_t op1, svuint8_t op2, uint64_t imm3)
85+
/// SLI Ztied1.B, Zop2.B, #imm3
86+
/// </summary>
87+
public static Vector<byte> ShiftLeftAndInsert(Vector<byte> left, Vector<byte> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
88+
89+
/// <summary>
90+
/// svint16_t svsli[_n_s16](svint16_t op1, svint16_t op2, uint64_t imm3)
91+
/// SLI Ztied1.H, Zop2.H, #imm3
92+
/// </summary>
93+
public static Vector<short> ShiftLeftAndInsert(Vector<short> left, Vector<short> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
94+
95+
/// <summary>
96+
/// svint32_t svsli[_n_s32](svint32_t op1, svint32_t op2, uint64_t imm3)
97+
/// SLI Ztied1.S, Zop2.S, #imm3
98+
/// </summary>
99+
public static Vector<int> ShiftLeftAndInsert(Vector<int> left, Vector<int> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
100+
101+
/// <summary>
102+
/// svint64_t svsli[_n_s64](svint64_t op1, svint64_t op2, uint64_t imm3)
103+
/// SLI Ztied1.D, Zop2.D, #imm3
104+
/// </summary>
105+
public static Vector<long> ShiftLeftAndInsert(Vector<long> left, Vector<long> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
106+
107+
/// <summary>
108+
/// svint8_t svsli[_n_s8](svint8_t op1, svint8_t op2, uint64_t imm3)
109+
/// SLI Ztied1.B, Zop2.B, #imm3
110+
/// </summary>
111+
public static Vector<sbyte> ShiftLeftAndInsert(Vector<sbyte> left, Vector<sbyte> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
112+
113+
/// <summary>
114+
/// svuint16_t svsli[_n_u16](svuint16_t op1, svuint16_t op2, uint64_t imm3)
115+
/// SLI Ztied1.H, Zop2.H, #imm3
116+
/// </summary>
117+
public static Vector<ushort> ShiftLeftAndInsert(Vector<ushort> left, Vector<ushort> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
118+
119+
/// <summary>
120+
/// svuint32_t svsli[_n_u32](svuint32_t op1, svuint32_t op2, uint64_t imm3)
121+
/// SLI Ztied1.S, Zop2.S, #imm3
122+
/// </summary>
123+
public static Vector<uint> ShiftLeftAndInsert(Vector<uint> left, Vector<uint> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
124+
125+
/// <summary>
126+
/// svuint64_t svsli[_n_u64](svuint64_t op1, svuint64_t op2, uint64_t imm3)
127+
/// SLI Ztied1.D, Zop2.D, #imm3
128+
/// </summary>
129+
public static Vector<ulong> ShiftLeftAndInsert(Vector<ulong> left, Vector<ulong> right, [ConstantExpected] byte shift) => ShiftLeftAndInsert(left, right, shift);
80130
}
81131
}

src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6047,6 +6047,14 @@ internal Arm64() { }
60476047
public static System.Numerics.Vector<ushort> BitwiseClearXor(System.Numerics.Vector<ushort> xor, System.Numerics.Vector<ushort> value, System.Numerics.Vector<ushort> mask) { throw null; }
60486048
public static System.Numerics.Vector<uint> BitwiseClearXor(System.Numerics.Vector<uint> xor, System.Numerics.Vector<uint> value, System.Numerics.Vector<uint> mask) { throw null; }
60496049
public static System.Numerics.Vector<ulong> BitwiseClearXor(System.Numerics.Vector<ulong> xor, System.Numerics.Vector<ulong> value, System.Numerics.Vector<ulong> mask) { throw null; }
6050+
public static System.Numerics.Vector<byte> ShiftLeftAndInsert(System.Numerics.Vector<byte> left, System.Numerics.Vector<byte> right, [ConstantExpected] byte shift) { throw null; }
6051+
public static System.Numerics.Vector<short> ShiftLeftAndInsert(System.Numerics.Vector<short> left, System.Numerics.Vector<short> right, [ConstantExpected] byte shift) { throw null; }
6052+
public static System.Numerics.Vector<int> ShiftLeftAndInsert(System.Numerics.Vector<int> left, System.Numerics.Vector<int> right, [ConstantExpected] byte shift) { throw null; }
6053+
public static System.Numerics.Vector<long> ShiftLeftAndInsert(System.Numerics.Vector<long> left, System.Numerics.Vector<long> right, [ConstantExpected] byte shift) { throw null; }
6054+
public static System.Numerics.Vector<sbyte> ShiftLeftAndInsert(System.Numerics.Vector<sbyte> left, System.Numerics.Vector<sbyte> right, [ConstantExpected] byte shift) { throw null; }
6055+
public static System.Numerics.Vector<ushort> ShiftLeftAndInsert(System.Numerics.Vector<ushort> left, System.Numerics.Vector<ushort> right, [ConstantExpected] byte shift) { throw null; }
6056+
public static System.Numerics.Vector<uint> ShiftLeftAndInsert(System.Numerics.Vector<uint> left, System.Numerics.Vector<uint> right, [ConstantExpected] byte shift) { throw null; }
6057+
public static System.Numerics.Vector<ulong> ShiftLeftAndInsert(System.Numerics.Vector<ulong> left, System.Numerics.Vector<ulong> right, [ConstantExpected] byte shift) { throw null; }
60506058
}
60516059

60526060
public enum SveMaskPattern : byte

0 commit comments

Comments
 (0)