Skip to content

Commit de2be43

Browse files
committed
SVE2 API for AbsoluteDifferenceAdd and widening variants
1 parent c53ccee commit de2be43

File tree

6 files changed

+528
-0
lines changed

6 files changed

+528
-0
lines changed

src/coreclr/jit/hwintrinsiclistarm64sve.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,13 @@ HARDWARE_INTRINSIC(Sve, StoreAndZipx3,
327327
HARDWARE_INTRINSIC(Sve, StoreAndZipx4, -1, 3, {INS_sve_st4b, INS_sve_st4b, INS_sve_st4h, INS_sve_st4h, INS_sve_st4w, INS_sve_st4w, INS_sve_st4d, INS_sve_st4d, INS_sve_st4w, INS_sve_st4d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters)
328328

329329

330+
#define FIRST_NI_Sve2 NI_Sve2_AbsoluteDifferenceAdd
331+
HARDWARE_INTRINSIC(Sve2, AbsoluteDifferenceAdd, -1, 3, {INS_sve_saba, INS_sve_uaba, INS_sve_saba, INS_sve_uaba, INS_sve_saba, INS_sve_uaba, INS_sve_saba, INS_sve_uaba, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasRMWSemantics)
332+
HARDWARE_INTRINSIC(Sve2, AbsoluteDifferenceAddWideningLower, -1, 3, {INS_invalid, INS_invalid, INS_sve_sabalb, INS_sve_uabalb, INS_sve_sabalb, INS_sve_uabalb, INS_sve_sabalb, INS_sve_uabalb, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasRMWSemantics)
333+
HARDWARE_INTRINSIC(Sve2, AbsoluteDifferenceAddWideningUpper, -1, 3, {INS_invalid, INS_invalid, INS_sve_sabalt, INS_sve_uabalt, INS_sve_sabalt, INS_sve_uabalt, INS_sve_sabalt, INS_sve_uabalt, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasRMWSemantics)
334+
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)
335+
#define LAST_NI_Sve2 NI_Sve2_BitwiseClearXor
336+
330337
#endif // FEATURE_HW_INTRINSIC
331338

332339
#undef HARDWARE_INTRINSIC
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Diagnostics.CodeAnalysis;
5+
using System.Runtime.CompilerServices;
6+
using System.Runtime.Intrinsics;
7+
using System.Numerics;
8+
9+
namespace System.Runtime.Intrinsics.Arm
10+
{
11+
/// <summary>
12+
/// This class provides access to the ARM SVE hardware instructions via intrinsics
13+
/// </summary>
14+
[Intrinsic]
15+
[CLSCompliant(false)]
16+
[Experimental(Experimentals.ArmSveDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
17+
public abstract class Sve2 : Sve
18+
{
19+
internal Sve2() { }
20+
21+
public static new bool IsSupported { get => IsSupported; }
22+
23+
[Intrinsic]
24+
public new abstract class Arm64 : Sve.Arm64
25+
{
26+
internal Arm64() { }
27+
28+
public static new bool IsSupported { get => IsSupported; }
29+
}
30+
31+
// Absolute difference and accumulate
32+
33+
/// <summary>
34+
/// svuint8_t svaba[_u8](svuint8_t op1, svuint8_t op2, svuint8_t op3)
35+
/// UABA Ztied1.B, Zop2.B, Zop3.B
36+
/// </summary>
37+
public static unsafe Vector<byte> AbsoluteDifferenceAdd(Vector<byte> addend, Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
38+
39+
/// <summary>
40+
/// svint16_t svaba[_s16](svint16_t op1, svint16_t op2, svint16_t op3)
41+
/// SABA Ztied1.H, Zop2.H, Zop3.H
42+
/// </summary>
43+
public static unsafe Vector<short> AbsoluteDifferenceAdd(Vector<short> addend, Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
44+
45+
/// <summary>
46+
/// svint32_t svaba[_s32](svint32_t op1, svint32_t op2, svint32_t op3)
47+
/// SABA Ztied1.S, Zop2.S, Zop3.S
48+
/// </summary>
49+
public static unsafe Vector<int> AbsoluteDifferenceAdd(Vector<int> addend, Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
50+
51+
/// <summary>
52+
/// svint64_t svaba[_s64](svint64_t op1, svint64_t op2, svint64_t op3)
53+
/// SABA Ztied1.D, Zop2.D, Zop3.D
54+
/// </summary>
55+
public static unsafe Vector<long> AbsoluteDifferenceAdd(Vector<long> addend, Vector<long> left, Vector<long> right) { throw new PlatformNotSupportedException(); }
56+
57+
/// <summary>
58+
/// svint8_t svaba[_s8](svint8_t op1, svint8_t op2, svint8_t op3)
59+
/// SABA Ztied1.B, Zop2.B, Zop3.B
60+
/// </summary>
61+
public static unsafe Vector<sbyte> AbsoluteDifferenceAdd(Vector<sbyte> addend, Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
62+
63+
/// <summary>
64+
/// svuint16_t svaba[_u16](svuint16_t op1, svuint16_t op2, svuint16_t op3)
65+
/// UABA Ztied1.H, Zop2.H, Zop3.H
66+
/// </summary>
67+
public static unsafe Vector<ushort> AbsoluteDifferenceAdd(Vector<ushort> addend, Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
68+
69+
/// <summary>
70+
/// svuint32_t svaba[_u32](svuint32_t op1, svuint32_t op2, svuint32_t op3)
71+
/// UABA Ztied1.S, Zop2.S, Zop3.S
72+
/// </summary>
73+
public static unsafe Vector<uint> AbsoluteDifferenceAdd(Vector<uint> addend, Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
74+
75+
/// <summary>
76+
/// svuint64_t svaba[_u64](svuint64_t op1, svuint64_t op2, svuint64_t op3)
77+
/// UABA Ztied1.D, Zop2.D, Zop3.D
78+
/// </summary>
79+
public static unsafe Vector<ulong> AbsoluteDifferenceAdd(Vector<ulong> addend, Vector<ulong> left, Vector<ulong> right) { throw new PlatformNotSupportedException(); }
80+
81+
// Absolute difference and accumulate long (bottom)
82+
83+
/// <summary>
84+
/// svint16_t svabalb[_s16](svint16_t op1, svint8_t op2, svint8_t op3)
85+
/// SABALB Ztied1.H, Zop2.B, Zop3.B
86+
/// </summary>
87+
public static unsafe Vector<short> AbsoluteDifferenceAddWideningLower(Vector<short> addend, Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
88+
89+
/// <summary>
90+
/// svint32_t svabalb[_s32](svint32_t op1, svint16_t op2, svint16_t op3)
91+
/// SABALB Ztied1.S, Zop2.H, Zop3.H
92+
/// </summary>
93+
public static unsafe Vector<int> AbsoluteDifferenceAddWideningLower(Vector<int> addend, Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
94+
95+
/// <summary>
96+
/// svint64_t svabalb[_s64](svint64_t op1, svint32_t op2, svint32_t op3)
97+
/// SABALB Ztied1.D, Zop2.S, Zop3.S
98+
/// </summary>
99+
public static unsafe Vector<long> AbsoluteDifferenceAddWideningLower(Vector<long> addend, Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
100+
101+
/// <summary>
102+
/// svuint16_t svabalb[_u16](svuint16_t op1, svuint8_t op2, svuint8_t op3)
103+
/// UABALB Ztied1.H, Zop2.B, Zop3.B
104+
/// </summary>
105+
public static unsafe Vector<ushort> AbsoluteDifferenceAddWideningLower(Vector<ushort> addend, Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
106+
107+
/// <summary>
108+
/// svuint32_t svabalb[_u32](svuint32_t op1, svuint16_t op2, svuint16_t op3)
109+
/// UABALB Ztied1.S, Zop2.H, Zop3.H
110+
/// </summary>
111+
public static unsafe Vector<uint> AbsoluteDifferenceAddWideningLower(Vector<uint> addend, Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
112+
113+
/// <summary>
114+
/// svuint64_t svabalb[_u64](svuint64_t op1, svuint32_t op2, svuint32_t op3)
115+
/// UABALB Ztied1.D, Zop2.S, Zop3.S
116+
/// </summary>
117+
public static unsafe Vector<ulong> AbsoluteDifferenceAddWideningLower(Vector<ulong> addend, Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
118+
119+
// Absolute difference and accumulate long (top)
120+
121+
/// <summary>
122+
/// svint16_t svabalt[_s16](svint16_t op1, svint8_t op2, svint8_t op3)
123+
/// SABALT Ztied1.H, Zop2.B, Zop3.B
124+
/// </summary>
125+
public static unsafe Vector<short> AbsoluteDifferenceAddWideningUpper(Vector<short> addend, Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
126+
127+
/// <summary>
128+
/// svint32_t svabalt[_s32](svint32_t op1, svint16_t op2, svint16_t op3)
129+
/// SABALT Ztied1.S, Zop2.H, Zop3.H
130+
/// </summary>
131+
public static unsafe Vector<int> AbsoluteDifferenceAddWideningUpper(Vector<int> addend, Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
132+
133+
/// <summary>
134+
/// svint64_t svabalt[_s64](svint64_t op1, svint32_t op2, svint32_t op3)
135+
/// SABALT Ztied1.D, Zop2.S, Zop3.S
136+
/// </summary>
137+
public static unsafe Vector<long> AbsoluteDifferenceAddWideningUpper(Vector<long> addend, Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
138+
139+
/// <summary>
140+
/// svuint16_t svabalt[_u16](svuint16_t op1, svuint8_t op2, svuint8_t op3)
141+
/// UABALT Ztied1.H, Zop2.B, Zop3.B
142+
/// </summary>
143+
public static unsafe Vector<ushort> AbsoluteDifferenceAddWideningUpper(Vector<ushort> addend, Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
144+
145+
/// <summary>
146+
/// svuint32_t svabalt[_u32](svuint32_t op1, svuint16_t op2, svuint16_t op3)
147+
/// UABALT Ztied1.S, Zop2.H, Zop3.H
148+
/// </summary>
149+
public static unsafe Vector<uint> AbsoluteDifferenceAddWideningUpper(Vector<uint> addend, Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
150+
151+
/// <summary>
152+
/// svuint64_t svabalt[_u64](svuint64_t op1, svuint32_t op2, svuint32_t op3)
153+
/// UABALT Ztied1.D, Zop2.S, Zop3.S
154+
/// </summary>
155+
public static unsafe Vector<ulong> AbsoluteDifferenceAddWideningUpper(Vector<ulong> addend, Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
156+
157+
// Bitwise clear and exclusive OR
158+
159+
/// <summary>
160+
/// svuint8_t svbcax[_u8](svuint8_t op1, svuint8_t op2, svuint8_t op3)
161+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
162+
/// </summary>
163+
public static unsafe Vector<byte> BitwiseClearXor(Vector<byte> xor, Vector<byte> value, Vector<byte> mask) { throw new PlatformNotSupportedException(); }
164+
165+
/// <summary>
166+
/// svint16_t svbcax[_s16](svint16_t op1, svint16_t op2, svint16_t op3)
167+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
168+
/// </summary>
169+
public static unsafe Vector<short> BitwiseClearXor(Vector<short> xor, Vector<short> value, Vector<short> mask) { throw new PlatformNotSupportedException(); }
170+
171+
/// <summary>
172+
/// svint32_t svbcax[_s32](svint32_t op1, svint32_t op2, svint32_t op3)
173+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
174+
/// </summary>
175+
public static unsafe Vector<int> BitwiseClearXor(Vector<int> xor, Vector<int> value, Vector<int> mask) { throw new PlatformNotSupportedException(); }
176+
177+
/// <summary>
178+
/// svint64_t svbcax[_s64](svint64_t op1, svint64_t op2, svint64_t op3)
179+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
180+
/// </summary>
181+
public static unsafe Vector<long> BitwiseClearXor(Vector<long> xor, Vector<long> value, Vector<long> mask) { throw new PlatformNotSupportedException(); }
182+
183+
/// <summary>
184+
/// svint8_t svbcax[_s8](svint8_t op1, svint8_t op2, svint8_t op3)
185+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
186+
/// </summary>
187+
public static unsafe Vector<sbyte> BitwiseClearXor(Vector<sbyte> xor, Vector<sbyte> value, Vector<sbyte> mask) { throw new PlatformNotSupportedException(); }
188+
189+
/// <summary>
190+
/// svuint16_t svbcax[_u16](svuint16_t op1, svuint16_t op2, svuint16_t op3)
191+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
192+
/// </summary>
193+
public static unsafe Vector<ushort> BitwiseClearXor(Vector<ushort> xor, Vector<ushort> value, Vector<ushort> mask) { throw new PlatformNotSupportedException(); }
194+
195+
/// <summary>
196+
/// svuint32_t svbcax[_u32](svuint32_t op1, svuint32_t op2, svuint32_t op3)
197+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
198+
/// </summary>
199+
public static unsafe Vector<uint> BitwiseClearXor(Vector<uint> xor, Vector<uint> value, Vector<uint> mask) { throw new PlatformNotSupportedException(); }
200+
201+
/// <summary>
202+
/// svuint64_t svbcax[_u64](svuint64_t op1, svuint64_t op2, svuint64_t op3)
203+
/// BCAX Ztied1.D, Ztied1.D, Zop2.D, Zop3.D
204+
/// </summary>
205+
public static unsafe Vector<ulong> BitwiseClearXor(Vector<ulong> xor, Vector<ulong> value, Vector<ulong> mask) { throw new PlatformNotSupportedException(); }
206+
}
207+
}

0 commit comments

Comments
 (0)