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 // See the LICENSE file in the project root for more information.
5 #pragma warning disable IDE0060 // unused parameters
6 using System
.Runtime
.CompilerServices
;
8 namespace System
.Runtime
.Intrinsics
.Arm
.Arm64
11 /// This class provides access to the Arm64 AdvSIMD intrinsics
13 /// Arm64 CPU indicate support for this feature by setting
14 /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better.
17 public static class Simd
20 /// IsSupported property indicates whether any method provided
21 /// by this class is supported by the current runtime.
23 public static bool IsSupported { [Intrinsic] get => false; }
27 /// Corresponds to vector forms of ARM64 ABS & FABS
29 public static Vector64
<byte> Abs(Vector64
<sbyte> value) { throw new PlatformNotSupportedException(); }
30 public static Vector64
<ushort> Abs(Vector64
<short> value) { throw new PlatformNotSupportedException(); }
31 public static Vector64
<uint> Abs(Vector64
<int> value) { throw new PlatformNotSupportedException(); }
32 public static Vector64
<float> Abs(Vector64
<float> value) { throw new PlatformNotSupportedException(); }
33 public static Vector128
<byte> Abs(Vector128
<sbyte> value) { throw new PlatformNotSupportedException(); }
34 public static Vector128
<ushort> Abs(Vector128
<short> value) { throw new PlatformNotSupportedException(); }
35 public static Vector128
<uint> Abs(Vector128
<int> value) { throw new PlatformNotSupportedException(); }
36 public static Vector128
<ulong> Abs(Vector128
<long> value) { throw new PlatformNotSupportedException(); }
37 public static Vector128
<float> Abs(Vector128
<float> value) { throw new PlatformNotSupportedException(); }
38 public static Vector128
<double> Abs(Vector128
<double> value) { throw new PlatformNotSupportedException(); }
42 /// Corresponds to vector forms of ARM64 ADD & FADD
44 public static Vector64
<T
> Add
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
45 public static Vector128
<T
> Add
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
49 /// Corresponds to vector forms of ARM64 AND
51 public static Vector64
<T
> And
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
52 public static Vector128
<T
> And
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
56 /// Corresponds to vector forms of ARM64 BIC
58 public static Vector64
<T
> AndNot
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
59 public static Vector128
<T
> AndNot
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
62 /// Vector BitwiseSelect
63 /// For each bit in the vector result[bit] = sel[bit] ? left[bit] : right[bit]
64 /// Corresponds to vector forms of ARM64 BSL (Also BIF & BIT)
66 public static Vector64
<T
> BitwiseSelect
<T
>(Vector64
<T
> sel
, Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
67 public static Vector128
<T
> BitwiseSelect
<T
>(Vector128
<T
> sel
, Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
70 /// Vector CompareEqual
71 /// For each element result[elem] = (left[elem] == right[elem]) ? ~0 : 0
72 /// Corresponds to vector forms of ARM64 CMEQ & FCMEQ
74 public static Vector64
<T
> CompareEqual
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
75 public static Vector128
<T
> CompareEqual
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
78 /// Vector CompareEqualZero
79 /// For each element result[elem] = (left[elem] == 0) ? ~0 : 0
80 /// Corresponds to vector forms of ARM64 CMEQ & FCMEQ
82 public static Vector64
<T
> CompareEqualZero
<T
>(Vector64
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
83 public static Vector128
<T
> CompareEqualZero
<T
>(Vector128
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
86 /// Vector CompareGreaterThan
87 /// For each element result[elem] = (left[elem] > right[elem]) ? ~0 : 0
88 /// Corresponds to vector forms of ARM64 CMGT/CMHI & FCMGT
90 public static Vector64
<T
> CompareGreaterThan
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
91 public static Vector128
<T
> CompareGreaterThan
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
94 /// Vector CompareGreaterThanZero
95 /// For each element result[elem] = (left[elem] > 0) ? ~0 : 0
96 /// Corresponds to vector forms of ARM64 CMGT & FCMGT
98 public static Vector64
<T
> CompareGreaterThanZero
<T
>(Vector64
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
99 public static Vector128
<T
> CompareGreaterThanZero
<T
>(Vector128
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
102 /// Vector CompareGreaterThanOrEqual
103 /// For each element result[elem] = (left[elem] >= right[elem]) ? ~0 : 0
104 /// Corresponds to vector forms of ARM64 CMGE/CMHS & FCMGE
106 public static Vector64
<T
> CompareGreaterThanOrEqual
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
107 public static Vector128
<T
> CompareGreaterThanOrEqual
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
110 /// Vector CompareGreaterThanOrEqualZero
111 /// For each element result[elem] = (left[elem] >= 0) ? ~0 : 0
112 /// Corresponds to vector forms of ARM64 CMGE & FCMGE
114 public static Vector64
<T
> CompareGreaterThanOrEqualZero
<T
>(Vector64
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
115 public static Vector128
<T
> CompareGreaterThanOrEqualZero
<T
>(Vector128
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
118 /// Vector CompareLessThanZero
119 /// For each element result[elem] = (left[elem] < 0) ? ~0 : 0
120 /// Corresponds to vector forms of ARM64 CMGT & FCMGT
122 public static Vector64
<T
> CompareLessThanZero
<T
>(Vector64
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
123 public static Vector128
<T
> CompareLessThanZero
<T
>(Vector128
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
126 /// Vector CompareLessThanOrEqualZero
127 /// For each element result[elem] = (left[elem] < 0) ? ~0 : 0
128 /// Corresponds to vector forms of ARM64 CMGT & FCMGT
130 public static Vector64
<T
> CompareLessThanOrEqualZero
<T
>(Vector64
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
131 public static Vector128
<T
> CompareLessThanOrEqualZero
<T
>(Vector128
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
134 /// Vector CompareTest
135 /// For each element result[elem] = (left[elem] & right[elem]) ? ~0 : 0
136 /// Corresponds to vector forms of ARM64 CMTST
138 public static Vector64
<T
> CompareTest
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
139 public static Vector128
<T
> CompareTest
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
145 /// Corresponds to vector forms of ARM64 FDIV
147 public static Vector64
<float> Divide(Vector64
<float> left
, Vector64
<float> right
) { throw new PlatformNotSupportedException(); }
148 public static Vector128
<float> Divide(Vector128
<float> left
, Vector128
<float> right
) { throw new PlatformNotSupportedException(); }
149 public static Vector128
<double> Divide(Vector128
<double> left
, Vector128
<double> right
) { throw new PlatformNotSupportedException(); }
152 /// Vector extract item
154 /// result = vector[index]
156 /// Note: In order to be inlined, index must be a JIT time const expression which can be used to
157 /// populate the literal immediate field. Use of a non constant will result in generation of a switch table
159 /// Corresponds to vector forms of ARM64 MOV
161 public static T Extract
<T
>(Vector64
<T
> vector
, byte index
) where T
: struct { throw new PlatformNotSupportedException(); }
162 public static T Extract
<T
>(Vector128
<T
> vector
, byte index
) where T
: struct { throw new PlatformNotSupportedException(); }
165 /// Vector insert item
168 /// result[index] = data;
170 /// Note: In order to be inlined, index must be a JIT time const expression which can be used to
171 /// populate the literal immediate field. Use of a non constant will result in generation of a switch table
173 /// Corresponds to vector forms of ARM64 INS
175 public static Vector64
<T
> Insert
<T
>(Vector64
<T
> vector
, byte index
, T data
) where T
: struct { throw new PlatformNotSupportedException(); }
176 public static Vector128
<T
> Insert
<T
>(Vector128
<T
> vector
, byte index
, T data
) where T
: struct { throw new PlatformNotSupportedException(); }
179 /// Vector LeadingSignCount
180 /// Corresponds to vector forms of ARM64 CLS
182 public static Vector64
<sbyte> LeadingSignCount(Vector64
<sbyte> value) { throw new PlatformNotSupportedException(); }
183 public static Vector64
<short> LeadingSignCount(Vector64
<short> value) { throw new PlatformNotSupportedException(); }
184 public static Vector64
<int> LeadingSignCount(Vector64
<int> value) { throw new PlatformNotSupportedException(); }
185 public static Vector128
<sbyte> LeadingSignCount(Vector128
<sbyte> value) { throw new PlatformNotSupportedException(); }
186 public static Vector128
<short> LeadingSignCount(Vector128
<short> value) { throw new PlatformNotSupportedException(); }
187 public static Vector128
<int> LeadingSignCount(Vector128
<int> value) { throw new PlatformNotSupportedException(); }
190 /// Vector LeadingZeroCount
191 /// Corresponds to vector forms of ARM64 CLZ
193 public static Vector64
<byte> LeadingZeroCount(Vector64
<byte> value) { throw new PlatformNotSupportedException(); }
194 public static Vector64
<sbyte> LeadingZeroCount(Vector64
<sbyte> value) { throw new PlatformNotSupportedException(); }
195 public static Vector64
<ushort> LeadingZeroCount(Vector64
<ushort> value) { throw new PlatformNotSupportedException(); }
196 public static Vector64
<short> LeadingZeroCount(Vector64
<short> value) { throw new PlatformNotSupportedException(); }
197 public static Vector64
<uint> LeadingZeroCount(Vector64
<uint> value) { throw new PlatformNotSupportedException(); }
198 public static Vector64
<int> LeadingZeroCount(Vector64
<int> value) { throw new PlatformNotSupportedException(); }
199 public static Vector128
<byte> LeadingZeroCount(Vector128
<byte> value) { throw new PlatformNotSupportedException(); }
200 public static Vector128
<sbyte> LeadingZeroCount(Vector128
<sbyte> value) { throw new PlatformNotSupportedException(); }
201 public static Vector128
<ushort> LeadingZeroCount(Vector128
<ushort> value) { throw new PlatformNotSupportedException(); }
202 public static Vector128
<short> LeadingZeroCount(Vector128
<short> value) { throw new PlatformNotSupportedException(); }
203 public static Vector128
<uint> LeadingZeroCount(Vector128
<uint> value) { throw new PlatformNotSupportedException(); }
204 public static Vector128
<int> LeadingZeroCount(Vector128
<int> value) { throw new PlatformNotSupportedException(); }
208 /// Corresponds to vector forms of ARM64 SMAX, UMAX & FMAX
210 public static Vector64
<byte> Max(Vector64
<byte> left
, Vector64
<byte> right
) { throw new PlatformNotSupportedException(); }
211 public static Vector64
<sbyte> Max(Vector64
<sbyte> left
, Vector64
<sbyte> right
) { throw new PlatformNotSupportedException(); }
212 public static Vector64
<ushort> Max(Vector64
<ushort> left
, Vector64
<ushort> right
) { throw new PlatformNotSupportedException(); }
213 public static Vector64
<short> Max(Vector64
<short> left
, Vector64
<short> right
) { throw new PlatformNotSupportedException(); }
214 public static Vector64
<uint> Max(Vector64
<uint> left
, Vector64
<uint> right
) { throw new PlatformNotSupportedException(); }
215 public static Vector64
<int> Max(Vector64
<int> left
, Vector64
<int> right
) { throw new PlatformNotSupportedException(); }
216 public static Vector64
<float> Max(Vector64
<float> left
, Vector64
<float> right
) { throw new PlatformNotSupportedException(); }
217 public static Vector128
<byte> Max(Vector128
<byte> left
, Vector128
<byte> right
) { throw new PlatformNotSupportedException(); }
218 public static Vector128
<sbyte> Max(Vector128
<sbyte> left
, Vector128
<sbyte> right
) { throw new PlatformNotSupportedException(); }
219 public static Vector128
<ushort> Max(Vector128
<ushort> left
, Vector128
<ushort> right
) { throw new PlatformNotSupportedException(); }
220 public static Vector128
<short> Max(Vector128
<short> left
, Vector128
<short> right
) { throw new PlatformNotSupportedException(); }
221 public static Vector128
<uint> Max(Vector128
<uint> left
, Vector128
<uint> right
) { throw new PlatformNotSupportedException(); }
222 public static Vector128
<int> Max(Vector128
<int> left
, Vector128
<int> right
) { throw new PlatformNotSupportedException(); }
223 public static Vector128
<float> Max(Vector128
<float> left
, Vector128
<float> right
) { throw new PlatformNotSupportedException(); }
224 public static Vector128
<double> Max(Vector128
<double> left
, Vector128
<double> right
) { throw new PlatformNotSupportedException(); }
228 /// Corresponds to vector forms of ARM64 SMIN, UMIN & FMIN
230 public static Vector64
<byte> Min(Vector64
<byte> left
, Vector64
<byte> right
) { throw new PlatformNotSupportedException(); }
231 public static Vector64
<sbyte> Min(Vector64
<sbyte> left
, Vector64
<sbyte> right
) { throw new PlatformNotSupportedException(); }
232 public static Vector64
<ushort> Min(Vector64
<ushort> left
, Vector64
<ushort> right
) { throw new PlatformNotSupportedException(); }
233 public static Vector64
<short> Min(Vector64
<short> left
, Vector64
<short> right
) { throw new PlatformNotSupportedException(); }
234 public static Vector64
<uint> Min(Vector64
<uint> left
, Vector64
<uint> right
) { throw new PlatformNotSupportedException(); }
235 public static Vector64
<int> Min(Vector64
<int> left
, Vector64
<int> right
) { throw new PlatformNotSupportedException(); }
236 public static Vector64
<float> Min(Vector64
<float> left
, Vector64
<float> right
) { throw new PlatformNotSupportedException(); }
237 public static Vector128
<byte> Min(Vector128
<byte> left
, Vector128
<byte> right
) { throw new PlatformNotSupportedException(); }
238 public static Vector128
<sbyte> Min(Vector128
<sbyte> left
, Vector128
<sbyte> right
) { throw new PlatformNotSupportedException(); }
239 public static Vector128
<ushort> Min(Vector128
<ushort> left
, Vector128
<ushort> right
) { throw new PlatformNotSupportedException(); }
240 public static Vector128
<short> Min(Vector128
<short> left
, Vector128
<short> right
) { throw new PlatformNotSupportedException(); }
241 public static Vector128
<uint> Min(Vector128
<uint> left
, Vector128
<uint> right
) { throw new PlatformNotSupportedException(); }
242 public static Vector128
<int> Min(Vector128
<int> left
, Vector128
<int> right
) { throw new PlatformNotSupportedException(); }
243 public static Vector128
<float> Min(Vector128
<float> left
, Vector128
<float> right
) { throw new PlatformNotSupportedException(); }
244 public static Vector128
<double> Min(Vector128
<double> left
, Vector128
<double> right
) { throw new PlatformNotSupportedException(); }
251 /// For each element result[elem] = left[elem] * right[elem]
253 /// Corresponds to vector forms of ARM64 MUL & FMUL
255 public static Vector64
<byte> Multiply(Vector64
<byte> left
, Vector64
<byte> right
) { throw new PlatformNotSupportedException(); }
256 public static Vector64
<sbyte> Multiply(Vector64
<sbyte> left
, Vector64
<sbyte> right
) { throw new PlatformNotSupportedException(); }
257 public static Vector64
<ushort> Multiply(Vector64
<ushort> left
, Vector64
<ushort> right
) { throw new PlatformNotSupportedException(); }
258 public static Vector64
<short> Multiply(Vector64
<short> left
, Vector64
<short> right
) { throw new PlatformNotSupportedException(); }
259 public static Vector64
<uint> Multiply(Vector64
<uint> left
, Vector64
<uint> right
) { throw new PlatformNotSupportedException(); }
260 public static Vector64
<int> Multiply(Vector64
<int> left
, Vector64
<int> right
) { throw new PlatformNotSupportedException(); }
261 public static Vector64
<float> Multiply(Vector64
<float> left
, Vector64
<float> right
) { throw new PlatformNotSupportedException(); }
262 public static Vector128
<byte> Multiply(Vector128
<byte> left
, Vector128
<byte> right
) { throw new PlatformNotSupportedException(); }
263 public static Vector128
<sbyte> Multiply(Vector128
<sbyte> left
, Vector128
<sbyte> right
) { throw new PlatformNotSupportedException(); }
264 public static Vector128
<ushort> Multiply(Vector128
<ushort> left
, Vector128
<ushort> right
) { throw new PlatformNotSupportedException(); }
265 public static Vector128
<short> Multiply(Vector128
<short> left
, Vector128
<short> right
) { throw new PlatformNotSupportedException(); }
266 public static Vector128
<uint> Multiply(Vector128
<uint> left
, Vector128
<uint> right
) { throw new PlatformNotSupportedException(); }
267 public static Vector128
<int> Multiply(Vector128
<int> left
, Vector128
<int> right
) { throw new PlatformNotSupportedException(); }
268 public static Vector128
<float> Multiply(Vector128
<float> left
, Vector128
<float> right
) { throw new PlatformNotSupportedException(); }
269 public static Vector128
<double> Multiply(Vector128
<double> left
, Vector128
<double> right
) { throw new PlatformNotSupportedException(); }
273 /// Corresponds to vector forms of ARM64 NEG & FNEG
275 public static Vector64
<sbyte> Negate(Vector64
<sbyte> value) { throw new PlatformNotSupportedException(); }
276 public static Vector64
<short> Negate(Vector64
<short> value) { throw new PlatformNotSupportedException(); }
277 public static Vector64
<int> Negate(Vector64
<int> value) { throw new PlatformNotSupportedException(); }
278 public static Vector64
<float> Negate(Vector64
<float> value) { throw new PlatformNotSupportedException(); }
279 public static Vector128
<sbyte> Negate(Vector128
<sbyte> value) { throw new PlatformNotSupportedException(); }
280 public static Vector128
<short> Negate(Vector128
<short> value) { throw new PlatformNotSupportedException(); }
281 public static Vector128
<int> Negate(Vector128
<int> value) { throw new PlatformNotSupportedException(); }
282 public static Vector128
<long> Negate(Vector128
<long> value) { throw new PlatformNotSupportedException(); }
283 public static Vector128
<float> Negate(Vector128
<float> value) { throw new PlatformNotSupportedException(); }
284 public static Vector128
<double> Negate(Vector128
<double> value) { throw new PlatformNotSupportedException(); }
288 /// Corresponds to vector forms of ARM64 NOT
290 public static Vector64
<T
> Not
<T
>(Vector64
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
291 public static Vector128
<T
> Not
<T
>(Vector128
<T
> value) where T
: struct { throw new PlatformNotSupportedException(); }
295 /// Corresponds to vector forms of ARM64 ORR
297 public static Vector64
<T
> Or
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
298 public static Vector128
<T
> Or
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
302 /// Corresponds to vector forms of ARM64 ORN
304 public static Vector64
<T
> OrNot
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
305 public static Vector128
<T
> OrNot
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
309 /// Corresponds to vector forms of ARM64 CNT
311 public static Vector64
<byte> PopCount(Vector64
<byte> value) { throw new PlatformNotSupportedException(); }
312 public static Vector64
<sbyte> PopCount(Vector64
<sbyte> value) { throw new PlatformNotSupportedException(); }
313 public static Vector128
<byte> PopCount(Vector128
<byte> value) { throw new PlatformNotSupportedException(); }
314 public static Vector128
<sbyte> PopCount(Vector128
<sbyte> value) { throw new PlatformNotSupportedException(); }
317 /// SetVector* Fill vector elements by replicating element value
319 /// Corresponds to vector forms of ARM64 DUP (general), DUP (element 0), FMOV (vector, immediate)
321 public static Vector64
<T
> SetAllVector64
<T
>(T
value) where T
: struct { throw new PlatformNotSupportedException(); }
322 public static Vector128
<T
> SetAllVector128
<T
>(T
value) where T
: struct { throw new PlatformNotSupportedException(); }
325 /// Vector square root
326 /// Corresponds to vector forms of ARM64 FRSQRT
328 public static Vector64
<float> Sqrt(Vector64
<float> value) { throw new PlatformNotSupportedException(); }
329 public static Vector128
<float> Sqrt(Vector128
<float> value) { throw new PlatformNotSupportedException(); }
330 public static Vector128
<double> Sqrt(Vector128
<double> value) { throw new PlatformNotSupportedException(); }
334 /// Corresponds to vector forms of ARM64 SUB & FSUB
336 public static Vector64
<T
> Subtract
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
337 public static Vector128
<T
> Subtract
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
341 /// Vector exclusive or
342 /// Corresponds to vector forms of ARM64 EOR
344 public static Vector64
<T
> Xor
<T
>(Vector64
<T
> left
, Vector64
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }
345 public static Vector128
<T
> Xor
<T
>(Vector128
<T
> left
, Vector128
<T
> right
) where T
: struct { throw new PlatformNotSupportedException(); }