xref: /freebsd/contrib/llvm-project/llvm/include/llvm/IR/IntrinsicsAArch64.td (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1//===- IntrinsicsAARCH64.td - Defines AARCH64 intrinsics ---*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines all of the AARCH64-specific intrinsics.
10//
11//===----------------------------------------------------------------------===//
12
13let TargetPrefix = "aarch64" in {
14
15def int_aarch64_ldxr : Intrinsic<[llvm_i64_ty], [llvm_anyptr_ty],
16                                 [IntrNoFree, IntrWillReturn]>;
17def int_aarch64_ldaxr : Intrinsic<[llvm_i64_ty], [llvm_anyptr_ty],
18                                  [IntrNoFree, IntrWillReturn]>;
19def int_aarch64_stxr : Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_anyptr_ty],
20                                 [IntrNoFree, IntrWillReturn]>;
21def int_aarch64_stlxr : Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_anyptr_ty],
22                                  [IntrNoFree, IntrWillReturn]>;
23
24def int_aarch64_ldxp : Intrinsic<[llvm_i64_ty, llvm_i64_ty], [llvm_ptr_ty],
25                                 [IntrNoFree, IntrWillReturn]>;
26def int_aarch64_ldaxp : Intrinsic<[llvm_i64_ty, llvm_i64_ty], [llvm_ptr_ty],
27                                  [IntrNoFree, IntrWillReturn]>;
28def int_aarch64_stxp : Intrinsic<[llvm_i32_ty],
29                               [llvm_i64_ty, llvm_i64_ty, llvm_ptr_ty],
30                               [IntrNoFree, IntrWillReturn]>;
31def int_aarch64_stlxp : Intrinsic<[llvm_i32_ty],
32                                  [llvm_i64_ty, llvm_i64_ty, llvm_ptr_ty],
33                                  [IntrNoFree, IntrWillReturn]>;
34
35def int_aarch64_clrex : Intrinsic<[]>;
36
37def int_aarch64_sdiv : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
38                                LLVMMatchType<0>], [IntrNoMem]>;
39def int_aarch64_udiv : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
40                                LLVMMatchType<0>], [IntrNoMem]>;
41
42def int_aarch64_fjcvtzs : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
43
44def int_aarch64_cls: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
45def int_aarch64_cls64: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem]>;
46
47def int_aarch64_frint32z
48    : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
49                            [ IntrNoMem ]>;
50def int_aarch64_frint64z
51    : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
52                            [ IntrNoMem ]>;
53def int_aarch64_frint32x
54    : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
55                            [ IntrNoMem ]>;
56def int_aarch64_frint64x
57    : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ], [ LLVMMatchType<0> ],
58                            [ IntrNoMem ]>;
59
60//===----------------------------------------------------------------------===//
61// HINT
62
63def int_aarch64_hint : DefaultAttrsIntrinsic<[], [llvm_i32_ty]>;
64
65def int_aarch64_break : Intrinsic<[], [llvm_i32_ty],
66    [IntrNoMem, IntrHasSideEffects, IntrNoReturn, IntrCold, ImmArg<ArgIndex<0>>]>;
67
68
69def int_aarch64_prefetch : Intrinsic<[],
70    [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
71    [IntrInaccessibleMemOrArgMemOnly, IntrWillReturn, ReadOnly<ArgIndex<0>>,
72     ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>
73     ]>,
74    ClangBuiltin<"__builtin_arm_prefetch">;
75
76//===----------------------------------------------------------------------===//
77// Data Barrier Instructions
78
79def int_aarch64_dmb : ClangBuiltin<"__builtin_arm_dmb">, MSBuiltin<"__dmb">,
80                      Intrinsic<[], [llvm_i32_ty], [IntrNoFree, IntrWillReturn]>;
81def int_aarch64_dsb : ClangBuiltin<"__builtin_arm_dsb">, MSBuiltin<"__dsb">,
82                      Intrinsic<[], [llvm_i32_ty], [IntrNoFree, IntrWillReturn]>;
83def int_aarch64_isb : ClangBuiltin<"__builtin_arm_isb">, MSBuiltin<"__isb">,
84                      Intrinsic<[], [llvm_i32_ty], [IntrNoFree, IntrWillReturn]>;
85
86// A space-consuming intrinsic primarily for testing block and jump table
87// placements. The first argument is the number of bytes this "instruction"
88// takes up, the second and return value are essentially chains, used to force
89// ordering during ISel.
90def int_aarch64_space : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i64_ty], []>;
91
92}
93
94//===----------------------------------------------------------------------===//
95// Advanced SIMD (NEON)
96
97let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
98  class AdvSIMD_2Scalar_Float_Intrinsic
99    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
100                [IntrNoMem]>;
101
102  class AdvSIMD_FPToIntRounding_Intrinsic
103    : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty], [IntrNoMem]>;
104
105  class AdvSIMD_1IntArg_Intrinsic
106    : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>], [IntrNoMem]>;
107  class AdvSIMD_1FloatArg_Intrinsic
108    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]>;
109  class AdvSIMD_1VectorArg_Intrinsic
110    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>], [IntrNoMem]>;
111  class AdvSIMD_1VectorArg_Expand_Intrinsic
112    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty], [IntrNoMem]>;
113  class AdvSIMD_1VectorArg_Long_Intrinsic
114    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMTruncatedType<0>], [IntrNoMem]>;
115  class AdvSIMD_1IntArg_Narrow_Intrinsic
116    : DefaultAttrsIntrinsic<[llvm_any_ty], [llvm_any_ty], [IntrNoMem]>;
117  class AdvSIMD_1VectorArg_Narrow_Intrinsic
118    : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMExtendedType<0>], [IntrNoMem]>;
119  class AdvSIMD_1VectorArg_Int_Across_Intrinsic
120    : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyvector_ty], [IntrNoMem]>;
121  class AdvSIMD_1VectorArg_Float_Across_Intrinsic
122    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyvector_ty], [IntrNoMem]>;
123
124  class AdvSIMD_2IntArg_Intrinsic
125    : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
126                [IntrNoMem]>;
127  class AdvSIMD_2FloatArg_Intrinsic
128    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
129                [IntrNoMem]>;
130  class AdvSIMD_2VectorArg_Intrinsic
131    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
132                [IntrNoMem]>;
133  class AdvSIMD_2VectorArg_Compare_Intrinsic
134    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty, LLVMMatchType<1>],
135                [IntrNoMem]>;
136  class AdvSIMD_2Arg_FloatCompare_Intrinsic
137    : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty, LLVMMatchType<1>],
138                [IntrNoMem]>;
139  class AdvSIMD_2VectorArg_Long_Intrinsic
140    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
141                [LLVMTruncatedType<0>, LLVMTruncatedType<0>],
142                [IntrNoMem]>;
143  class AdvSIMD_2VectorArg_Wide_Intrinsic
144    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
145                [LLVMMatchType<0>, LLVMTruncatedType<0>],
146                [IntrNoMem]>;
147  class AdvSIMD_2VectorArg_Narrow_Intrinsic
148    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
149                [LLVMExtendedType<0>, LLVMExtendedType<0>],
150                [IntrNoMem]>;
151  class AdvSIMD_2Arg_Scalar_Narrow_Intrinsic
152    : DefaultAttrsIntrinsic<[llvm_anyint_ty],
153                [LLVMExtendedType<0>, llvm_i32_ty],
154                [IntrNoMem]>;
155  class AdvSIMD_2VectorArg_Scalar_Expand_BySize_Intrinsic
156    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
157                [llvm_anyvector_ty],
158                [IntrNoMem]>;
159  class AdvSIMD_2VectorArg_Scalar_Wide_BySize_Intrinsic
160    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
161                [LLVMTruncatedType<0>],
162                [IntrNoMem]>;
163  class AdvSIMD_2VectorArg_Scalar_Wide_Intrinsic
164    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
165                [LLVMTruncatedType<0>, llvm_i32_ty],
166                [IntrNoMem]>;
167  class AdvSIMD_2VectorArg_Tied_Narrow_Intrinsic
168    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
169                [LLVMHalfElementsVectorType<0>, llvm_anyvector_ty],
170                [IntrNoMem]>;
171  class AdvSIMD_2VectorArg_Lane_Intrinsic
172    : DefaultAttrsIntrinsic<[llvm_anyint_ty],
173                [LLVMMatchType<0>, llvm_anyint_ty, llvm_i32_ty],
174                [IntrNoMem]>;
175
176  class AdvSIMD_3IntArg_Intrinsic
177    : DefaultAttrsIntrinsic<[llvm_anyint_ty],
178                [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
179                [IntrNoMem]>;
180  class AdvSIMD_3VectorArg_Intrinsic
181      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
182               [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
183               [IntrNoMem]>;
184  class AdvSIMD_3VectorArg_Scalar_Intrinsic
185      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
186               [LLVMMatchType<0>, LLVMMatchType<0>, llvm_i32_ty],
187               [IntrNoMem]>;
188  class AdvSIMD_3VectorArg_Tied_Narrow_Intrinsic
189      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
190               [LLVMHalfElementsVectorType<0>, llvm_anyvector_ty,
191                LLVMMatchType<1>], [IntrNoMem]>;
192  class AdvSIMD_3VectorArg_Scalar_Tied_Narrow_Intrinsic
193    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
194                [LLVMHalfElementsVectorType<0>, llvm_anyvector_ty, llvm_i32_ty],
195                [IntrNoMem]>;
196  class AdvSIMD_CvtFxToFP_Intrinsic
197    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
198                [IntrNoMem]>;
199  class AdvSIMD_CvtFPToFx_Intrinsic
200    : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty, llvm_i32_ty],
201                [IntrNoMem]>;
202
203  class AdvSIMD_1Arg_Intrinsic
204    : DefaultAttrsIntrinsic<[llvm_any_ty], [LLVMMatchType<0>], [IntrNoMem]>;
205
206  class AdvSIMD_Dot_Intrinsic
207    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
208                [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
209                [IntrNoMem]>;
210
211  class AdvSIMD_FP16FML_Intrinsic
212    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
213                [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
214                [IntrNoMem]>;
215
216  class AdvSIMD_MatMul_Intrinsic
217    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
218                [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
219                [IntrNoMem]>;
220
221  class AdvSIMD_FML_Intrinsic
222    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
223                [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
224                [IntrNoMem]>;
225
226  class AdvSIMD_BF16FML_Intrinsic
227    : DefaultAttrsIntrinsic<[llvm_v4f32_ty],
228                [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v8bf16_ty],
229                [IntrNoMem]>;
230}
231
232// Arithmetic ops
233
234let TargetPrefix = "aarch64", IntrProperties = [IntrNoMem] in {
235  // Vector Add Across Lanes
236  def int_aarch64_neon_saddv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
237  def int_aarch64_neon_uaddv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
238  def int_aarch64_neon_faddv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
239
240  // Vector Long Add Across Lanes
241  def int_aarch64_neon_saddlv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
242  def int_aarch64_neon_uaddlv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
243
244  // Vector Halving Add
245  def int_aarch64_neon_shadd : AdvSIMD_2VectorArg_Intrinsic;
246  def int_aarch64_neon_uhadd : AdvSIMD_2VectorArg_Intrinsic;
247
248  // Vector Rounding Halving Add
249  def int_aarch64_neon_srhadd : AdvSIMD_2VectorArg_Intrinsic;
250  def int_aarch64_neon_urhadd : AdvSIMD_2VectorArg_Intrinsic;
251
252  // Vector Saturating Add
253  def int_aarch64_neon_sqadd : AdvSIMD_2IntArg_Intrinsic;
254  def int_aarch64_neon_suqadd : AdvSIMD_2IntArg_Intrinsic;
255  def int_aarch64_neon_usqadd : AdvSIMD_2IntArg_Intrinsic;
256  def int_aarch64_neon_uqadd : AdvSIMD_2IntArg_Intrinsic;
257
258  // Vector Add High-Half
259  // FIXME: this is a legacy intrinsic for aarch64_simd.h. Remove it when that
260  // header is no longer supported.
261  def int_aarch64_neon_addhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
262
263  // Vector Rounding Add High-Half
264  def int_aarch64_neon_raddhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
265
266  // Vector Saturating Doubling Multiply High
267  def int_aarch64_neon_sqdmulh : AdvSIMD_2IntArg_Intrinsic;
268  def int_aarch64_neon_sqdmulh_lane : AdvSIMD_2VectorArg_Lane_Intrinsic;
269  def int_aarch64_neon_sqdmulh_laneq : AdvSIMD_2VectorArg_Lane_Intrinsic;
270
271  // Vector Saturating Rounding Doubling Multiply High
272  def int_aarch64_neon_sqrdmulh : AdvSIMD_2IntArg_Intrinsic;
273  def int_aarch64_neon_sqrdmulh_lane : AdvSIMD_2VectorArg_Lane_Intrinsic;
274  def int_aarch64_neon_sqrdmulh_laneq : AdvSIMD_2VectorArg_Lane_Intrinsic;
275
276  def int_aarch64_neon_sqrdmlah : AdvSIMD_3IntArg_Intrinsic;
277  def int_aarch64_neon_sqrdmlsh : AdvSIMD_3IntArg_Intrinsic;
278
279  // Vector Polynominal Multiply
280  def int_aarch64_neon_pmul : AdvSIMD_2VectorArg_Intrinsic;
281
282  // Vector Long Multiply
283  def int_aarch64_neon_smull : AdvSIMD_2VectorArg_Long_Intrinsic;
284  def int_aarch64_neon_umull : AdvSIMD_2VectorArg_Long_Intrinsic;
285  def int_aarch64_neon_pmull : AdvSIMD_2VectorArg_Long_Intrinsic;
286
287  // 64-bit polynomial multiply really returns an i128, which is not legal. Fake
288  // it with a v16i8.
289  def int_aarch64_neon_pmull64 :
290        DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
291
292  // Vector Extending Multiply
293  def int_aarch64_neon_fmulx : AdvSIMD_2FloatArg_Intrinsic {
294    let IntrProperties = [IntrNoMem, Commutative];
295  }
296
297  // Vector Saturating Doubling Long Multiply
298  def int_aarch64_neon_sqdmull : AdvSIMD_2VectorArg_Long_Intrinsic;
299  def int_aarch64_neon_sqdmulls_scalar
300    : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
301
302  // Vector Halving Subtract
303  def int_aarch64_neon_shsub : AdvSIMD_2VectorArg_Intrinsic;
304  def int_aarch64_neon_uhsub : AdvSIMD_2VectorArg_Intrinsic;
305
306  // Vector Saturating Subtract
307  def int_aarch64_neon_sqsub : AdvSIMD_2IntArg_Intrinsic;
308  def int_aarch64_neon_uqsub : AdvSIMD_2IntArg_Intrinsic;
309
310  // Vector Subtract High-Half
311  // FIXME: this is a legacy intrinsic for aarch64_simd.h. Remove it when that
312  // header is no longer supported.
313  def int_aarch64_neon_subhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
314
315  // Vector Rounding Subtract High-Half
316  def int_aarch64_neon_rsubhn : AdvSIMD_2VectorArg_Narrow_Intrinsic;
317
318  // Vector Compare Absolute Greater-than-or-equal
319  def int_aarch64_neon_facge : AdvSIMD_2Arg_FloatCompare_Intrinsic;
320
321  // Vector Compare Absolute Greater-than
322  def int_aarch64_neon_facgt : AdvSIMD_2Arg_FloatCompare_Intrinsic;
323
324  // Vector Absolute Difference
325  def int_aarch64_neon_sabd : AdvSIMD_2VectorArg_Intrinsic;
326  def int_aarch64_neon_uabd : AdvSIMD_2VectorArg_Intrinsic;
327  def int_aarch64_neon_fabd : AdvSIMD_2VectorArg_Intrinsic;
328
329  // Scalar Absolute Difference
330  def int_aarch64_sisd_fabd : AdvSIMD_2Scalar_Float_Intrinsic;
331
332  // Vector Max
333  def int_aarch64_neon_smax : AdvSIMD_2VectorArg_Intrinsic;
334  def int_aarch64_neon_umax : AdvSIMD_2VectorArg_Intrinsic;
335  def int_aarch64_neon_fmax : AdvSIMD_2FloatArg_Intrinsic;
336  def int_aarch64_neon_fmaxnmp : AdvSIMD_2VectorArg_Intrinsic;
337
338  // Vector Max Across Lanes
339  def int_aarch64_neon_smaxv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
340  def int_aarch64_neon_umaxv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
341  def int_aarch64_neon_fmaxv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
342  def int_aarch64_neon_fmaxnmv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
343
344  // Vector Min
345  def int_aarch64_neon_smin : AdvSIMD_2VectorArg_Intrinsic;
346  def int_aarch64_neon_umin : AdvSIMD_2VectorArg_Intrinsic;
347  def int_aarch64_neon_fmin : AdvSIMD_2FloatArg_Intrinsic;
348  def int_aarch64_neon_fminnmp : AdvSIMD_2VectorArg_Intrinsic;
349
350  // Vector Min/Max Number
351  def int_aarch64_neon_fminnm : AdvSIMD_2FloatArg_Intrinsic;
352  def int_aarch64_neon_fmaxnm : AdvSIMD_2FloatArg_Intrinsic;
353
354  // Vector Min Across Lanes
355  def int_aarch64_neon_sminv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
356  def int_aarch64_neon_uminv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
357  def int_aarch64_neon_fminv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
358  def int_aarch64_neon_fminnmv : AdvSIMD_1VectorArg_Float_Across_Intrinsic;
359
360  // Pairwise Add
361  def int_aarch64_neon_addp : AdvSIMD_2VectorArg_Intrinsic;
362  def int_aarch64_neon_faddp : AdvSIMD_2VectorArg_Intrinsic;
363
364  // Long Pairwise Add
365  // FIXME: In theory, we shouldn't need intrinsics for saddlp or
366  // uaddlp, but tblgen's type inference currently can't handle the
367  // pattern fragments this ends up generating.
368  def int_aarch64_neon_saddlp : AdvSIMD_1VectorArg_Expand_Intrinsic;
369  def int_aarch64_neon_uaddlp : AdvSIMD_1VectorArg_Expand_Intrinsic;
370
371  // Folding Maximum
372  def int_aarch64_neon_smaxp : AdvSIMD_2VectorArg_Intrinsic;
373  def int_aarch64_neon_umaxp : AdvSIMD_2VectorArg_Intrinsic;
374  def int_aarch64_neon_fmaxp : AdvSIMD_2VectorArg_Intrinsic;
375
376  // Folding Minimum
377  def int_aarch64_neon_sminp : AdvSIMD_2VectorArg_Intrinsic;
378  def int_aarch64_neon_uminp : AdvSIMD_2VectorArg_Intrinsic;
379  def int_aarch64_neon_fminp : AdvSIMD_2VectorArg_Intrinsic;
380
381  // Reciprocal Estimate/Step
382  def int_aarch64_neon_frecps : AdvSIMD_2FloatArg_Intrinsic;
383  def int_aarch64_neon_frsqrts : AdvSIMD_2FloatArg_Intrinsic;
384
385  // Reciprocal Exponent
386  def int_aarch64_neon_frecpx : AdvSIMD_1FloatArg_Intrinsic;
387
388  // Vector Saturating Shift Left
389  def int_aarch64_neon_sqshl : AdvSIMD_2IntArg_Intrinsic;
390  def int_aarch64_neon_uqshl : AdvSIMD_2IntArg_Intrinsic;
391
392  // Vector Rounding Shift Left
393  def int_aarch64_neon_srshl : AdvSIMD_2IntArg_Intrinsic;
394  def int_aarch64_neon_urshl : AdvSIMD_2IntArg_Intrinsic;
395
396  // Vector Saturating Rounding Shift Left
397  def int_aarch64_neon_sqrshl : AdvSIMD_2IntArg_Intrinsic;
398  def int_aarch64_neon_uqrshl : AdvSIMD_2IntArg_Intrinsic;
399
400  // Vector Signed->Unsigned Shift Left by Constant
401  def int_aarch64_neon_sqshlu : AdvSIMD_2IntArg_Intrinsic;
402
403  // Vector Signed->Unsigned Narrowing Saturating Shift Right by Constant
404  def int_aarch64_neon_sqshrun : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
405
406  // Vector Signed->Unsigned Rounding Narrowing Saturating Shift Right by Const
407  def int_aarch64_neon_sqrshrun : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
408
409  // Vector Narrowing Shift Right by Constant
410  def int_aarch64_neon_sqshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
411  def int_aarch64_neon_uqshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
412
413  // Vector Rounding Narrowing Shift Right by Constant
414  def int_aarch64_neon_rshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
415
416  // Vector Rounding Narrowing Saturating Shift Right by Constant
417  def int_aarch64_neon_sqrshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
418  def int_aarch64_neon_uqrshrn : AdvSIMD_2Arg_Scalar_Narrow_Intrinsic;
419
420  // Vector Shift Left
421  def int_aarch64_neon_sshl : AdvSIMD_2IntArg_Intrinsic;
422  def int_aarch64_neon_ushl : AdvSIMD_2IntArg_Intrinsic;
423
424  // Vector Widening Shift Left by Constant
425  def int_aarch64_neon_shll : AdvSIMD_2VectorArg_Scalar_Wide_BySize_Intrinsic;
426  def int_aarch64_neon_sshll : AdvSIMD_2VectorArg_Scalar_Wide_Intrinsic;
427  def int_aarch64_neon_ushll : AdvSIMD_2VectorArg_Scalar_Wide_Intrinsic;
428
429  // Vector Shift Right by Constant and Insert
430  def int_aarch64_neon_vsri : AdvSIMD_3VectorArg_Scalar_Intrinsic;
431
432  // Vector Shift Left by Constant and Insert
433  def int_aarch64_neon_vsli : AdvSIMD_3VectorArg_Scalar_Intrinsic;
434
435  // Vector Saturating Narrow
436  def int_aarch64_neon_scalar_sqxtn: AdvSIMD_1IntArg_Narrow_Intrinsic;
437  def int_aarch64_neon_scalar_uqxtn : AdvSIMD_1IntArg_Narrow_Intrinsic;
438  def int_aarch64_neon_sqxtn : AdvSIMD_1VectorArg_Narrow_Intrinsic;
439  def int_aarch64_neon_uqxtn : AdvSIMD_1VectorArg_Narrow_Intrinsic;
440
441  // Vector Saturating Extract and Unsigned Narrow
442  def int_aarch64_neon_scalar_sqxtun : AdvSIMD_1IntArg_Narrow_Intrinsic;
443  def int_aarch64_neon_sqxtun : AdvSIMD_1VectorArg_Narrow_Intrinsic;
444
445  // Vector Absolute Value
446  def int_aarch64_neon_abs : AdvSIMD_1Arg_Intrinsic;
447
448  // Vector Saturating Absolute Value
449  def int_aarch64_neon_sqabs : AdvSIMD_1IntArg_Intrinsic;
450
451  // Vector Saturating Negation
452  def int_aarch64_neon_sqneg : AdvSIMD_1IntArg_Intrinsic;
453
454  // Vector Count Leading Sign Bits
455  def int_aarch64_neon_cls : AdvSIMD_1VectorArg_Intrinsic;
456
457  // Vector Reciprocal Estimate
458  def int_aarch64_neon_urecpe : AdvSIMD_1VectorArg_Intrinsic;
459  def int_aarch64_neon_frecpe : AdvSIMD_1FloatArg_Intrinsic;
460
461  // Vector Square Root Estimate
462  def int_aarch64_neon_ursqrte : AdvSIMD_1VectorArg_Intrinsic;
463  def int_aarch64_neon_frsqrte : AdvSIMD_1FloatArg_Intrinsic;
464
465  // Vector Conversions Between Half-Precision and Single-Precision.
466  def int_aarch64_neon_vcvtfp2hf
467    : DefaultAttrsIntrinsic<[llvm_v4i16_ty], [llvm_v4f32_ty], [IntrNoMem]>;
468  def int_aarch64_neon_vcvthf2fp
469    : DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4i16_ty], [IntrNoMem]>;
470
471  // Vector Conversions Between Floating-point and Fixed-point.
472  def int_aarch64_neon_vcvtfp2fxs : AdvSIMD_CvtFPToFx_Intrinsic;
473  def int_aarch64_neon_vcvtfp2fxu : AdvSIMD_CvtFPToFx_Intrinsic;
474  def int_aarch64_neon_vcvtfxs2fp : AdvSIMD_CvtFxToFP_Intrinsic;
475  def int_aarch64_neon_vcvtfxu2fp : AdvSIMD_CvtFxToFP_Intrinsic;
476
477  // Vector FP->Int Conversions
478  def int_aarch64_neon_fcvtas : AdvSIMD_FPToIntRounding_Intrinsic;
479  def int_aarch64_neon_fcvtau : AdvSIMD_FPToIntRounding_Intrinsic;
480  def int_aarch64_neon_fcvtms : AdvSIMD_FPToIntRounding_Intrinsic;
481  def int_aarch64_neon_fcvtmu : AdvSIMD_FPToIntRounding_Intrinsic;
482  def int_aarch64_neon_fcvtns : AdvSIMD_FPToIntRounding_Intrinsic;
483  def int_aarch64_neon_fcvtnu : AdvSIMD_FPToIntRounding_Intrinsic;
484  def int_aarch64_neon_fcvtps : AdvSIMD_FPToIntRounding_Intrinsic;
485  def int_aarch64_neon_fcvtpu : AdvSIMD_FPToIntRounding_Intrinsic;
486  def int_aarch64_neon_fcvtzs : AdvSIMD_FPToIntRounding_Intrinsic;
487  def int_aarch64_neon_fcvtzu : AdvSIMD_FPToIntRounding_Intrinsic;
488
489  // v8.5-A Vector FP Rounding
490  def int_aarch64_neon_frint32x : AdvSIMD_1FloatArg_Intrinsic;
491  def int_aarch64_neon_frint32z : AdvSIMD_1FloatArg_Intrinsic;
492  def int_aarch64_neon_frint64x : AdvSIMD_1FloatArg_Intrinsic;
493  def int_aarch64_neon_frint64z : AdvSIMD_1FloatArg_Intrinsic;
494
495  // Scalar FP->Int conversions
496
497  // Vector FP Inexact Narrowing
498  def int_aarch64_neon_fcvtxn : AdvSIMD_1VectorArg_Expand_Intrinsic;
499
500  // Scalar FP Inexact Narrowing
501  def int_aarch64_sisd_fcvtxn : DefaultAttrsIntrinsic<[llvm_float_ty], [llvm_double_ty],
502                                        [IntrNoMem]>;
503
504  // v8.2-A Dot Product
505  def int_aarch64_neon_udot : AdvSIMD_Dot_Intrinsic;
506  def int_aarch64_neon_sdot : AdvSIMD_Dot_Intrinsic;
507
508  // v8.6-A Matrix Multiply Intrinsics
509  def int_aarch64_neon_ummla : AdvSIMD_MatMul_Intrinsic;
510  def int_aarch64_neon_smmla : AdvSIMD_MatMul_Intrinsic;
511  def int_aarch64_neon_usmmla : AdvSIMD_MatMul_Intrinsic;
512  def int_aarch64_neon_usdot : AdvSIMD_Dot_Intrinsic;
513  def int_aarch64_neon_bfdot : AdvSIMD_Dot_Intrinsic;
514  def int_aarch64_neon_bfmmla
515    : DefaultAttrsIntrinsic<[llvm_v4f32_ty],
516                [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v8bf16_ty],
517                [IntrNoMem]>;
518  def int_aarch64_neon_bfmlalb : AdvSIMD_BF16FML_Intrinsic;
519  def int_aarch64_neon_bfmlalt : AdvSIMD_BF16FML_Intrinsic;
520
521
522  // v8.6-A Bfloat Intrinsics
523  def int_aarch64_neon_bfcvt
524    : DefaultAttrsIntrinsic<[llvm_bfloat_ty], [llvm_float_ty], [IntrNoMem]>;
525  def int_aarch64_neon_bfcvtn
526    : DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v4f32_ty], [IntrNoMem]>;
527  def int_aarch64_neon_bfcvtn2
528    : DefaultAttrsIntrinsic<[llvm_v8bf16_ty],
529                [llvm_v8bf16_ty, llvm_v4f32_ty],
530                [IntrNoMem]>;
531
532  // v8.2-A FP16 Fused Multiply-Add Long
533  def int_aarch64_neon_fmlal : AdvSIMD_FP16FML_Intrinsic;
534  def int_aarch64_neon_fmlsl : AdvSIMD_FP16FML_Intrinsic;
535  def int_aarch64_neon_fmlal2 : AdvSIMD_FP16FML_Intrinsic;
536  def int_aarch64_neon_fmlsl2 : AdvSIMD_FP16FML_Intrinsic;
537
538  // v8.3-A Floating-point complex add
539  def int_aarch64_neon_vcadd_rot90  : AdvSIMD_2VectorArg_Intrinsic;
540  def int_aarch64_neon_vcadd_rot270 : AdvSIMD_2VectorArg_Intrinsic;
541
542  def int_aarch64_neon_vcmla_rot0   : AdvSIMD_3VectorArg_Intrinsic;
543  def int_aarch64_neon_vcmla_rot90  : AdvSIMD_3VectorArg_Intrinsic;
544  def int_aarch64_neon_vcmla_rot180 : AdvSIMD_3VectorArg_Intrinsic;
545  def int_aarch64_neon_vcmla_rot270 : AdvSIMD_3VectorArg_Intrinsic;
546}
547
548let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
549  class AdvSIMD_2Vector2Index_Intrinsic
550    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
551                [llvm_anyvector_ty, llvm_i64_ty, LLVMMatchType<0>, llvm_i64_ty],
552                [IntrNoMem]>;
553}
554
555// Vector element to element moves
556def int_aarch64_neon_vcopy_lane: AdvSIMD_2Vector2Index_Intrinsic;
557
558let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
559  class AdvSIMD_1Vec_Load_Intrinsic
560      : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_anyptr_ty],
561                  [IntrReadMem, IntrArgMemOnly]>;
562  class AdvSIMD_1Vec_Store_Lane_Intrinsic
563    : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, llvm_i64_ty, llvm_anyptr_ty],
564                [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
565
566  class AdvSIMD_2Vec_Load_Intrinsic
567    : DefaultAttrsIntrinsic<[LLVMMatchType<0>, llvm_anyvector_ty],
568                [llvm_anyptr_ty],
569                [IntrReadMem, IntrArgMemOnly]>;
570  class AdvSIMD_2Vec_Load_Lane_Intrinsic
571    : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>],
572                [LLVMMatchType<0>, llvm_anyvector_ty,
573                 llvm_i64_ty, llvm_anyptr_ty],
574                [IntrReadMem, IntrArgMemOnly]>;
575  class AdvSIMD_2Vec_Store_Intrinsic
576    : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
577                     llvm_anyptr_ty],
578                [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
579  class AdvSIMD_2Vec_Store_Lane_Intrinsic
580    : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
581                 llvm_i64_ty, llvm_anyptr_ty],
582                [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
583
584  class AdvSIMD_3Vec_Load_Intrinsic
585    : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyvector_ty],
586                [llvm_anyptr_ty],
587                [IntrReadMem, IntrArgMemOnly]>;
588  class AdvSIMD_3Vec_Load_Lane_Intrinsic
589    : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
590                [LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyvector_ty,
591                 llvm_i64_ty, llvm_anyptr_ty],
592                [IntrReadMem, IntrArgMemOnly]>;
593  class AdvSIMD_3Vec_Store_Intrinsic
594    : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
595                     LLVMMatchType<0>, llvm_anyptr_ty],
596                [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
597  class AdvSIMD_3Vec_Store_Lane_Intrinsic
598    : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty,
599                 LLVMMatchType<0>, LLVMMatchType<0>,
600                 llvm_i64_ty, llvm_anyptr_ty],
601                [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
602
603  class AdvSIMD_4Vec_Load_Intrinsic
604    : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>,
605                 LLVMMatchType<0>, llvm_anyvector_ty],
606                [llvm_anyptr_ty],
607                [IntrReadMem, IntrArgMemOnly]>;
608  class AdvSIMD_4Vec_Load_Lane_Intrinsic
609    : DefaultAttrsIntrinsic<[LLVMMatchType<0>, LLVMMatchType<0>,
610                 LLVMMatchType<0>, LLVMMatchType<0>],
611                [LLVMMatchType<0>, LLVMMatchType<0>,
612                 LLVMMatchType<0>, llvm_anyvector_ty,
613                 llvm_i64_ty, llvm_anyptr_ty],
614                [IntrReadMem, IntrArgMemOnly]>;
615  class AdvSIMD_4Vec_Store_Intrinsic
616    : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
617                 LLVMMatchType<0>, LLVMMatchType<0>,
618                 llvm_anyptr_ty],
619                [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
620  class AdvSIMD_4Vec_Store_Lane_Intrinsic
621    : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, LLVMMatchType<0>,
622                 LLVMMatchType<0>, LLVMMatchType<0>,
623                 llvm_i64_ty, llvm_anyptr_ty],
624                [IntrArgMemOnly, NoCapture<ArgIndex<5>>]>;
625}
626
627// Memory ops
628
629def int_aarch64_neon_ld1x2 : AdvSIMD_2Vec_Load_Intrinsic;
630def int_aarch64_neon_ld1x3 : AdvSIMD_3Vec_Load_Intrinsic;
631def int_aarch64_neon_ld1x4 : AdvSIMD_4Vec_Load_Intrinsic;
632
633def int_aarch64_neon_st1x2 : AdvSIMD_2Vec_Store_Intrinsic;
634def int_aarch64_neon_st1x3 : AdvSIMD_3Vec_Store_Intrinsic;
635def int_aarch64_neon_st1x4 : AdvSIMD_4Vec_Store_Intrinsic;
636
637def int_aarch64_neon_ld2 : AdvSIMD_2Vec_Load_Intrinsic;
638def int_aarch64_neon_ld3 : AdvSIMD_3Vec_Load_Intrinsic;
639def int_aarch64_neon_ld4 : AdvSIMD_4Vec_Load_Intrinsic;
640
641def int_aarch64_neon_ld2lane : AdvSIMD_2Vec_Load_Lane_Intrinsic;
642def int_aarch64_neon_ld3lane : AdvSIMD_3Vec_Load_Lane_Intrinsic;
643def int_aarch64_neon_ld4lane : AdvSIMD_4Vec_Load_Lane_Intrinsic;
644
645def int_aarch64_neon_ld2r : AdvSIMD_2Vec_Load_Intrinsic;
646def int_aarch64_neon_ld3r : AdvSIMD_3Vec_Load_Intrinsic;
647def int_aarch64_neon_ld4r : AdvSIMD_4Vec_Load_Intrinsic;
648
649def int_aarch64_neon_st2  : AdvSIMD_2Vec_Store_Intrinsic;
650def int_aarch64_neon_st3  : AdvSIMD_3Vec_Store_Intrinsic;
651def int_aarch64_neon_st4  : AdvSIMD_4Vec_Store_Intrinsic;
652
653def int_aarch64_neon_st2lane  : AdvSIMD_2Vec_Store_Lane_Intrinsic;
654def int_aarch64_neon_st3lane  : AdvSIMD_3Vec_Store_Lane_Intrinsic;
655def int_aarch64_neon_st4lane  : AdvSIMD_4Vec_Store_Lane_Intrinsic;
656
657let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
658  class AdvSIMD_Tbl1_Intrinsic
659    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_v16i8_ty, LLVMMatchType<0>],
660                [IntrNoMem]>;
661  class AdvSIMD_Tbl2_Intrinsic
662    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
663                [llvm_v16i8_ty, llvm_v16i8_ty, LLVMMatchType<0>], [IntrNoMem]>;
664  class AdvSIMD_Tbl3_Intrinsic
665    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
666                [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty,
667                 LLVMMatchType<0>],
668                [IntrNoMem]>;
669  class AdvSIMD_Tbl4_Intrinsic
670    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
671                [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty,
672                 LLVMMatchType<0>],
673                [IntrNoMem]>;
674
675  class AdvSIMD_Tbx1_Intrinsic
676    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
677                [LLVMMatchType<0>, llvm_v16i8_ty, LLVMMatchType<0>],
678                [IntrNoMem]>;
679  class AdvSIMD_Tbx2_Intrinsic
680    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
681                [LLVMMatchType<0>, llvm_v16i8_ty, llvm_v16i8_ty,
682                 LLVMMatchType<0>],
683                [IntrNoMem]>;
684  class AdvSIMD_Tbx3_Intrinsic
685    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
686                [LLVMMatchType<0>, llvm_v16i8_ty, llvm_v16i8_ty,
687                 llvm_v16i8_ty, LLVMMatchType<0>],
688                [IntrNoMem]>;
689  class AdvSIMD_Tbx4_Intrinsic
690    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
691                [LLVMMatchType<0>, llvm_v16i8_ty, llvm_v16i8_ty,
692                 llvm_v16i8_ty, llvm_v16i8_ty, LLVMMatchType<0>],
693                [IntrNoMem]>;
694}
695def int_aarch64_neon_tbl1 : AdvSIMD_Tbl1_Intrinsic;
696def int_aarch64_neon_tbl2 : AdvSIMD_Tbl2_Intrinsic;
697def int_aarch64_neon_tbl3 : AdvSIMD_Tbl3_Intrinsic;
698def int_aarch64_neon_tbl4 : AdvSIMD_Tbl4_Intrinsic;
699
700def int_aarch64_neon_tbx1 : AdvSIMD_Tbx1_Intrinsic;
701def int_aarch64_neon_tbx2 : AdvSIMD_Tbx2_Intrinsic;
702def int_aarch64_neon_tbx3 : AdvSIMD_Tbx3_Intrinsic;
703def int_aarch64_neon_tbx4 : AdvSIMD_Tbx4_Intrinsic;
704
705let TargetPrefix = "aarch64" in {
706  class FPCR_Get_Intrinsic
707    : DefaultAttrsIntrinsic<[llvm_i64_ty], [], [IntrNoMem, IntrHasSideEffects]>;
708  class FPCR_Set_Intrinsic
709    : DefaultAttrsIntrinsic<[], [llvm_i64_ty], [IntrNoMem, IntrHasSideEffects]>;
710  class RNDR_Intrinsic
711    : DefaultAttrsIntrinsic<[llvm_i64_ty, llvm_i1_ty], [], [IntrNoMem, IntrHasSideEffects]>;
712}
713
714// FPCR
715def int_aarch64_get_fpcr : FPCR_Get_Intrinsic;
716def int_aarch64_set_fpcr : FPCR_Set_Intrinsic;
717
718// Armv8.5-A Random number generation intrinsics
719def int_aarch64_rndr : RNDR_Intrinsic;
720def int_aarch64_rndrrs : RNDR_Intrinsic;
721
722let TargetPrefix = "aarch64" in {
723  class Crypto_AES_DataKey_Intrinsic
724    : DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
725
726  class Crypto_AES_Data_Intrinsic
727    : DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
728
729  // SHA intrinsic taking 5 words of the hash (v4i32, i32) and 4 of the schedule
730  // (v4i32).
731  class Crypto_SHA_5Hash4Schedule_Intrinsic
732    : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty, llvm_v4i32_ty],
733                [IntrNoMem]>;
734
735  // SHA intrinsic taking 5 words of the hash (v4i32, i32) and 4 of the schedule
736  // (v4i32).
737  class Crypto_SHA_1Hash_Intrinsic
738    : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
739
740  // SHA intrinsic taking 8 words of the schedule
741  class Crypto_SHA_8Schedule_Intrinsic
742    : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
743
744  // SHA intrinsic taking 12 words of the schedule
745  class Crypto_SHA_12Schedule_Intrinsic
746    : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
747                [IntrNoMem]>;
748
749  // SHA intrinsic taking 8 words of the hash and 4 of the schedule.
750  class Crypto_SHA_8Hash4Schedule_Intrinsic
751    : DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
752                [IntrNoMem]>;
753
754  // SHA512 intrinsic taking 2 arguments
755  class Crypto_SHA512_2Arg_Intrinsic
756    : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
757
758  // SHA512 intrinsic taking 3 Arguments
759  class Crypto_SHA512_3Arg_Intrinsic
760    : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
761                [IntrNoMem]>;
762
763  // SHA3 Intrinsics taking 3 arguments
764  class Crypto_SHA3_3Arg_Intrinsic
765    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
766               [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
767               [IntrNoMem]>;
768
769  // SHA3 Intrinsic taking 2 arguments
770  class Crypto_SHA3_2Arg_Intrinsic
771    : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
772               [IntrNoMem]>;
773
774  // SHA3 Intrinsic taking 3 Arguments 1 immediate
775  class Crypto_SHA3_2ArgImm_Intrinsic
776    : DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i64_ty],
777               [IntrNoMem, ImmArg<ArgIndex<2>>]>;
778
779  class Crypto_SM3_3Vector_Intrinsic
780    : Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
781                [IntrNoMem]>;
782
783  class Crypto_SM3_3VectorIndexed_Intrinsic
784    : Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i64_ty],
785                [IntrNoMem, ImmArg<ArgIndex<3>>]>;
786
787  class Crypto_SM4_2Vector_Intrinsic
788    : Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
789}
790
791// AES
792def int_aarch64_crypto_aese   : Crypto_AES_DataKey_Intrinsic;
793def int_aarch64_crypto_aesd   : Crypto_AES_DataKey_Intrinsic;
794def int_aarch64_crypto_aesmc  : Crypto_AES_Data_Intrinsic;
795def int_aarch64_crypto_aesimc : Crypto_AES_Data_Intrinsic;
796
797// SHA1
798def int_aarch64_crypto_sha1c  : Crypto_SHA_5Hash4Schedule_Intrinsic;
799def int_aarch64_crypto_sha1p  : Crypto_SHA_5Hash4Schedule_Intrinsic;
800def int_aarch64_crypto_sha1m  : Crypto_SHA_5Hash4Schedule_Intrinsic;
801def int_aarch64_crypto_sha1h  : Crypto_SHA_1Hash_Intrinsic;
802
803def int_aarch64_crypto_sha1su0 : Crypto_SHA_12Schedule_Intrinsic;
804def int_aarch64_crypto_sha1su1 : Crypto_SHA_8Schedule_Intrinsic;
805
806// SHA256
807def int_aarch64_crypto_sha256h   : Crypto_SHA_8Hash4Schedule_Intrinsic;
808def int_aarch64_crypto_sha256h2  : Crypto_SHA_8Hash4Schedule_Intrinsic;
809def int_aarch64_crypto_sha256su0 : Crypto_SHA_8Schedule_Intrinsic;
810def int_aarch64_crypto_sha256su1 : Crypto_SHA_12Schedule_Intrinsic;
811
812//SHA3
813def int_aarch64_crypto_eor3s : Crypto_SHA3_3Arg_Intrinsic;
814def int_aarch64_crypto_eor3u : Crypto_SHA3_3Arg_Intrinsic;
815def int_aarch64_crypto_bcaxs : Crypto_SHA3_3Arg_Intrinsic;
816def int_aarch64_crypto_bcaxu : Crypto_SHA3_3Arg_Intrinsic;
817def int_aarch64_crypto_rax1 : Crypto_SHA3_2Arg_Intrinsic;
818def int_aarch64_crypto_xar : Crypto_SHA3_2ArgImm_Intrinsic;
819
820// SHA512
821def int_aarch64_crypto_sha512h : Crypto_SHA512_3Arg_Intrinsic;
822def int_aarch64_crypto_sha512h2 : Crypto_SHA512_3Arg_Intrinsic;
823def int_aarch64_crypto_sha512su0 : Crypto_SHA512_2Arg_Intrinsic;
824def int_aarch64_crypto_sha512su1 : Crypto_SHA512_3Arg_Intrinsic;
825
826//SM3 & SM4
827def int_aarch64_crypto_sm3partw1 : Crypto_SM3_3Vector_Intrinsic;
828def int_aarch64_crypto_sm3partw2 : Crypto_SM3_3Vector_Intrinsic;
829def int_aarch64_crypto_sm3ss1    : Crypto_SM3_3Vector_Intrinsic;
830def int_aarch64_crypto_sm3tt1a   : Crypto_SM3_3VectorIndexed_Intrinsic;
831def int_aarch64_crypto_sm3tt1b   : Crypto_SM3_3VectorIndexed_Intrinsic;
832def int_aarch64_crypto_sm3tt2a   : Crypto_SM3_3VectorIndexed_Intrinsic;
833def int_aarch64_crypto_sm3tt2b   : Crypto_SM3_3VectorIndexed_Intrinsic;
834def int_aarch64_crypto_sm4e      : Crypto_SM4_2Vector_Intrinsic;
835def int_aarch64_crypto_sm4ekey   : Crypto_SM4_2Vector_Intrinsic;
836
837//===----------------------------------------------------------------------===//
838// CRC32
839
840let TargetPrefix = "aarch64" in {
841
842def int_aarch64_crc32b  : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
843    [IntrNoMem]>;
844def int_aarch64_crc32cb : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
845    [IntrNoMem]>;
846def int_aarch64_crc32h  : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
847    [IntrNoMem]>;
848def int_aarch64_crc32ch : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
849    [IntrNoMem]>;
850def int_aarch64_crc32w  : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
851    [IntrNoMem]>;
852def int_aarch64_crc32cw : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
853    [IntrNoMem]>;
854def int_aarch64_crc32x  : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i64_ty],
855    [IntrNoMem]>;
856def int_aarch64_crc32cx : DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i64_ty],
857    [IntrNoMem]>;
858}
859
860//===----------------------------------------------------------------------===//
861// Memory Tagging Extensions (MTE) Intrinsics
862let TargetPrefix = "aarch64" in {
863def int_aarch64_irg   : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i64_ty],
864    [IntrNoMem, IntrHasSideEffects]>;
865def int_aarch64_addg  : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i64_ty],
866    [IntrNoMem]>;
867def int_aarch64_gmi   : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_ptr_ty, llvm_i64_ty],
868    [IntrNoMem]>;
869def int_aarch64_ldg   : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_ptr_ty],
870    [IntrReadMem]>;
871def int_aarch64_stg   : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_ptr_ty],
872    [IntrWriteMem]>;
873def int_aarch64_subp :  DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_ptr_ty, llvm_ptr_ty],
874    [IntrNoMem]>;
875
876// The following are codegen-only intrinsics for stack instrumentation.
877
878// Generate a randomly tagged stack base pointer.
879def int_aarch64_irg_sp   : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_i64_ty],
880    [IntrNoMem, IntrHasSideEffects]>;
881
882// Transfer pointer tag with offset.
883// ptr1 = tagp(ptr0, baseptr, tag_offset) returns a pointer where
884// * address is the address in ptr0
885// * tag is a function of (tag in baseptr, tag_offset).
886// ** Beware, this is not the same function as implemented by the ADDG instruction!
887//    Backend optimizations may change tag_offset; the only guarantee is that calls
888//    to tagp with the same pair of (baseptr, tag_offset) will produce pointers
889//    with the same tag value, assuming the set of excluded tags has not changed.
890// Address bits in baseptr and tag bits in ptr0 are ignored.
891// When offset between ptr0 and baseptr is a compile time constant, this can be emitted as
892//   ADDG ptr1, baseptr, (ptr0 - baseptr), tag_offset
893// It is intended that ptr0 is an alloca address, and baseptr is the direct output of llvm.aarch64.irg.sp.
894def int_aarch64_tagp : DefaultAttrsIntrinsic<[llvm_anyptr_ty], [LLVMMatchType<0>, llvm_ptr_ty, llvm_i64_ty],
895    [IntrNoMem, ImmArg<ArgIndex<2>>]>;
896
897// Update allocation tags for the memory range to match the tag in the pointer argument.
898def int_aarch64_settag  : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_i64_ty],
899    [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
900
901// Update allocation tags for the memory range to match the tag in the pointer argument,
902// and set memory contents to zero.
903def int_aarch64_settag_zero  : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_i64_ty],
904    [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
905
906// Update allocation tags for 16-aligned, 16-sized memory region, and store a pair 8-byte values.
907def int_aarch64_stgp  : DefaultAttrsIntrinsic<[], [llvm_ptr_ty, llvm_i64_ty, llvm_i64_ty],
908    [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
909}
910
911//===----------------------------------------------------------------------===//
912// Memory Operations (MOPS) Intrinsics
913let TargetPrefix = "aarch64" in {
914  // Sizes are chosen to correspond to the llvm.memset intrinsic: ptr, i8, i64
915  def int_aarch64_mops_memset_tag : DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty, llvm_i64_ty],
916      [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
917}
918
919// Transactional Memory Extension (TME) Intrinsics
920let TargetPrefix = "aarch64" in {
921def int_aarch64_tstart  : ClangBuiltin<"__builtin_arm_tstart">,
922                         Intrinsic<[llvm_i64_ty], [], [IntrWillReturn]>;
923
924def int_aarch64_tcommit : ClangBuiltin<"__builtin_arm_tcommit">, Intrinsic<[], [], [IntrWillReturn]>;
925
926def int_aarch64_tcancel : ClangBuiltin<"__builtin_arm_tcancel">,
927                          Intrinsic<[], [llvm_i64_ty], [IntrWillReturn, ImmArg<ArgIndex<0>>]>;
928
929def int_aarch64_ttest   : ClangBuiltin<"__builtin_arm_ttest">,
930                          Intrinsic<[llvm_i64_ty], [],
931                                    [IntrNoMem, IntrHasSideEffects, IntrWillReturn]>;
932
933// Armv8.7-A load/store 64-byte intrinsics
934defvar data512 = !listsplat(llvm_i64_ty, 8);
935def int_aarch64_ld64b: Intrinsic<data512, [llvm_ptr_ty]>;
936def int_aarch64_st64b: Intrinsic<[], !listconcat([llvm_ptr_ty], data512)>;
937def int_aarch64_st64bv: Intrinsic<[llvm_i64_ty], !listconcat([llvm_ptr_ty], data512)>;
938def int_aarch64_st64bv0: Intrinsic<[llvm_i64_ty], !listconcat([llvm_ptr_ty], data512)>;
939
940}
941
942def llvm_nxv1i1_ty  : LLVMType<nxv1i1>;
943def llvm_nxv2i1_ty  : LLVMType<nxv2i1>;
944def llvm_nxv4i1_ty  : LLVMType<nxv4i1>;
945def llvm_nxv8i1_ty  : LLVMType<nxv8i1>;
946def llvm_nxv16i1_ty : LLVMType<nxv16i1>;
947def llvm_nxv16i8_ty : LLVMType<nxv16i8>;
948def llvm_nxv4i32_ty : LLVMType<nxv4i32>;
949def llvm_nxv2i64_ty : LLVMType<nxv2i64>;
950def llvm_nxv8f16_ty : LLVMType<nxv8f16>;
951def llvm_nxv8bf16_ty : LLVMType<nxv8bf16>;
952def llvm_nxv4f32_ty : LLVMType<nxv4f32>;
953def llvm_nxv2f64_ty : LLVMType<nxv2f64>;
954
955let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
956
957  class AdvSIMD_1Vec_PredLoad_Intrinsic
958    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
959                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
960                [IntrReadMem, IntrArgMemOnly]>;
961
962  class AdvSIMD_2Vec_PredLoad_Intrinsic
963    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
964                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
965                [IntrReadMem, IntrArgMemOnly]>;
966
967  class AdvSIMD_3Vec_PredLoad_Intrinsic
968    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>],
969                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
970                [IntrReadMem, IntrArgMemOnly]>;
971
972  class AdvSIMD_4Vec_PredLoad_Intrinsic
973    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
974                 LLVMMatchType<0>],
975                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
976                [IntrReadMem, IntrArgMemOnly]>;
977
978  class AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic
979    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
980                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
981                [IntrInaccessibleMemOrArgMemOnly]>;
982
983  class AdvSIMD_1Vec_PredStore_Intrinsic
984    : DefaultAttrsIntrinsic<[],
985                [llvm_anyvector_ty,
986                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
987                [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
988
989  class AdvSIMD_2Vec_PredStore_Intrinsic
990      : DefaultAttrsIntrinsic<[],
991                  [llvm_anyvector_ty, LLVMMatchType<0>,
992                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
993                  [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
994
995  class AdvSIMD_3Vec_PredStore_Intrinsic
996      : DefaultAttrsIntrinsic<[],
997                  [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
998                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
999                  [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
1000
1001  class AdvSIMD_4Vec_PredStore_Intrinsic
1002      : DefaultAttrsIntrinsic<[],
1003                  [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
1004                   LLVMMatchType<0>,
1005                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_ptr_ty],
1006                  [IntrArgMemOnly, NoCapture<ArgIndex<5>>]>;
1007
1008  class AdvSIMD_SVE_Index_Intrinsic
1009    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1010                [LLVMVectorElementType<0>,
1011                 LLVMVectorElementType<0>],
1012                [IntrNoMem]>;
1013
1014  class AdvSIMD_Merged1VectorArg_Intrinsic
1015    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1016                [LLVMMatchType<0>,
1017                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1018                 LLVMMatchType<0>],
1019                [IntrNoMem]>;
1020
1021  class AdvSIMD_2VectorArgIndexed_Intrinsic
1022    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1023                [LLVMMatchType<0>,
1024                 LLVMMatchType<0>,
1025                 llvm_i32_ty],
1026                [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1027
1028  class AdvSIMD_3VectorArgIndexed_Intrinsic
1029    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1030                [LLVMMatchType<0>,
1031                 LLVMMatchType<0>,
1032                 LLVMMatchType<0>,
1033                 llvm_i32_ty],
1034                [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1035
1036  class AdvSIMD_Pred1VectorArg_Intrinsic
1037    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1038                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1039                 LLVMMatchType<0>],
1040                [IntrNoMem]>;
1041
1042  class AdvSIMD_Pred2VectorArg_Intrinsic
1043    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1044                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1045                 LLVMMatchType<0>,
1046                 LLVMMatchType<0>],
1047                [IntrNoMem]>;
1048
1049  class AdvSIMD_Pred3VectorArg_Intrinsic
1050    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1051                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1052                 LLVMMatchType<0>,
1053                 LLVMMatchType<0>,
1054                 LLVMMatchType<0>],
1055                [IntrNoMem]>;
1056
1057  class AdvSIMD_SVE_Compare_Intrinsic
1058    : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
1059                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1060                 llvm_anyvector_ty,
1061                 LLVMMatchType<0>],
1062                [IntrNoMem]>;
1063
1064  class AdvSIMD_SVE_CompareWide_Intrinsic
1065    : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
1066                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1067                 llvm_anyvector_ty,
1068                 llvm_nxv2i64_ty],
1069                [IntrNoMem]>;
1070
1071  class AdvSIMD_SVE_Saturating_Intrinsic
1072    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1073                [LLVMMatchType<0>,
1074                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
1075                [IntrNoMem]>;
1076
1077  class AdvSIMD_SVE_SaturatingWithPattern_Intrinsic
1078    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1079                [LLVMMatchType<0>,
1080                 llvm_i32_ty,
1081                 llvm_i32_ty],
1082                [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
1083
1084  class AdvSIMD_SVE_Saturating_N_Intrinsic<LLVMType T>
1085    : DefaultAttrsIntrinsic<[T],
1086                [T, llvm_anyvector_ty],
1087                [IntrNoMem]>;
1088
1089  class AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<LLVMType T>
1090    : DefaultAttrsIntrinsic<[T],
1091                [T, llvm_i32_ty, llvm_i32_ty],
1092                [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
1093
1094  class AdvSIMD_SVE_CNT_Intrinsic
1095    : DefaultAttrsIntrinsic<[LLVMVectorOfBitcastsToInt<0>],
1096                [LLVMVectorOfBitcastsToInt<0>,
1097                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1098                 llvm_anyvector_ty],
1099                [IntrNoMem]>;
1100
1101  class AdvSIMD_SVE_ReduceWithInit_Intrinsic
1102    : DefaultAttrsIntrinsic<[LLVMVectorElementType<0>],
1103                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1104                 LLVMVectorElementType<0>,
1105                 llvm_anyvector_ty],
1106                [IntrNoMem]>;
1107
1108  class AdvSIMD_SVE_ShiftByImm_Intrinsic
1109    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1110                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1111                 LLVMMatchType<0>,
1112                 llvm_i32_ty],
1113                [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1114
1115  class AdvSIMD_SVE_ShiftWide_Intrinsic
1116    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1117                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1118                 LLVMMatchType<0>,
1119                 llvm_nxv2i64_ty],
1120                [IntrNoMem]>;
1121
1122  class AdvSIMD_SVE_Unpack_Intrinsic
1123    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1124               [LLVMSubdivide2VectorType<0>],
1125               [IntrNoMem]>;
1126
1127  class AdvSIMD_SVE_CADD_Intrinsic
1128    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1129                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1130                 LLVMMatchType<0>,
1131                 LLVMMatchType<0>,
1132                 llvm_i32_ty],
1133                [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1134
1135  class AdvSIMD_SVE_CMLA_Intrinsic
1136    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1137                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1138                 LLVMMatchType<0>,
1139                 LLVMMatchType<0>,
1140                 LLVMMatchType<0>,
1141                 llvm_i32_ty],
1142                [IntrNoMem, ImmArg<ArgIndex<4>>]>;
1143
1144  class AdvSIMD_SVE_CMLA_LANE_Intrinsic
1145    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1146                [LLVMMatchType<0>,
1147                 LLVMMatchType<0>,
1148                 LLVMMatchType<0>,
1149                 llvm_i32_ty,
1150                 llvm_i32_ty],
1151                [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
1152
1153  class AdvSIMD_SVE_DUP_Intrinsic
1154    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1155                [LLVMMatchType<0>,
1156                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1157                 LLVMVectorElementType<0>],
1158                [IntrNoMem]>;
1159
1160  class AdvSIMD_SVE_DUP_Unpred_Intrinsic
1161    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMVectorElementType<0>],
1162                [IntrNoMem]>;
1163
1164  class AdvSIMD_SVE_DUPQ_Intrinsic
1165    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1166                [LLVMMatchType<0>,
1167                 llvm_i64_ty],
1168                [IntrNoMem]>;
1169
1170  class AdvSIMD_SVE_EXPA_Intrinsic
1171    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1172                [LLVMVectorOfBitcastsToInt<0>],
1173                [IntrNoMem]>;
1174
1175  class AdvSIMD_SVE_FCVT_Intrinsic
1176    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1177                [LLVMMatchType<0>,
1178                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1179                 llvm_anyvector_ty],
1180                [IntrNoMem]>;
1181
1182  class AdvSIMD_SVE_FCVTZS_Intrinsic
1183    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1184                [LLVMVectorOfBitcastsToInt<0>,
1185                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1186                 llvm_anyvector_ty],
1187                [IntrNoMem]>;
1188
1189  class AdvSIMD_SVE_INSR_Intrinsic
1190    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1191                [LLVMMatchType<0>,
1192                 LLVMVectorElementType<0>],
1193                [IntrNoMem]>;
1194
1195  class AdvSIMD_SVE_PTRUE_Intrinsic
1196    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1197                [llvm_i32_ty],
1198                [IntrNoMem, ImmArg<ArgIndex<0>>]>;
1199
1200  class AdvSIMD_SVE_PUNPKHI_Intrinsic
1201    : DefaultAttrsIntrinsic<[LLVMHalfElementsVectorType<0>],
1202                [llvm_anyvector_ty],
1203                [IntrNoMem]>;
1204
1205  class AdvSIMD_SVE_SCALE_Intrinsic
1206    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1207                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1208                 LLVMMatchType<0>,
1209                 LLVMVectorOfBitcastsToInt<0>],
1210                [IntrNoMem]>;
1211
1212  class AdvSIMD_SVE_SCVTF_Intrinsic
1213    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1214                [LLVMMatchType<0>,
1215                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1216                 llvm_anyvector_ty],
1217                [IntrNoMem]>;
1218
1219  class AdvSIMD_SVE_TSMUL_Intrinsic
1220    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1221                [LLVMMatchType<0>,
1222                 LLVMVectorOfBitcastsToInt<0>],
1223                [IntrNoMem]>;
1224
1225  class AdvSIMD_SVE_CNTB_Intrinsic
1226    : DefaultAttrsIntrinsic<[llvm_i64_ty],
1227                [llvm_i32_ty],
1228                [IntrNoMem, ImmArg<ArgIndex<0>>]>;
1229
1230  class AdvSIMD_SVE_CNTP_Intrinsic
1231    : DefaultAttrsIntrinsic<[llvm_i64_ty],
1232                [llvm_anyvector_ty, LLVMMatchType<0>],
1233                [IntrNoMem]>;
1234
1235  class AdvSIMD_SVE_DOT_Intrinsic
1236    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1237                [LLVMMatchType<0>,
1238                 LLVMSubdivide4VectorType<0>,
1239                 LLVMSubdivide4VectorType<0>],
1240                [IntrNoMem]>;
1241
1242  class AdvSIMD_SVE_DOT_Indexed_Intrinsic
1243    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1244                [LLVMMatchType<0>,
1245                 LLVMSubdivide4VectorType<0>,
1246                 LLVMSubdivide4VectorType<0>,
1247                 llvm_i32_ty],
1248                [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1249
1250  class AdvSIMD_SVE_PTEST_Intrinsic
1251    : DefaultAttrsIntrinsic<[llvm_i1_ty],
1252                [llvm_anyvector_ty,
1253                 LLVMMatchType<0>],
1254                [IntrNoMem]>;
1255
1256  class AdvSIMD_SVE_TBL_Intrinsic
1257    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1258                [LLVMMatchType<0>,
1259                 LLVMVectorOfBitcastsToInt<0>],
1260                [IntrNoMem]>;
1261
1262  class AdvSIMD_SVE2_TBX_Intrinsic
1263    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1264                [LLVMMatchType<0>,
1265                 LLVMMatchType<0>,
1266                 LLVMVectorOfBitcastsToInt<0>],
1267                [IntrNoMem]>;
1268
1269  class SVE2_1VectorArg_Long_Intrinsic
1270    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1271                [LLVMSubdivide2VectorType<0>,
1272                 llvm_i32_ty],
1273                [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1274
1275  class SVE2_2VectorArg_Long_Intrinsic
1276    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1277                [LLVMSubdivide2VectorType<0>,
1278                 LLVMSubdivide2VectorType<0>],
1279                [IntrNoMem]>;
1280
1281  class SVE2_2VectorArgIndexed_Long_Intrinsic
1282  : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1283              [LLVMSubdivide2VectorType<0>,
1284               LLVMSubdivide2VectorType<0>,
1285               llvm_i32_ty],
1286              [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1287
1288  class SVE2_2VectorArg_Wide_Intrinsic
1289    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1290                [LLVMMatchType<0>,
1291                 LLVMSubdivide2VectorType<0>],
1292                [IntrNoMem]>;
1293
1294  class SVE2_2VectorArg_Pred_Long_Intrinsic
1295    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1296                [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1297                 LLVMMatchType<0>,
1298                 LLVMSubdivide2VectorType<0>],
1299                [IntrNoMem]>;
1300
1301  class SVE2_3VectorArg_Long_Intrinsic
1302    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1303                [LLVMMatchType<0>,
1304                 LLVMSubdivide2VectorType<0>,
1305                 LLVMSubdivide2VectorType<0>],
1306                [IntrNoMem]>;
1307
1308  class SVE2_3VectorArgIndexed_Long_Intrinsic
1309    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1310                [LLVMMatchType<0>,
1311                 LLVMSubdivide2VectorType<0>,
1312                 LLVMSubdivide2VectorType<0>,
1313                 llvm_i32_ty],
1314                [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1315
1316  class SVE2_1VectorArg_Narrowing_Intrinsic
1317    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
1318                [llvm_anyvector_ty],
1319                [IntrNoMem]>;
1320
1321  class SVE2_Merged1VectorArg_Narrowing_Intrinsic
1322    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
1323                [LLVMSubdivide2VectorType<0>,
1324                 llvm_anyvector_ty],
1325                [IntrNoMem]>;
1326  class SVE2_2VectorArg_Narrowing_Intrinsic
1327      : DefaultAttrsIntrinsic<
1328            [LLVMSubdivide2VectorType<0>],
1329            [llvm_anyvector_ty, LLVMMatchType<0>],
1330            [IntrNoMem]>;
1331
1332  class SVE2_Merged2VectorArg_Narrowing_Intrinsic
1333      : DefaultAttrsIntrinsic<
1334            [LLVMSubdivide2VectorType<0>],
1335            [LLVMSubdivide2VectorType<0>, llvm_anyvector_ty, LLVMMatchType<0>],
1336            [IntrNoMem]>;
1337
1338  class SVE2_1VectorArg_Imm_Narrowing_Intrinsic
1339      : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
1340                  [llvm_anyvector_ty, llvm_i32_ty],
1341                  [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1342
1343  class SVE2_2VectorArg_Imm_Narrowing_Intrinsic
1344      : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
1345                  [LLVMSubdivide2VectorType<0>, llvm_anyvector_ty,
1346                   llvm_i32_ty],
1347                  [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1348
1349  class SVE2_CONFLICT_DETECT_Intrinsic
1350    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1351                [llvm_anyptr_ty, LLVMMatchType<1>],
1352                [IntrNoMem]>;
1353
1354  class SVE2_3VectorArg_Indexed_Intrinsic
1355    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1356                [LLVMMatchType<0>,
1357                 LLVMSubdivide2VectorType<0>,
1358                 LLVMSubdivide2VectorType<0>,
1359                 llvm_i32_ty],
1360                [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1361
1362  class AdvSIMD_SVE_CDOT_LANE_Intrinsic
1363    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1364                [LLVMMatchType<0>,
1365                 LLVMSubdivide4VectorType<0>,
1366                 LLVMSubdivide4VectorType<0>,
1367                 llvm_i32_ty,
1368                 llvm_i32_ty],
1369                [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
1370
1371  // NOTE: There is no relationship between these intrinsics beyond an attempt
1372  // to reuse currently identical class definitions.
1373  class AdvSIMD_SVE_LOGB_Intrinsic  : AdvSIMD_SVE_CNT_Intrinsic;
1374  class AdvSIMD_SVE2_CADD_Intrinsic : AdvSIMD_2VectorArgIndexed_Intrinsic;
1375  class AdvSIMD_SVE2_CMLA_Intrinsic : AdvSIMD_3VectorArgIndexed_Intrinsic;
1376
1377  // This class of intrinsics are not intended to be useful within LLVM IR but
1378  // are instead here to support some of the more regid parts of the ACLE.
1379  class Builtin_SVCVT<LLVMType OUT, LLVMType PRED, LLVMType IN>
1380      : DefaultAttrsIntrinsic<[OUT], [OUT, PRED, IN], [IntrNoMem]>;
1381}
1382
1383//===----------------------------------------------------------------------===//
1384// SVE
1385
1386let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
1387
1388class AdvSIMD_SVE_2SVBoolArg_Intrinsic
1389  : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
1390                          [llvm_nxv16i1_ty],
1391                          [IntrNoMem]>;
1392
1393class AdvSIMD_SVE_3SVBoolArg_Intrinsic
1394  : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
1395                          [llvm_nxv16i1_ty, llvm_nxv16i1_ty],
1396                          [IntrNoMem]>;
1397
1398class AdvSIMD_SVE_Reduce_Intrinsic
1399  : DefaultAttrsIntrinsic<[LLVMVectorElementType<0>],
1400              [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1401               llvm_anyvector_ty],
1402              [IntrNoMem]>;
1403
1404class AdvSIMD_SVE_SADDV_Reduce_Intrinsic
1405  : DefaultAttrsIntrinsic<[llvm_i64_ty],
1406              [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1407               llvm_anyvector_ty],
1408              [IntrNoMem]>;
1409
1410class AdvSIMD_SVE_WHILE_Intrinsic
1411    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1412                [llvm_anyint_ty, LLVMMatchType<1>],
1413                [IntrNoMem]>;
1414
1415class AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic
1416    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1417                [
1418                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1419                  llvm_ptr_ty,
1420                  LLVMScalarOrSameVectorWidth<0, llvm_i64_ty>
1421                ],
1422                [IntrReadMem, IntrArgMemOnly]>;
1423
1424class AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic
1425    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1426                [
1427                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1428                  llvm_ptr_ty,
1429                  LLVMScalarOrSameVectorWidth<0, llvm_i64_ty>
1430                ],
1431                [IntrInaccessibleMemOrArgMemOnly]>;
1432
1433class AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic
1434    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1435                [
1436                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1437                  llvm_ptr_ty,
1438                  LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>
1439                ],
1440                [IntrReadMem, IntrArgMemOnly]>;
1441
1442class AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic
1443    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1444                [
1445                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1446                  llvm_ptr_ty,
1447                  LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>
1448                ],
1449                [IntrInaccessibleMemOrArgMemOnly]>;
1450
1451class AdvSIMD_GatherLoad_VS_Intrinsic
1452    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1453                [
1454                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1455                  llvm_anyvector_ty,
1456                  llvm_i64_ty
1457                ],
1458                [IntrReadMem]>;
1459
1460class AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic
1461    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1462                [
1463                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1464                  llvm_anyvector_ty,
1465                  llvm_i64_ty
1466                ],
1467                [IntrInaccessibleMemOrArgMemOnly]>;
1468
1469class AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic
1470    : DefaultAttrsIntrinsic<[],
1471               [
1472                 llvm_anyvector_ty,
1473                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1474                 llvm_ptr_ty,
1475                 LLVMScalarOrSameVectorWidth<0, llvm_i64_ty>
1476               ],
1477               [IntrWriteMem, IntrArgMemOnly]>;
1478
1479class AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic
1480    : DefaultAttrsIntrinsic<[],
1481               [
1482                 llvm_anyvector_ty,
1483                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1484                 llvm_ptr_ty,
1485                 LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>
1486               ],
1487               [IntrWriteMem, IntrArgMemOnly]>;
1488
1489class AdvSIMD_ScatterStore_VS_Intrinsic
1490    : DefaultAttrsIntrinsic<[],
1491               [
1492                 llvm_anyvector_ty,
1493                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
1494                 llvm_anyvector_ty, llvm_i64_ty
1495               ],
1496               [IntrWriteMem]>;
1497
1498
1499class SVE_gather_prf_SV
1500    : DefaultAttrsIntrinsic<[],
1501                [
1502                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, // Predicate
1503                  llvm_ptr_ty, // Base address
1504                  llvm_anyvector_ty, // Offsets
1505                  llvm_i32_ty // Prfop
1506                ],
1507                [IntrInaccessibleMemOrArgMemOnly, NoCapture<ArgIndex<1>>, ImmArg<ArgIndex<3>>]>;
1508
1509class SVE_gather_prf_VS
1510    : DefaultAttrsIntrinsic<[],
1511                [
1512                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, // Predicate
1513                  llvm_anyvector_ty, // Base addresses
1514                  llvm_i64_ty, // Scalar offset
1515                  llvm_i32_ty // Prfop
1516                ],
1517                [IntrInaccessibleMemOrArgMemOnly, ImmArg<ArgIndex<3>>]>;
1518
1519class SVE_MatMul_Intrinsic
1520    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
1521                [LLVMMatchType<0>, LLVMSubdivide4VectorType<0>, LLVMSubdivide4VectorType<0>],
1522                [IntrNoMem]>;
1523
1524class SVE_4Vec_BF16
1525    : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
1526                [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty],
1527                [IntrNoMem]>;
1528
1529class SVE_4Vec_BF16_Indexed
1530    : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
1531                [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty, llvm_i32_ty],
1532                [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1533
1534//
1535// Loads
1536//
1537
1538def int_aarch64_sve_ld1   : AdvSIMD_1Vec_PredLoad_Intrinsic;
1539
1540def int_aarch64_sve_ld2_sret : AdvSIMD_2Vec_PredLoad_Intrinsic;
1541def int_aarch64_sve_ld3_sret : AdvSIMD_3Vec_PredLoad_Intrinsic;
1542def int_aarch64_sve_ld4_sret : AdvSIMD_4Vec_PredLoad_Intrinsic;
1543
1544def int_aarch64_sve_ldnt1 : AdvSIMD_1Vec_PredLoad_Intrinsic;
1545def int_aarch64_sve_ldnf1 : AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
1546def int_aarch64_sve_ldff1 : AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
1547
1548def int_aarch64_sve_ld1rq : AdvSIMD_1Vec_PredLoad_Intrinsic;
1549def int_aarch64_sve_ld1ro : AdvSIMD_1Vec_PredLoad_Intrinsic;
1550
1551//
1552// Stores
1553//
1554
1555def int_aarch64_sve_st1  : AdvSIMD_1Vec_PredStore_Intrinsic;
1556def int_aarch64_sve_st2  : AdvSIMD_2Vec_PredStore_Intrinsic;
1557def int_aarch64_sve_st3  : AdvSIMD_3Vec_PredStore_Intrinsic;
1558def int_aarch64_sve_st4  : AdvSIMD_4Vec_PredStore_Intrinsic;
1559
1560def int_aarch64_sve_stnt1 : AdvSIMD_1Vec_PredStore_Intrinsic;
1561
1562//
1563// Prefetches
1564//
1565
1566def int_aarch64_sve_prf
1567  : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, llvm_ptr_ty, llvm_i32_ty],
1568                  [IntrArgMemOnly, ImmArg<ArgIndex<2>>]>;
1569
1570// Scalar + 32-bit scaled offset vector, zero extend, packed and
1571// unpacked.
1572def int_aarch64_sve_prfb_gather_uxtw_index : SVE_gather_prf_SV;
1573def int_aarch64_sve_prfh_gather_uxtw_index : SVE_gather_prf_SV;
1574def int_aarch64_sve_prfw_gather_uxtw_index : SVE_gather_prf_SV;
1575def int_aarch64_sve_prfd_gather_uxtw_index : SVE_gather_prf_SV;
1576
1577// Scalar + 32-bit scaled offset vector, sign extend, packed and
1578// unpacked.
1579def int_aarch64_sve_prfb_gather_sxtw_index : SVE_gather_prf_SV;
1580def int_aarch64_sve_prfw_gather_sxtw_index : SVE_gather_prf_SV;
1581def int_aarch64_sve_prfh_gather_sxtw_index : SVE_gather_prf_SV;
1582def int_aarch64_sve_prfd_gather_sxtw_index : SVE_gather_prf_SV;
1583
1584// Scalar + 64-bit scaled offset vector.
1585def int_aarch64_sve_prfb_gather_index : SVE_gather_prf_SV;
1586def int_aarch64_sve_prfh_gather_index : SVE_gather_prf_SV;
1587def int_aarch64_sve_prfw_gather_index : SVE_gather_prf_SV;
1588def int_aarch64_sve_prfd_gather_index : SVE_gather_prf_SV;
1589
1590// Vector + scalar.
1591def int_aarch64_sve_prfb_gather_scalar_offset : SVE_gather_prf_VS;
1592def int_aarch64_sve_prfh_gather_scalar_offset : SVE_gather_prf_VS;
1593def int_aarch64_sve_prfw_gather_scalar_offset : SVE_gather_prf_VS;
1594def int_aarch64_sve_prfd_gather_scalar_offset : SVE_gather_prf_VS;
1595
1596//
1597// Scalar to vector operations
1598//
1599
1600def int_aarch64_sve_dup : AdvSIMD_SVE_DUP_Intrinsic;
1601def int_aarch64_sve_dup_x : AdvSIMD_SVE_DUP_Unpred_Intrinsic;
1602
1603def int_aarch64_sve_index : AdvSIMD_SVE_Index_Intrinsic;
1604
1605//
1606// Address calculation
1607//
1608
1609def int_aarch64_sve_adrb : AdvSIMD_2VectorArg_Intrinsic;
1610def int_aarch64_sve_adrh : AdvSIMD_2VectorArg_Intrinsic;
1611def int_aarch64_sve_adrw : AdvSIMD_2VectorArg_Intrinsic;
1612def int_aarch64_sve_adrd : AdvSIMD_2VectorArg_Intrinsic;
1613
1614//
1615// Integer arithmetic
1616//
1617
1618def int_aarch64_sve_add   : AdvSIMD_Pred2VectorArg_Intrinsic;
1619def int_aarch64_sve_add_u : AdvSIMD_Pred2VectorArg_Intrinsic;
1620def int_aarch64_sve_sub   : AdvSIMD_Pred2VectorArg_Intrinsic;
1621def int_aarch64_sve_sub_u : AdvSIMD_Pred2VectorArg_Intrinsic;
1622def int_aarch64_sve_subr  : AdvSIMD_Pred2VectorArg_Intrinsic;
1623
1624def int_aarch64_sve_pmul       : AdvSIMD_2VectorArg_Intrinsic;
1625
1626def int_aarch64_sve_mul        : AdvSIMD_Pred2VectorArg_Intrinsic;
1627def int_aarch64_sve_mul_u      : AdvSIMD_Pred2VectorArg_Intrinsic;
1628def int_aarch64_sve_mul_lane   : AdvSIMD_2VectorArgIndexed_Intrinsic;
1629def int_aarch64_sve_smulh      : AdvSIMD_Pred2VectorArg_Intrinsic;
1630def int_aarch64_sve_smulh_u    : AdvSIMD_Pred2VectorArg_Intrinsic;
1631def int_aarch64_sve_umulh      : AdvSIMD_Pred2VectorArg_Intrinsic;
1632def int_aarch64_sve_umulh_u    : AdvSIMD_Pred2VectorArg_Intrinsic;
1633
1634def int_aarch64_sve_sdiv       : AdvSIMD_Pred2VectorArg_Intrinsic;
1635def int_aarch64_sve_sdiv_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1636def int_aarch64_sve_udiv       : AdvSIMD_Pred2VectorArg_Intrinsic;
1637def int_aarch64_sve_udiv_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1638def int_aarch64_sve_sdivr      : AdvSIMD_Pred2VectorArg_Intrinsic;
1639def int_aarch64_sve_udivr      : AdvSIMD_Pred2VectorArg_Intrinsic;
1640
1641def int_aarch64_sve_smax       : AdvSIMD_Pred2VectorArg_Intrinsic;
1642def int_aarch64_sve_smax_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1643def int_aarch64_sve_umax       : AdvSIMD_Pred2VectorArg_Intrinsic;
1644def int_aarch64_sve_umax_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1645def int_aarch64_sve_smin       : AdvSIMD_Pred2VectorArg_Intrinsic;
1646def int_aarch64_sve_smin_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1647def int_aarch64_sve_umin       : AdvSIMD_Pred2VectorArg_Intrinsic;
1648def int_aarch64_sve_umin_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1649def int_aarch64_sve_sabd       : AdvSIMD_Pred2VectorArg_Intrinsic;
1650def int_aarch64_sve_sabd_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1651def int_aarch64_sve_uabd       : AdvSIMD_Pred2VectorArg_Intrinsic;
1652def int_aarch64_sve_uabd_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1653
1654def int_aarch64_sve_mad        : AdvSIMD_Pred3VectorArg_Intrinsic;
1655def int_aarch64_sve_msb        : AdvSIMD_Pred3VectorArg_Intrinsic;
1656def int_aarch64_sve_mla        : AdvSIMD_Pred3VectorArg_Intrinsic;
1657def int_aarch64_sve_mla_u      : AdvSIMD_Pred3VectorArg_Intrinsic;
1658def int_aarch64_sve_mla_lane   : AdvSIMD_3VectorArgIndexed_Intrinsic;
1659def int_aarch64_sve_mls        : AdvSIMD_Pred3VectorArg_Intrinsic;
1660def int_aarch64_sve_mls_u      : AdvSIMD_Pred3VectorArg_Intrinsic;
1661def int_aarch64_sve_mls_lane   : AdvSIMD_3VectorArgIndexed_Intrinsic;
1662
1663def int_aarch64_sve_saddv      : AdvSIMD_SVE_SADDV_Reduce_Intrinsic;
1664def int_aarch64_sve_uaddv      : AdvSIMD_SVE_SADDV_Reduce_Intrinsic;
1665
1666def int_aarch64_sve_smaxv      : AdvSIMD_SVE_Reduce_Intrinsic;
1667def int_aarch64_sve_umaxv      : AdvSIMD_SVE_Reduce_Intrinsic;
1668def int_aarch64_sve_sminv      : AdvSIMD_SVE_Reduce_Intrinsic;
1669def int_aarch64_sve_uminv      : AdvSIMD_SVE_Reduce_Intrinsic;
1670
1671def int_aarch64_sve_orv        : AdvSIMD_SVE_Reduce_Intrinsic;
1672def int_aarch64_sve_eorv       : AdvSIMD_SVE_Reduce_Intrinsic;
1673def int_aarch64_sve_andv       : AdvSIMD_SVE_Reduce_Intrinsic;
1674
1675def int_aarch64_sve_abs : AdvSIMD_Merged1VectorArg_Intrinsic;
1676def int_aarch64_sve_neg : AdvSIMD_Merged1VectorArg_Intrinsic;
1677
1678def int_aarch64_sve_sdot      : AdvSIMD_SVE_DOT_Intrinsic;
1679def int_aarch64_sve_sdot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
1680
1681def int_aarch64_sve_udot      : AdvSIMD_SVE_DOT_Intrinsic;
1682def int_aarch64_sve_udot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
1683
1684def int_aarch64_sve_sqadd_x   : AdvSIMD_2VectorArg_Intrinsic;
1685def int_aarch64_sve_sqsub_x   : AdvSIMD_2VectorArg_Intrinsic;
1686def int_aarch64_sve_uqadd_x   : AdvSIMD_2VectorArg_Intrinsic;
1687def int_aarch64_sve_uqsub_x   : AdvSIMD_2VectorArg_Intrinsic;
1688
1689// Shifts
1690
1691def int_aarch64_sve_asr      : AdvSIMD_Pred2VectorArg_Intrinsic;
1692def int_aarch64_sve_asr_u    : AdvSIMD_Pred2VectorArg_Intrinsic;
1693def int_aarch64_sve_asr_wide : AdvSIMD_SVE_ShiftWide_Intrinsic;
1694def int_aarch64_sve_asrd     : AdvSIMD_SVE_ShiftByImm_Intrinsic;
1695def int_aarch64_sve_insr     : AdvSIMD_SVE_INSR_Intrinsic;
1696def int_aarch64_sve_lsl      : AdvSIMD_Pred2VectorArg_Intrinsic;
1697def int_aarch64_sve_lsl_u    : AdvSIMD_Pred2VectorArg_Intrinsic;
1698def int_aarch64_sve_lsl_wide : AdvSIMD_SVE_ShiftWide_Intrinsic;
1699def int_aarch64_sve_lsr      : AdvSIMD_Pred2VectorArg_Intrinsic;
1700def int_aarch64_sve_lsr_u    : AdvSIMD_Pred2VectorArg_Intrinsic;
1701def int_aarch64_sve_lsr_wide : AdvSIMD_SVE_ShiftWide_Intrinsic;
1702
1703//
1704// Integer comparisons
1705//
1706
1707def int_aarch64_sve_cmpeq : AdvSIMD_SVE_Compare_Intrinsic;
1708def int_aarch64_sve_cmpge : AdvSIMD_SVE_Compare_Intrinsic;
1709def int_aarch64_sve_cmpgt : AdvSIMD_SVE_Compare_Intrinsic;
1710def int_aarch64_sve_cmphi : AdvSIMD_SVE_Compare_Intrinsic;
1711def int_aarch64_sve_cmphs : AdvSIMD_SVE_Compare_Intrinsic;
1712def int_aarch64_sve_cmpne : AdvSIMD_SVE_Compare_Intrinsic;
1713
1714def int_aarch64_sve_cmpeq_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1715def int_aarch64_sve_cmpge_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1716def int_aarch64_sve_cmpgt_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1717def int_aarch64_sve_cmphi_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1718def int_aarch64_sve_cmphs_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1719def int_aarch64_sve_cmple_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1720def int_aarch64_sve_cmplo_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1721def int_aarch64_sve_cmpls_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1722def int_aarch64_sve_cmplt_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1723def int_aarch64_sve_cmpne_wide : AdvSIMD_SVE_CompareWide_Intrinsic;
1724
1725//
1726// Counting bits
1727//
1728
1729def int_aarch64_sve_cls : AdvSIMD_Merged1VectorArg_Intrinsic;
1730def int_aarch64_sve_clz : AdvSIMD_Merged1VectorArg_Intrinsic;
1731def int_aarch64_sve_cnt : AdvSIMD_SVE_CNT_Intrinsic;
1732
1733//
1734// Counting elements
1735//
1736
1737def int_aarch64_sve_cntb : AdvSIMD_SVE_CNTB_Intrinsic;
1738def int_aarch64_sve_cnth : AdvSIMD_SVE_CNTB_Intrinsic;
1739def int_aarch64_sve_cntw : AdvSIMD_SVE_CNTB_Intrinsic;
1740def int_aarch64_sve_cntd : AdvSIMD_SVE_CNTB_Intrinsic;
1741
1742def int_aarch64_sve_cntp : AdvSIMD_SVE_CNTP_Intrinsic;
1743
1744//
1745// FFR manipulation
1746//
1747
1748def int_aarch64_sve_rdffr   : ClangBuiltin<"__builtin_sve_svrdffr">,   DefaultAttrsIntrinsic<[llvm_nxv16i1_ty], [], [IntrReadMem, IntrInaccessibleMemOnly]>;
1749def int_aarch64_sve_rdffr_z : ClangBuiltin<"__builtin_sve_svrdffr_z">, DefaultAttrsIntrinsic<[llvm_nxv16i1_ty], [llvm_nxv16i1_ty], [IntrReadMem, IntrInaccessibleMemOnly]>;
1750def int_aarch64_sve_setffr  : ClangBuiltin<"__builtin_sve_svsetffr">,  DefaultAttrsIntrinsic<[], [], [IntrWriteMem, IntrInaccessibleMemOnly]>;
1751def int_aarch64_sve_wrffr   : ClangBuiltin<"__builtin_sve_svwrffr">,   DefaultAttrsIntrinsic<[], [llvm_nxv16i1_ty], [IntrWriteMem, IntrInaccessibleMemOnly]>;
1752
1753//
1754// Saturating scalar arithmetic
1755//
1756
1757def int_aarch64_sve_sqdech : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1758def int_aarch64_sve_sqdecw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1759def int_aarch64_sve_sqdecd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1760def int_aarch64_sve_sqdecp : AdvSIMD_SVE_Saturating_Intrinsic;
1761
1762def int_aarch64_sve_sqdecb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1763def int_aarch64_sve_sqdecb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1764def int_aarch64_sve_sqdech_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1765def int_aarch64_sve_sqdech_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1766def int_aarch64_sve_sqdecw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1767def int_aarch64_sve_sqdecw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1768def int_aarch64_sve_sqdecd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1769def int_aarch64_sve_sqdecd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1770def int_aarch64_sve_sqdecp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
1771def int_aarch64_sve_sqdecp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
1772
1773def int_aarch64_sve_sqinch : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1774def int_aarch64_sve_sqincw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1775def int_aarch64_sve_sqincd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1776def int_aarch64_sve_sqincp : AdvSIMD_SVE_Saturating_Intrinsic;
1777
1778def int_aarch64_sve_sqincb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1779def int_aarch64_sve_sqincb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1780def int_aarch64_sve_sqinch_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1781def int_aarch64_sve_sqinch_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1782def int_aarch64_sve_sqincw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1783def int_aarch64_sve_sqincw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1784def int_aarch64_sve_sqincd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1785def int_aarch64_sve_sqincd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1786def int_aarch64_sve_sqincp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
1787def int_aarch64_sve_sqincp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
1788
1789def int_aarch64_sve_uqdech : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1790def int_aarch64_sve_uqdecw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1791def int_aarch64_sve_uqdecd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1792def int_aarch64_sve_uqdecp : AdvSIMD_SVE_Saturating_Intrinsic;
1793
1794def int_aarch64_sve_uqdecb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1795def int_aarch64_sve_uqdecb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1796def int_aarch64_sve_uqdech_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1797def int_aarch64_sve_uqdech_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1798def int_aarch64_sve_uqdecw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1799def int_aarch64_sve_uqdecw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1800def int_aarch64_sve_uqdecd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1801def int_aarch64_sve_uqdecd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1802def int_aarch64_sve_uqdecp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
1803def int_aarch64_sve_uqdecp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
1804
1805def int_aarch64_sve_uqinch : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1806def int_aarch64_sve_uqincw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1807def int_aarch64_sve_uqincd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic;
1808def int_aarch64_sve_uqincp : AdvSIMD_SVE_Saturating_Intrinsic;
1809
1810def int_aarch64_sve_uqincb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1811def int_aarch64_sve_uqincb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1812def int_aarch64_sve_uqinch_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1813def int_aarch64_sve_uqinch_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1814def int_aarch64_sve_uqincw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1815def int_aarch64_sve_uqincw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1816def int_aarch64_sve_uqincd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty>;
1817def int_aarch64_sve_uqincd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty>;
1818def int_aarch64_sve_uqincp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty>;
1819def int_aarch64_sve_uqincp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty>;
1820
1821//
1822// Reversal
1823//
1824
1825def int_aarch64_sve_rbit : AdvSIMD_Merged1VectorArg_Intrinsic;
1826def int_aarch64_sve_revb : AdvSIMD_Merged1VectorArg_Intrinsic;
1827def int_aarch64_sve_revh : AdvSIMD_Merged1VectorArg_Intrinsic;
1828def int_aarch64_sve_revw : AdvSIMD_Merged1VectorArg_Intrinsic;
1829
1830//
1831// Permutations and selection
1832//
1833
1834def int_aarch64_sve_clasta    : AdvSIMD_Pred2VectorArg_Intrinsic;
1835def int_aarch64_sve_clasta_n  : AdvSIMD_SVE_ReduceWithInit_Intrinsic;
1836def int_aarch64_sve_clastb    : AdvSIMD_Pred2VectorArg_Intrinsic;
1837def int_aarch64_sve_clastb_n  : AdvSIMD_SVE_ReduceWithInit_Intrinsic;
1838def int_aarch64_sve_compact   : AdvSIMD_Pred1VectorArg_Intrinsic;
1839def int_aarch64_sve_dupq_lane : AdvSIMD_SVE_DUPQ_Intrinsic;
1840def int_aarch64_sve_ext       : AdvSIMD_2VectorArgIndexed_Intrinsic;
1841def int_aarch64_sve_sel       : AdvSIMD_Pred2VectorArg_Intrinsic;
1842def int_aarch64_sve_lasta     : AdvSIMD_SVE_Reduce_Intrinsic;
1843def int_aarch64_sve_lastb     : AdvSIMD_SVE_Reduce_Intrinsic;
1844def int_aarch64_sve_rev       : AdvSIMD_1VectorArg_Intrinsic;
1845def int_aarch64_sve_rev_b16   : AdvSIMD_SVE_2SVBoolArg_Intrinsic;
1846def int_aarch64_sve_rev_b32   : AdvSIMD_SVE_2SVBoolArg_Intrinsic;
1847def int_aarch64_sve_rev_b64   : AdvSIMD_SVE_2SVBoolArg_Intrinsic;
1848def int_aarch64_sve_splice    : AdvSIMD_Pred2VectorArg_Intrinsic;
1849def int_aarch64_sve_sunpkhi   : AdvSIMD_SVE_Unpack_Intrinsic;
1850def int_aarch64_sve_sunpklo   : AdvSIMD_SVE_Unpack_Intrinsic;
1851def int_aarch64_sve_tbl       : AdvSIMD_SVE_TBL_Intrinsic;
1852def int_aarch64_sve_trn1      : AdvSIMD_2VectorArg_Intrinsic;
1853def int_aarch64_sve_trn1_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1854def int_aarch64_sve_trn1_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1855def int_aarch64_sve_trn1_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1856def int_aarch64_sve_trn2      : AdvSIMD_2VectorArg_Intrinsic;
1857def int_aarch64_sve_trn2_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1858def int_aarch64_sve_trn2_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1859def int_aarch64_sve_trn2_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1860def int_aarch64_sve_trn1q     : AdvSIMD_2VectorArg_Intrinsic;
1861def int_aarch64_sve_trn2q     : AdvSIMD_2VectorArg_Intrinsic;
1862def int_aarch64_sve_uunpkhi   : AdvSIMD_SVE_Unpack_Intrinsic;
1863def int_aarch64_sve_uunpklo   : AdvSIMD_SVE_Unpack_Intrinsic;
1864def int_aarch64_sve_uzp1      : AdvSIMD_2VectorArg_Intrinsic;
1865def int_aarch64_sve_uzp1_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1866def int_aarch64_sve_uzp1_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1867def int_aarch64_sve_uzp1_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1868def int_aarch64_sve_uzp2      : AdvSIMD_2VectorArg_Intrinsic;
1869def int_aarch64_sve_uzp2_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1870def int_aarch64_sve_uzp2_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1871def int_aarch64_sve_uzp2_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1872def int_aarch64_sve_uzp1q     : AdvSIMD_2VectorArg_Intrinsic;
1873def int_aarch64_sve_uzp2q     : AdvSIMD_2VectorArg_Intrinsic;
1874def int_aarch64_sve_zip1      : AdvSIMD_2VectorArg_Intrinsic;
1875def int_aarch64_sve_zip1_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1876def int_aarch64_sve_zip1_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1877def int_aarch64_sve_zip1_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1878def int_aarch64_sve_zip2      : AdvSIMD_2VectorArg_Intrinsic;
1879def int_aarch64_sve_zip2_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1880def int_aarch64_sve_zip2_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1881def int_aarch64_sve_zip2_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic;
1882def int_aarch64_sve_zip1q     : AdvSIMD_2VectorArg_Intrinsic;
1883def int_aarch64_sve_zip2q     : AdvSIMD_2VectorArg_Intrinsic;
1884
1885//
1886// Logical operations
1887//
1888
1889def int_aarch64_sve_and  : AdvSIMD_Pred2VectorArg_Intrinsic;
1890def int_aarch64_sve_and_u: AdvSIMD_Pred2VectorArg_Intrinsic;
1891def int_aarch64_sve_bic  : AdvSIMD_Pred2VectorArg_Intrinsic;
1892def int_aarch64_sve_bic_u: AdvSIMD_Pred2VectorArg_Intrinsic;
1893def int_aarch64_sve_cnot : AdvSIMD_Merged1VectorArg_Intrinsic;
1894def int_aarch64_sve_eor  : AdvSIMD_Pred2VectorArg_Intrinsic;
1895def int_aarch64_sve_eor_u: AdvSIMD_Pred2VectorArg_Intrinsic;
1896def int_aarch64_sve_not  : AdvSIMD_Merged1VectorArg_Intrinsic;
1897def int_aarch64_sve_orr  : AdvSIMD_Pred2VectorArg_Intrinsic;
1898def int_aarch64_sve_orr_u: AdvSIMD_Pred2VectorArg_Intrinsic;
1899
1900//
1901// Conversion
1902//
1903
1904def int_aarch64_sve_sxtb : AdvSIMD_Merged1VectorArg_Intrinsic;
1905def int_aarch64_sve_sxth : AdvSIMD_Merged1VectorArg_Intrinsic;
1906def int_aarch64_sve_sxtw : AdvSIMD_Merged1VectorArg_Intrinsic;
1907def int_aarch64_sve_uxtb : AdvSIMD_Merged1VectorArg_Intrinsic;
1908def int_aarch64_sve_uxth : AdvSIMD_Merged1VectorArg_Intrinsic;
1909def int_aarch64_sve_uxtw : AdvSIMD_Merged1VectorArg_Intrinsic;
1910
1911//
1912// While comparisons
1913//
1914
1915def int_aarch64_sve_whilele : AdvSIMD_SVE_WHILE_Intrinsic;
1916def int_aarch64_sve_whilelo : AdvSIMD_SVE_WHILE_Intrinsic;
1917def int_aarch64_sve_whilels : AdvSIMD_SVE_WHILE_Intrinsic;
1918def int_aarch64_sve_whilelt : AdvSIMD_SVE_WHILE_Intrinsic;
1919def int_aarch64_sve_whilege : AdvSIMD_SVE_WHILE_Intrinsic;
1920def int_aarch64_sve_whilegt : AdvSIMD_SVE_WHILE_Intrinsic;
1921def int_aarch64_sve_whilehs : AdvSIMD_SVE_WHILE_Intrinsic;
1922def int_aarch64_sve_whilehi : AdvSIMD_SVE_WHILE_Intrinsic;
1923
1924//
1925// Floating-point arithmetic
1926//
1927
1928def int_aarch64_sve_fabd       : AdvSIMD_Pred2VectorArg_Intrinsic;
1929def int_aarch64_sve_fabd_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1930def int_aarch64_sve_fabs       : AdvSIMD_Merged1VectorArg_Intrinsic;
1931def int_aarch64_sve_fadd       : AdvSIMD_Pred2VectorArg_Intrinsic;
1932def int_aarch64_sve_fadd_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1933def int_aarch64_sve_fcadd      : AdvSIMD_SVE_CADD_Intrinsic;
1934def int_aarch64_sve_fcmla      : AdvSIMD_SVE_CMLA_Intrinsic;
1935def int_aarch64_sve_fcmla_lane : AdvSIMD_SVE_CMLA_LANE_Intrinsic;
1936def int_aarch64_sve_fdiv       : AdvSIMD_Pred2VectorArg_Intrinsic;
1937def int_aarch64_sve_fdiv_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1938def int_aarch64_sve_fdivr      : AdvSIMD_Pred2VectorArg_Intrinsic;
1939def int_aarch64_sve_fexpa_x    : AdvSIMD_SVE_EXPA_Intrinsic;
1940def int_aarch64_sve_fmad       : AdvSIMD_Pred3VectorArg_Intrinsic;
1941def int_aarch64_sve_fmax       : AdvSIMD_Pred2VectorArg_Intrinsic;
1942def int_aarch64_sve_fmax_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1943def int_aarch64_sve_fmaxnm     : AdvSIMD_Pred2VectorArg_Intrinsic;
1944def int_aarch64_sve_fmaxnm_u   : AdvSIMD_Pred2VectorArg_Intrinsic;
1945def int_aarch64_sve_fmin       : AdvSIMD_Pred2VectorArg_Intrinsic;
1946def int_aarch64_sve_fmin_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1947def int_aarch64_sve_fminnm     : AdvSIMD_Pred2VectorArg_Intrinsic;
1948def int_aarch64_sve_fminnm_u   : AdvSIMD_Pred2VectorArg_Intrinsic;
1949def int_aarch64_sve_fmla       : AdvSIMD_Pred3VectorArg_Intrinsic;
1950def int_aarch64_sve_fmla_lane  : AdvSIMD_3VectorArgIndexed_Intrinsic;
1951def int_aarch64_sve_fmla_u     : AdvSIMD_Pred3VectorArg_Intrinsic;
1952def int_aarch64_sve_fmls       : AdvSIMD_Pred3VectorArg_Intrinsic;
1953def int_aarch64_sve_fmls_lane  : AdvSIMD_3VectorArgIndexed_Intrinsic;
1954def int_aarch64_sve_fmls_u     : AdvSIMD_Pred3VectorArg_Intrinsic;
1955def int_aarch64_sve_fmsb       : AdvSIMD_Pred3VectorArg_Intrinsic;
1956def int_aarch64_sve_fmul       : AdvSIMD_Pred2VectorArg_Intrinsic;
1957def int_aarch64_sve_fmul_lane  : AdvSIMD_2VectorArgIndexed_Intrinsic;
1958def int_aarch64_sve_fmul_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1959def int_aarch64_sve_fmulx      : AdvSIMD_Pred2VectorArg_Intrinsic;
1960def int_aarch64_sve_fmulx_u    : AdvSIMD_Pred2VectorArg_Intrinsic;
1961def int_aarch64_sve_fneg       : AdvSIMD_Merged1VectorArg_Intrinsic;
1962def int_aarch64_sve_fnmad      : AdvSIMD_Pred3VectorArg_Intrinsic;
1963def int_aarch64_sve_fnmla      : AdvSIMD_Pred3VectorArg_Intrinsic;
1964def int_aarch64_sve_fnmla_u    : AdvSIMD_Pred3VectorArg_Intrinsic;
1965def int_aarch64_sve_fnmls      : AdvSIMD_Pred3VectorArg_Intrinsic;
1966def int_aarch64_sve_fnmls_u    : AdvSIMD_Pred3VectorArg_Intrinsic;
1967def int_aarch64_sve_fnmsb      : AdvSIMD_Pred3VectorArg_Intrinsic;
1968def int_aarch64_sve_frecpe_x   : AdvSIMD_1VectorArg_Intrinsic;
1969def int_aarch64_sve_frecps_x   : AdvSIMD_2VectorArg_Intrinsic;
1970def int_aarch64_sve_frecpx     : AdvSIMD_Merged1VectorArg_Intrinsic;
1971def int_aarch64_sve_frinta     : AdvSIMD_Merged1VectorArg_Intrinsic;
1972def int_aarch64_sve_frinti     : AdvSIMD_Merged1VectorArg_Intrinsic;
1973def int_aarch64_sve_frintm     : AdvSIMD_Merged1VectorArg_Intrinsic;
1974def int_aarch64_sve_frintn     : AdvSIMD_Merged1VectorArg_Intrinsic;
1975def int_aarch64_sve_frintp     : AdvSIMD_Merged1VectorArg_Intrinsic;
1976def int_aarch64_sve_frintx     : AdvSIMD_Merged1VectorArg_Intrinsic;
1977def int_aarch64_sve_frintz     : AdvSIMD_Merged1VectorArg_Intrinsic;
1978def int_aarch64_sve_frsqrte_x  : AdvSIMD_1VectorArg_Intrinsic;
1979def int_aarch64_sve_frsqrts_x  : AdvSIMD_2VectorArg_Intrinsic;
1980def int_aarch64_sve_fscale     : AdvSIMD_SVE_SCALE_Intrinsic;
1981def int_aarch64_sve_fsqrt      : AdvSIMD_Merged1VectorArg_Intrinsic;
1982def int_aarch64_sve_fsub       : AdvSIMD_Pred2VectorArg_Intrinsic;
1983def int_aarch64_sve_fsub_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
1984def int_aarch64_sve_fsubr      : AdvSIMD_Pred2VectorArg_Intrinsic;
1985def int_aarch64_sve_ftmad_x    : AdvSIMD_2VectorArgIndexed_Intrinsic;
1986def int_aarch64_sve_ftsmul_x   : AdvSIMD_SVE_TSMUL_Intrinsic;
1987def int_aarch64_sve_ftssel_x   : AdvSIMD_SVE_TSMUL_Intrinsic;
1988
1989//
1990// Floating-point reductions
1991//
1992
1993def int_aarch64_sve_fadda   : AdvSIMD_SVE_ReduceWithInit_Intrinsic;
1994def int_aarch64_sve_faddv   : AdvSIMD_SVE_Reduce_Intrinsic;
1995def int_aarch64_sve_fmaxv   : AdvSIMD_SVE_Reduce_Intrinsic;
1996def int_aarch64_sve_fmaxnmv : AdvSIMD_SVE_Reduce_Intrinsic;
1997def int_aarch64_sve_fminv   : AdvSIMD_SVE_Reduce_Intrinsic;
1998def int_aarch64_sve_fminnmv : AdvSIMD_SVE_Reduce_Intrinsic;
1999
2000//
2001// Floating-point conversions
2002//
2003
2004def int_aarch64_sve_fcvt   : AdvSIMD_SVE_FCVT_Intrinsic;
2005def int_aarch64_sve_fcvtzs : AdvSIMD_SVE_FCVTZS_Intrinsic;
2006def int_aarch64_sve_fcvtzu : AdvSIMD_SVE_FCVTZS_Intrinsic;
2007def int_aarch64_sve_scvtf  : AdvSIMD_SVE_SCVTF_Intrinsic;
2008def int_aarch64_sve_ucvtf  : AdvSIMD_SVE_SCVTF_Intrinsic;
2009
2010//
2011// Floating-point comparisons
2012//
2013
2014def int_aarch64_sve_facge : AdvSIMD_SVE_Compare_Intrinsic;
2015def int_aarch64_sve_facgt : AdvSIMD_SVE_Compare_Intrinsic;
2016
2017def int_aarch64_sve_fcmpeq : AdvSIMD_SVE_Compare_Intrinsic;
2018def int_aarch64_sve_fcmpge : AdvSIMD_SVE_Compare_Intrinsic;
2019def int_aarch64_sve_fcmpgt : AdvSIMD_SVE_Compare_Intrinsic;
2020def int_aarch64_sve_fcmpne : AdvSIMD_SVE_Compare_Intrinsic;
2021def int_aarch64_sve_fcmpuo : AdvSIMD_SVE_Compare_Intrinsic;
2022
2023def int_aarch64_sve_fcvtzs_i32f16   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
2024def int_aarch64_sve_fcvtzs_i32f64   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
2025def int_aarch64_sve_fcvtzs_i64f16   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
2026def int_aarch64_sve_fcvtzs_i64f32   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
2027
2028def int_aarch64_sve_fcvt_bf16f32    : Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv8i1_ty, llvm_nxv4f32_ty>;
2029def int_aarch64_sve_fcvtnt_bf16f32  : Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv8i1_ty, llvm_nxv4f32_ty>;
2030
2031def int_aarch64_sve_fcvtzu_i32f16   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
2032def int_aarch64_sve_fcvtzu_i32f64   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
2033def int_aarch64_sve_fcvtzu_i64f16   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
2034def int_aarch64_sve_fcvtzu_i64f32   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
2035
2036def int_aarch64_sve_fcvt_f16f32     : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
2037def int_aarch64_sve_fcvt_f16f64     : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
2038def int_aarch64_sve_fcvt_f32f64     : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
2039
2040def int_aarch64_sve_fcvt_f32f16     : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
2041def int_aarch64_sve_fcvt_f64f16     : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
2042def int_aarch64_sve_fcvt_f64f32     : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
2043
2044def int_aarch64_sve_fcvtlt_f32f16   : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
2045def int_aarch64_sve_fcvtlt_f64f32   : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
2046def int_aarch64_sve_fcvtnt_f16f32   : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
2047def int_aarch64_sve_fcvtnt_f32f64   : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
2048
2049def int_aarch64_sve_fcvtx_f32f64    : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
2050def int_aarch64_sve_fcvtxnt_f32f64  : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
2051
2052def int_aarch64_sve_scvtf_f16i32    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
2053def int_aarch64_sve_scvtf_f16i64    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
2054def int_aarch64_sve_scvtf_f32i64    : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
2055def int_aarch64_sve_scvtf_f64i32    : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
2056
2057def int_aarch64_sve_ucvtf_f16i32    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
2058def int_aarch64_sve_ucvtf_f16i64    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
2059def int_aarch64_sve_ucvtf_f32i64    : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
2060def int_aarch64_sve_ucvtf_f64i32    : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
2061
2062//
2063// Predicate creation
2064//
2065
2066def int_aarch64_sve_ptrue : AdvSIMD_SVE_PTRUE_Intrinsic;
2067
2068//
2069// Predicate operations
2070//
2071
2072def int_aarch64_sve_and_z   : AdvSIMD_Pred2VectorArg_Intrinsic;
2073def int_aarch64_sve_bic_z   : AdvSIMD_Pred2VectorArg_Intrinsic;
2074def int_aarch64_sve_brka    : AdvSIMD_Merged1VectorArg_Intrinsic;
2075def int_aarch64_sve_brka_z  : AdvSIMD_Pred1VectorArg_Intrinsic;
2076def int_aarch64_sve_brkb    : AdvSIMD_Merged1VectorArg_Intrinsic;
2077def int_aarch64_sve_brkb_z  : AdvSIMD_Pred1VectorArg_Intrinsic;
2078def int_aarch64_sve_brkn_z  : AdvSIMD_Pred2VectorArg_Intrinsic;
2079def int_aarch64_sve_brkpa_z : AdvSIMD_Pred2VectorArg_Intrinsic;
2080def int_aarch64_sve_brkpb_z : AdvSIMD_Pred2VectorArg_Intrinsic;
2081def int_aarch64_sve_eor_z   : AdvSIMD_Pred2VectorArg_Intrinsic;
2082def int_aarch64_sve_nand_z  : AdvSIMD_Pred2VectorArg_Intrinsic;
2083def int_aarch64_sve_nor_z   : AdvSIMD_Pred2VectorArg_Intrinsic;
2084def int_aarch64_sve_orn_z   : AdvSIMD_Pred2VectorArg_Intrinsic;
2085def int_aarch64_sve_orr_z   : AdvSIMD_Pred2VectorArg_Intrinsic;
2086def int_aarch64_sve_pfirst  : AdvSIMD_Pred1VectorArg_Intrinsic;
2087def int_aarch64_sve_pnext   : AdvSIMD_Pred1VectorArg_Intrinsic;
2088def int_aarch64_sve_punpkhi : AdvSIMD_SVE_PUNPKHI_Intrinsic;
2089def int_aarch64_sve_punpklo : AdvSIMD_SVE_PUNPKHI_Intrinsic;
2090
2091//
2092// Testing predicates
2093//
2094
2095def int_aarch64_sve_ptest_any   : AdvSIMD_SVE_PTEST_Intrinsic;
2096def int_aarch64_sve_ptest_first : AdvSIMD_SVE_PTEST_Intrinsic;
2097def int_aarch64_sve_ptest_last  : AdvSIMD_SVE_PTEST_Intrinsic;
2098
2099//
2100// Reinterpreting data
2101//
2102
2103def int_aarch64_sve_convert_from_svbool : DefaultAttrsIntrinsic<[llvm_any_ty],
2104                                                    [llvm_nxv16i1_ty],
2105                                                    [IntrNoMem]>;
2106
2107def int_aarch64_sve_convert_to_svbool : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
2108                                                  [llvm_any_ty],
2109                                                  [IntrNoMem]>;
2110
2111//
2112// Gather loads: scalar base + vector offsets
2113//
2114
2115// 64 bit unscaled offsets
2116def int_aarch64_sve_ld1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
2117
2118// 64 bit scaled offsets
2119def int_aarch64_sve_ld1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
2120
2121// 32 bit unscaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
2122def int_aarch64_sve_ld1_gather_sxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
2123def int_aarch64_sve_ld1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
2124
2125// 32 bit scaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
2126def int_aarch64_sve_ld1_gather_sxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
2127def int_aarch64_sve_ld1_gather_uxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
2128
2129//
2130// Gather loads: vector base + scalar offset
2131//
2132
2133def int_aarch64_sve_ld1_gather_scalar_offset : AdvSIMD_GatherLoad_VS_Intrinsic;
2134
2135
2136//
2137// First-faulting gather loads: scalar base + vector offsets
2138//
2139
2140// 64 bit unscaled offsets
2141def int_aarch64_sve_ldff1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
2142
2143// 64 bit scaled offsets
2144def int_aarch64_sve_ldff1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
2145
2146// 32 bit unscaled offsets, sign (sxtw) or zero (uxtw) extended to 64 bits
2147def int_aarch64_sve_ldff1_gather_sxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
2148def int_aarch64_sve_ldff1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
2149
2150// 32 bit scaled offsets, sign (sxtw) or zero (uxtw) extended to 64 bits
2151def int_aarch64_sve_ldff1_gather_sxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
2152def int_aarch64_sve_ldff1_gather_uxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
2153
2154//
2155// First-faulting gather loads: vector base + scalar offset
2156//
2157
2158def int_aarch64_sve_ldff1_gather_scalar_offset : AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic;
2159
2160
2161//
2162// Non-temporal gather loads: scalar base + vector offsets
2163//
2164
2165// 64 bit unscaled offsets
2166def int_aarch64_sve_ldnt1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
2167
2168// 64 bit indices
2169def int_aarch64_sve_ldnt1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
2170
2171// 32 bit unscaled offsets, zero (zxtw) extended to 64 bits
2172def int_aarch64_sve_ldnt1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
2173
2174//
2175// Non-temporal gather loads: vector base + scalar offset
2176//
2177
2178def int_aarch64_sve_ldnt1_gather_scalar_offset  : AdvSIMD_GatherLoad_VS_Intrinsic;
2179
2180//
2181// Scatter stores: scalar base + vector offsets
2182//
2183
2184// 64 bit unscaled offsets
2185def int_aarch64_sve_st1_scatter : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
2186
2187// 64 bit scaled offsets
2188def int_aarch64_sve_st1_scatter_index
2189    : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
2190
2191// 32 bit unscaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
2192def int_aarch64_sve_st1_scatter_sxtw
2193    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
2194
2195def int_aarch64_sve_st1_scatter_uxtw
2196    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
2197
2198// 32 bit scaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
2199def int_aarch64_sve_st1_scatter_sxtw_index
2200    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
2201
2202def int_aarch64_sve_st1_scatter_uxtw_index
2203    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
2204
2205//
2206// Scatter stores: vector base + scalar offset
2207//
2208
2209def int_aarch64_sve_st1_scatter_scalar_offset : AdvSIMD_ScatterStore_VS_Intrinsic;
2210
2211//
2212// Non-temporal scatter stores: scalar base + vector offsets
2213//
2214
2215// 64 bit unscaled offsets
2216def int_aarch64_sve_stnt1_scatter : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
2217
2218// 64 bit indices
2219def int_aarch64_sve_stnt1_scatter_index
2220    : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
2221
2222// 32 bit unscaled offsets, zero (zxtw) extended to 64 bits
2223def int_aarch64_sve_stnt1_scatter_uxtw : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
2224
2225//
2226// Non-temporal scatter stores: vector base + scalar offset
2227//
2228
2229def int_aarch64_sve_stnt1_scatter_scalar_offset  : AdvSIMD_ScatterStore_VS_Intrinsic;
2230
2231//
2232// SVE2 - Uniform DSP operations
2233//
2234
2235def int_aarch64_sve_saba          : AdvSIMD_3VectorArg_Intrinsic;
2236def int_aarch64_sve_shadd         : AdvSIMD_Pred2VectorArg_Intrinsic;
2237def int_aarch64_sve_shsub         : AdvSIMD_Pred2VectorArg_Intrinsic;
2238def int_aarch64_sve_shsubr        : AdvSIMD_Pred2VectorArg_Intrinsic;
2239def int_aarch64_sve_sli           : AdvSIMD_2VectorArgIndexed_Intrinsic;
2240def int_aarch64_sve_sqabs         : AdvSIMD_Merged1VectorArg_Intrinsic;
2241def int_aarch64_sve_sqadd         : AdvSIMD_Pred2VectorArg_Intrinsic;
2242def int_aarch64_sve_sqdmulh       : AdvSIMD_2VectorArg_Intrinsic;
2243def int_aarch64_sve_sqdmulh_lane  : AdvSIMD_2VectorArgIndexed_Intrinsic;
2244def int_aarch64_sve_sqneg         : AdvSIMD_Merged1VectorArg_Intrinsic;
2245def int_aarch64_sve_sqrdmlah      : AdvSIMD_3VectorArg_Intrinsic;
2246def int_aarch64_sve_sqrdmlah_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
2247def int_aarch64_sve_sqrdmlsh      : AdvSIMD_3VectorArg_Intrinsic;
2248def int_aarch64_sve_sqrdmlsh_lane : AdvSIMD_3VectorArgIndexed_Intrinsic;
2249def int_aarch64_sve_sqrdmulh      : AdvSIMD_2VectorArg_Intrinsic;
2250def int_aarch64_sve_sqrdmulh_lane : AdvSIMD_2VectorArgIndexed_Intrinsic;
2251def int_aarch64_sve_sqrshl        : AdvSIMD_Pred2VectorArg_Intrinsic;
2252def int_aarch64_sve_sqshl         : AdvSIMD_Pred2VectorArg_Intrinsic;
2253def int_aarch64_sve_sqshlu        : AdvSIMD_SVE_ShiftByImm_Intrinsic;
2254def int_aarch64_sve_sqsub         : AdvSIMD_Pred2VectorArg_Intrinsic;
2255def int_aarch64_sve_sqsub_u       : AdvSIMD_Pred2VectorArg_Intrinsic;
2256def int_aarch64_sve_sqsubr        : AdvSIMD_Pred2VectorArg_Intrinsic;
2257def int_aarch64_sve_srhadd        : AdvSIMD_Pred2VectorArg_Intrinsic;
2258def int_aarch64_sve_sri           : AdvSIMD_2VectorArgIndexed_Intrinsic;
2259def int_aarch64_sve_srshl         : AdvSIMD_Pred2VectorArg_Intrinsic;
2260def int_aarch64_sve_srshr         : AdvSIMD_SVE_ShiftByImm_Intrinsic;
2261def int_aarch64_sve_srsra         : AdvSIMD_2VectorArgIndexed_Intrinsic;
2262def int_aarch64_sve_ssra          : AdvSIMD_2VectorArgIndexed_Intrinsic;
2263def int_aarch64_sve_suqadd        : AdvSIMD_Pred2VectorArg_Intrinsic;
2264def int_aarch64_sve_uaba          : AdvSIMD_3VectorArg_Intrinsic;
2265def int_aarch64_sve_uhadd         : AdvSIMD_Pred2VectorArg_Intrinsic;
2266def int_aarch64_sve_uhsub         : AdvSIMD_Pred2VectorArg_Intrinsic;
2267def int_aarch64_sve_uhsubr        : AdvSIMD_Pred2VectorArg_Intrinsic;
2268def int_aarch64_sve_uqadd         : AdvSIMD_Pred2VectorArg_Intrinsic;
2269def int_aarch64_sve_uqrshl        : AdvSIMD_Pred2VectorArg_Intrinsic;
2270def int_aarch64_sve_uqshl         : AdvSIMD_Pred2VectorArg_Intrinsic;
2271def int_aarch64_sve_uqsub         : AdvSIMD_Pred2VectorArg_Intrinsic;
2272def int_aarch64_sve_uqsub_u       : AdvSIMD_Pred2VectorArg_Intrinsic;
2273def int_aarch64_sve_uqsubr        : AdvSIMD_Pred2VectorArg_Intrinsic;
2274def int_aarch64_sve_urecpe        : AdvSIMD_Merged1VectorArg_Intrinsic;
2275def int_aarch64_sve_urhadd        : AdvSIMD_Pred2VectorArg_Intrinsic;
2276def int_aarch64_sve_urshl         : AdvSIMD_Pred2VectorArg_Intrinsic;
2277def int_aarch64_sve_urshr         : AdvSIMD_SVE_ShiftByImm_Intrinsic;
2278def int_aarch64_sve_ursqrte       : AdvSIMD_Merged1VectorArg_Intrinsic;
2279def int_aarch64_sve_ursra         : AdvSIMD_2VectorArgIndexed_Intrinsic;
2280def int_aarch64_sve_usqadd        : AdvSIMD_Pred2VectorArg_Intrinsic;
2281def int_aarch64_sve_usra          : AdvSIMD_2VectorArgIndexed_Intrinsic;
2282
2283//
2284// SVE2 - Widening DSP operations
2285//
2286
2287def int_aarch64_sve_sabalb : SVE2_3VectorArg_Long_Intrinsic;
2288def int_aarch64_sve_sabalt : SVE2_3VectorArg_Long_Intrinsic;
2289def int_aarch64_sve_sabdlb : SVE2_2VectorArg_Long_Intrinsic;
2290def int_aarch64_sve_sabdlt : SVE2_2VectorArg_Long_Intrinsic;
2291def int_aarch64_sve_saddlb : SVE2_2VectorArg_Long_Intrinsic;
2292def int_aarch64_sve_saddlt : SVE2_2VectorArg_Long_Intrinsic;
2293def int_aarch64_sve_saddwb : SVE2_2VectorArg_Wide_Intrinsic;
2294def int_aarch64_sve_saddwt : SVE2_2VectorArg_Wide_Intrinsic;
2295def int_aarch64_sve_sshllb : SVE2_1VectorArg_Long_Intrinsic;
2296def int_aarch64_sve_sshllt : SVE2_1VectorArg_Long_Intrinsic;
2297def int_aarch64_sve_ssublb : SVE2_2VectorArg_Long_Intrinsic;
2298def int_aarch64_sve_ssublt : SVE2_2VectorArg_Long_Intrinsic;
2299def int_aarch64_sve_ssubwb : SVE2_2VectorArg_Wide_Intrinsic;
2300def int_aarch64_sve_ssubwt : SVE2_2VectorArg_Wide_Intrinsic;
2301def int_aarch64_sve_uabalb : SVE2_3VectorArg_Long_Intrinsic;
2302def int_aarch64_sve_uabalt : SVE2_3VectorArg_Long_Intrinsic;
2303def int_aarch64_sve_uabdlb : SVE2_2VectorArg_Long_Intrinsic;
2304def int_aarch64_sve_uabdlt : SVE2_2VectorArg_Long_Intrinsic;
2305def int_aarch64_sve_uaddlb : SVE2_2VectorArg_Long_Intrinsic;
2306def int_aarch64_sve_uaddlt : SVE2_2VectorArg_Long_Intrinsic;
2307def int_aarch64_sve_uaddwb : SVE2_2VectorArg_Wide_Intrinsic;
2308def int_aarch64_sve_uaddwt : SVE2_2VectorArg_Wide_Intrinsic;
2309def int_aarch64_sve_ushllb : SVE2_1VectorArg_Long_Intrinsic;
2310def int_aarch64_sve_ushllt : SVE2_1VectorArg_Long_Intrinsic;
2311def int_aarch64_sve_usublb : SVE2_2VectorArg_Long_Intrinsic;
2312def int_aarch64_sve_usublt : SVE2_2VectorArg_Long_Intrinsic;
2313def int_aarch64_sve_usubwb : SVE2_2VectorArg_Wide_Intrinsic;
2314def int_aarch64_sve_usubwt : SVE2_2VectorArg_Wide_Intrinsic;
2315
2316//
2317// SVE2 - Non-widening pairwise arithmetic
2318//
2319
2320def int_aarch64_sve_addp    : AdvSIMD_Pred2VectorArg_Intrinsic;
2321def int_aarch64_sve_faddp   : AdvSIMD_Pred2VectorArg_Intrinsic;
2322def int_aarch64_sve_fmaxp   : AdvSIMD_Pred2VectorArg_Intrinsic;
2323def int_aarch64_sve_fmaxnmp : AdvSIMD_Pred2VectorArg_Intrinsic;
2324def int_aarch64_sve_fminp   : AdvSIMD_Pred2VectorArg_Intrinsic;
2325def int_aarch64_sve_fminnmp : AdvSIMD_Pred2VectorArg_Intrinsic;
2326def int_aarch64_sve_smaxp   : AdvSIMD_Pred2VectorArg_Intrinsic;
2327def int_aarch64_sve_sminp   : AdvSIMD_Pred2VectorArg_Intrinsic;
2328def int_aarch64_sve_umaxp   : AdvSIMD_Pred2VectorArg_Intrinsic;
2329def int_aarch64_sve_uminp   : AdvSIMD_Pred2VectorArg_Intrinsic;
2330
2331//
2332// SVE2 - Widening pairwise arithmetic
2333//
2334
2335def int_aarch64_sve_sadalp : SVE2_2VectorArg_Pred_Long_Intrinsic;
2336def int_aarch64_sve_uadalp : SVE2_2VectorArg_Pred_Long_Intrinsic;
2337
2338//
2339// SVE2 - Uniform complex integer arithmetic
2340//
2341
2342def int_aarch64_sve_cadd_x           : AdvSIMD_SVE2_CADD_Intrinsic;
2343def int_aarch64_sve_sqcadd_x         : AdvSIMD_SVE2_CADD_Intrinsic;
2344def int_aarch64_sve_cmla_x           : AdvSIMD_SVE2_CMLA_Intrinsic;
2345def int_aarch64_sve_cmla_lane_x      : AdvSIMD_SVE_CMLA_LANE_Intrinsic;
2346def int_aarch64_sve_sqrdcmlah_x      : AdvSIMD_SVE2_CMLA_Intrinsic;
2347def int_aarch64_sve_sqrdcmlah_lane_x : AdvSIMD_SVE_CMLA_LANE_Intrinsic;
2348
2349//
2350// SVE2 - Widening complex integer arithmetic
2351//
2352
2353def int_aarch64_sve_saddlbt   : SVE2_2VectorArg_Long_Intrinsic;
2354def int_aarch64_sve_ssublbt   : SVE2_2VectorArg_Long_Intrinsic;
2355def int_aarch64_sve_ssubltb   : SVE2_2VectorArg_Long_Intrinsic;
2356
2357//
2358// SVE2 - Widening complex integer dot product
2359//
2360
2361def int_aarch64_sve_cdot      : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
2362def int_aarch64_sve_cdot_lane : AdvSIMD_SVE_CDOT_LANE_Intrinsic;
2363
2364//
2365// SVE2 - Floating-point widening multiply-accumulate
2366//
2367
2368def int_aarch64_sve_fmlalb        : SVE2_3VectorArg_Long_Intrinsic;
2369def int_aarch64_sve_fmlalb_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
2370def int_aarch64_sve_fmlalt        : SVE2_3VectorArg_Long_Intrinsic;
2371def int_aarch64_sve_fmlalt_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
2372def int_aarch64_sve_fmlslb        : SVE2_3VectorArg_Long_Intrinsic;
2373def int_aarch64_sve_fmlslb_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
2374def int_aarch64_sve_fmlslt        : SVE2_3VectorArg_Long_Intrinsic;
2375def int_aarch64_sve_fmlslt_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
2376
2377//
2378// SVE2 - Floating-point integer binary logarithm
2379//
2380
2381def int_aarch64_sve_flogb : AdvSIMD_SVE_LOGB_Intrinsic;
2382
2383//
2384// SVE2 - Vector histogram count
2385//
2386
2387def int_aarch64_sve_histcnt : AdvSIMD_Pred2VectorArg_Intrinsic;
2388def int_aarch64_sve_histseg : AdvSIMD_2VectorArg_Intrinsic;
2389
2390//
2391// SVE2 - Character match
2392//
2393
2394def int_aarch64_sve_match   : AdvSIMD_SVE_Compare_Intrinsic;
2395def int_aarch64_sve_nmatch  : AdvSIMD_SVE_Compare_Intrinsic;
2396
2397//
2398// SVE2 - Unary narrowing operations
2399//
2400
2401def int_aarch64_sve_sqxtnb  : SVE2_1VectorArg_Narrowing_Intrinsic;
2402def int_aarch64_sve_sqxtnt  : SVE2_Merged1VectorArg_Narrowing_Intrinsic;
2403def int_aarch64_sve_sqxtunb : SVE2_1VectorArg_Narrowing_Intrinsic;
2404def int_aarch64_sve_sqxtunt : SVE2_Merged1VectorArg_Narrowing_Intrinsic;
2405def int_aarch64_sve_uqxtnb  : SVE2_1VectorArg_Narrowing_Intrinsic;
2406def int_aarch64_sve_uqxtnt  : SVE2_Merged1VectorArg_Narrowing_Intrinsic;
2407
2408//
2409// SVE2 - Binary narrowing DSP operations
2410//
2411def int_aarch64_sve_addhnb    : SVE2_2VectorArg_Narrowing_Intrinsic;
2412def int_aarch64_sve_addhnt    : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
2413
2414def int_aarch64_sve_raddhnb   : SVE2_2VectorArg_Narrowing_Intrinsic;
2415def int_aarch64_sve_raddhnt   : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
2416
2417def int_aarch64_sve_subhnb    : SVE2_2VectorArg_Narrowing_Intrinsic;
2418def int_aarch64_sve_subhnt    : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
2419
2420def int_aarch64_sve_rsubhnb   : SVE2_2VectorArg_Narrowing_Intrinsic;
2421def int_aarch64_sve_rsubhnt   : SVE2_Merged2VectorArg_Narrowing_Intrinsic;
2422
2423// Narrowing shift right
2424def int_aarch64_sve_shrnb     : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2425def int_aarch64_sve_shrnt     : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2426
2427def int_aarch64_sve_rshrnb    : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2428def int_aarch64_sve_rshrnt    : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2429
2430// Saturating shift right - signed input/output
2431def int_aarch64_sve_sqshrnb   : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2432def int_aarch64_sve_sqshrnt   : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2433
2434def int_aarch64_sve_sqrshrnb  : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2435def int_aarch64_sve_sqrshrnt  : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2436
2437// Saturating shift right - unsigned input/output
2438def int_aarch64_sve_uqshrnb   : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2439def int_aarch64_sve_uqshrnt   : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2440
2441def int_aarch64_sve_uqrshrnb  : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2442def int_aarch64_sve_uqrshrnt  : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2443
2444// Saturating shift right - signed input, unsigned output
2445def int_aarch64_sve_sqshrunb  : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2446def int_aarch64_sve_sqshrunt  : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2447
2448def int_aarch64_sve_sqrshrunb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic;
2449def int_aarch64_sve_sqrshrunt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic;
2450
2451// SVE2 MLA LANE.
2452def int_aarch64_sve_smlalb_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2453def int_aarch64_sve_smlalt_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2454def int_aarch64_sve_umlalb_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2455def int_aarch64_sve_umlalt_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2456def int_aarch64_sve_smlslb_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2457def int_aarch64_sve_smlslt_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2458def int_aarch64_sve_umlslb_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2459def int_aarch64_sve_umlslt_lane   : SVE2_3VectorArg_Indexed_Intrinsic;
2460def int_aarch64_sve_smullb_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic;
2461def int_aarch64_sve_smullt_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic;
2462def int_aarch64_sve_umullb_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic;
2463def int_aarch64_sve_umullt_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic;
2464def int_aarch64_sve_sqdmlalb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
2465def int_aarch64_sve_sqdmlalt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
2466def int_aarch64_sve_sqdmlslb_lane : SVE2_3VectorArg_Indexed_Intrinsic;
2467def int_aarch64_sve_sqdmlslt_lane : SVE2_3VectorArg_Indexed_Intrinsic;
2468def int_aarch64_sve_sqdmullb_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
2469def int_aarch64_sve_sqdmullt_lane : SVE2_2VectorArgIndexed_Long_Intrinsic;
2470
2471// SVE2 MLA Unpredicated.
2472def int_aarch64_sve_smlalb      : SVE2_3VectorArg_Long_Intrinsic;
2473def int_aarch64_sve_smlalt      : SVE2_3VectorArg_Long_Intrinsic;
2474def int_aarch64_sve_umlalb      : SVE2_3VectorArg_Long_Intrinsic;
2475def int_aarch64_sve_umlalt      : SVE2_3VectorArg_Long_Intrinsic;
2476def int_aarch64_sve_smlslb      : SVE2_3VectorArg_Long_Intrinsic;
2477def int_aarch64_sve_smlslt      : SVE2_3VectorArg_Long_Intrinsic;
2478def int_aarch64_sve_umlslb      : SVE2_3VectorArg_Long_Intrinsic;
2479def int_aarch64_sve_umlslt      : SVE2_3VectorArg_Long_Intrinsic;
2480def int_aarch64_sve_smullb      : SVE2_2VectorArg_Long_Intrinsic;
2481def int_aarch64_sve_smullt      : SVE2_2VectorArg_Long_Intrinsic;
2482def int_aarch64_sve_umullb      : SVE2_2VectorArg_Long_Intrinsic;
2483def int_aarch64_sve_umullt      : SVE2_2VectorArg_Long_Intrinsic;
2484
2485def int_aarch64_sve_sqdmlalb    : SVE2_3VectorArg_Long_Intrinsic;
2486def int_aarch64_sve_sqdmlalt    : SVE2_3VectorArg_Long_Intrinsic;
2487def int_aarch64_sve_sqdmlslb    : SVE2_3VectorArg_Long_Intrinsic;
2488def int_aarch64_sve_sqdmlslt    : SVE2_3VectorArg_Long_Intrinsic;
2489def int_aarch64_sve_sqdmullb    : SVE2_2VectorArg_Long_Intrinsic;
2490def int_aarch64_sve_sqdmullt    : SVE2_2VectorArg_Long_Intrinsic;
2491def int_aarch64_sve_sqdmlalbt   : SVE2_3VectorArg_Long_Intrinsic;
2492def int_aarch64_sve_sqdmlslbt   : SVE2_3VectorArg_Long_Intrinsic;
2493
2494// SVE2 ADDSUB Long Unpredicated.
2495def int_aarch64_sve_adclb       : AdvSIMD_3VectorArg_Intrinsic;
2496def int_aarch64_sve_adclt       : AdvSIMD_3VectorArg_Intrinsic;
2497def int_aarch64_sve_sbclb       : AdvSIMD_3VectorArg_Intrinsic;
2498def int_aarch64_sve_sbclt       : AdvSIMD_3VectorArg_Intrinsic;
2499
2500//
2501// SVE2 - Polynomial arithmetic
2502//
2503def int_aarch64_sve_eorbt       : AdvSIMD_3VectorArg_Intrinsic;
2504def int_aarch64_sve_eortb       : AdvSIMD_3VectorArg_Intrinsic;
2505def int_aarch64_sve_pmullb_pair : AdvSIMD_2VectorArg_Intrinsic;
2506def int_aarch64_sve_pmullt_pair : AdvSIMD_2VectorArg_Intrinsic;
2507
2508//
2509// SVE2 bitwise ternary operations.
2510//
2511def int_aarch64_sve_eor3   : AdvSIMD_3VectorArg_Intrinsic;
2512def int_aarch64_sve_bcax   : AdvSIMD_3VectorArg_Intrinsic;
2513def int_aarch64_sve_bsl    : AdvSIMD_3VectorArg_Intrinsic;
2514def int_aarch64_sve_bsl1n  : AdvSIMD_3VectorArg_Intrinsic;
2515def int_aarch64_sve_bsl2n  : AdvSIMD_3VectorArg_Intrinsic;
2516def int_aarch64_sve_nbsl   : AdvSIMD_3VectorArg_Intrinsic;
2517def int_aarch64_sve_xar    : AdvSIMD_2VectorArgIndexed_Intrinsic;
2518
2519//
2520// SVE2 - Optional AES, SHA-3 and SM4
2521//
2522
2523def int_aarch64_sve_aesd    : ClangBuiltin<"__builtin_sve_svaesd_u8">,
2524                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
2525                                        [llvm_nxv16i8_ty, llvm_nxv16i8_ty],
2526                                        [IntrNoMem]>;
2527def int_aarch64_sve_aesimc  : ClangBuiltin<"__builtin_sve_svaesimc_u8">,
2528                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
2529                                        [llvm_nxv16i8_ty],
2530                                        [IntrNoMem]>;
2531def int_aarch64_sve_aese    : ClangBuiltin<"__builtin_sve_svaese_u8">,
2532                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
2533                                        [llvm_nxv16i8_ty, llvm_nxv16i8_ty],
2534                                        [IntrNoMem]>;
2535def int_aarch64_sve_aesmc   : ClangBuiltin<"__builtin_sve_svaesmc_u8">,
2536                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
2537                                        [llvm_nxv16i8_ty],
2538                                        [IntrNoMem]>;
2539def int_aarch64_sve_rax1    : ClangBuiltin<"__builtin_sve_svrax1_u64">,
2540                              DefaultAttrsIntrinsic<[llvm_nxv2i64_ty],
2541                                        [llvm_nxv2i64_ty, llvm_nxv2i64_ty],
2542                                        [IntrNoMem]>;
2543def int_aarch64_sve_sm4e    : ClangBuiltin<"__builtin_sve_svsm4e_u32">,
2544                              DefaultAttrsIntrinsic<[llvm_nxv4i32_ty],
2545                                        [llvm_nxv4i32_ty, llvm_nxv4i32_ty],
2546                                        [IntrNoMem]>;
2547def int_aarch64_sve_sm4ekey : ClangBuiltin<"__builtin_sve_svsm4ekey_u32">,
2548                              DefaultAttrsIntrinsic<[llvm_nxv4i32_ty],
2549                                        [llvm_nxv4i32_ty, llvm_nxv4i32_ty],
2550                                        [IntrNoMem]>;
2551//
2552// SVE2 - Extended table lookup/permute
2553//
2554
2555def int_aarch64_sve_tbl2 : AdvSIMD_SVE2_TBX_Intrinsic;
2556def int_aarch64_sve_tbx  : AdvSIMD_SVE2_TBX_Intrinsic;
2557
2558//
2559// SVE2 - Optional bit permutation
2560//
2561
2562def int_aarch64_sve_bdep_x : AdvSIMD_2VectorArg_Intrinsic;
2563def int_aarch64_sve_bext_x : AdvSIMD_2VectorArg_Intrinsic;
2564def int_aarch64_sve_bgrp_x : AdvSIMD_2VectorArg_Intrinsic;
2565
2566
2567//
2568// SVE ACLE: 7.3. INT8 matrix multiply extensions
2569//
2570def int_aarch64_sve_ummla : SVE_MatMul_Intrinsic;
2571def int_aarch64_sve_smmla : SVE_MatMul_Intrinsic;
2572def int_aarch64_sve_usmmla : SVE_MatMul_Intrinsic;
2573
2574def int_aarch64_sve_usdot : AdvSIMD_SVE_DOT_Intrinsic;
2575def int_aarch64_sve_usdot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
2576def int_aarch64_sve_sudot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic;
2577
2578//
2579// SVE ACLE: 7.4/5. FP64/FP32 matrix multiply extensions
2580//
2581def int_aarch64_sve_fmmla : AdvSIMD_3VectorArg_Intrinsic;
2582
2583//
2584// SVE ACLE: 7.2. BFloat16 extensions
2585//
2586
2587def int_aarch64_sve_bfdot   : SVE_4Vec_BF16;
2588def int_aarch64_sve_bfmlalb : SVE_4Vec_BF16;
2589def int_aarch64_sve_bfmlalt : SVE_4Vec_BF16;
2590
2591def int_aarch64_sve_bfmmla  : SVE_4Vec_BF16;
2592
2593def int_aarch64_sve_bfdot_lane_v2   : SVE_4Vec_BF16_Indexed;
2594def int_aarch64_sve_bfmlalb_lane_v2 : SVE_4Vec_BF16_Indexed;
2595def int_aarch64_sve_bfmlalt_lane_v2 : SVE_4Vec_BF16_Indexed;
2596
2597//
2598// SVE2.1 - Contiguous loads to multiple consecutive vectors
2599//
2600
2601  class SVE2p1_Load_PN_X2_Intrinsic
2602    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
2603                [llvm_aarch64_svcount_ty, llvm_ptr_ty],
2604                [IntrReadMem, IntrArgMemOnly]>;
2605
2606  class SVE2p1_Load_PN_X4_Intrinsic
2607    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
2608                             LLVMMatchType<0>, LLVMMatchType<0>],
2609                [llvm_aarch64_svcount_ty, llvm_ptr_ty],
2610                [IntrReadMem, IntrArgMemOnly]>;
2611
2612def int_aarch64_sve_ld1_pn_x2 : SVE2p1_Load_PN_X2_Intrinsic;
2613def int_aarch64_sve_ld1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic;
2614def int_aarch64_sve_ldnt1_pn_x2 : SVE2p1_Load_PN_X2_Intrinsic;
2615def int_aarch64_sve_ldnt1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic;
2616
2617//
2618// SVE2.1 - Contiguous stores to multiple consecutive vectors
2619//
2620
2621  class SVE2p1_Store_PN_X2_Intrinsic
2622    : DefaultAttrsIntrinsic<[], [ llvm_anyvector_ty, LLVMMatchType<0>,
2623                                  llvm_aarch64_svcount_ty, llvm_ptr_ty ],
2624                [IntrWriteMem, IntrArgMemOnly]>;
2625
2626  class SVE2p1_Store_PN_X4_Intrinsic
2627    : DefaultAttrsIntrinsic<[], [ llvm_anyvector_ty, LLVMMatchType<0>,
2628                                  LLVMMatchType<0>, LLVMMatchType<0>,
2629                                  llvm_aarch64_svcount_ty, llvm_ptr_ty],
2630                [IntrWriteMem, IntrArgMemOnly]>;
2631
2632def int_aarch64_sve_st1_pn_x2 : SVE2p1_Store_PN_X2_Intrinsic;
2633def int_aarch64_sve_st1_pn_x4 : SVE2p1_Store_PN_X4_Intrinsic;
2634def int_aarch64_sve_stnt1_pn_x2 : SVE2p1_Store_PN_X2_Intrinsic;
2635def int_aarch64_sve_stnt1_pn_x4 : SVE2p1_Store_PN_X4_Intrinsic;
2636}
2637
2638//
2639// SVE2 - Contiguous conflict detection
2640//
2641
2642def int_aarch64_sve_whilerw_b : SVE2_CONFLICT_DETECT_Intrinsic;
2643def int_aarch64_sve_whilerw_h : SVE2_CONFLICT_DETECT_Intrinsic;
2644def int_aarch64_sve_whilerw_s : SVE2_CONFLICT_DETECT_Intrinsic;
2645def int_aarch64_sve_whilerw_d : SVE2_CONFLICT_DETECT_Intrinsic;
2646def int_aarch64_sve_whilewr_b : SVE2_CONFLICT_DETECT_Intrinsic;
2647def int_aarch64_sve_whilewr_h : SVE2_CONFLICT_DETECT_Intrinsic;
2648def int_aarch64_sve_whilewr_s : SVE2_CONFLICT_DETECT_Intrinsic;
2649def int_aarch64_sve_whilewr_d : SVE2_CONFLICT_DETECT_Intrinsic;
2650
2651// Scalable Matrix Extension (SME) Intrinsics
2652let TargetPrefix = "aarch64" in {
2653  class SME_Load_Store_Intrinsic<LLVMType pred_ty>
2654    : DefaultAttrsIntrinsic<[],
2655        [pred_ty, llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<2>>]>;
2656
2657  // Loads
2658  def int_aarch64_sme_ld1b_horiz : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
2659  def int_aarch64_sme_ld1h_horiz : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
2660  def int_aarch64_sme_ld1w_horiz : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
2661  def int_aarch64_sme_ld1d_horiz : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
2662  def int_aarch64_sme_ld1q_horiz : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
2663  def int_aarch64_sme_ld1b_vert  : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
2664  def int_aarch64_sme_ld1h_vert  : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
2665  def int_aarch64_sme_ld1w_vert  : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
2666  def int_aarch64_sme_ld1d_vert  : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
2667  def int_aarch64_sme_ld1q_vert  : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
2668
2669  // Stores
2670  def int_aarch64_sme_st1b_horiz : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
2671  def int_aarch64_sme_st1h_horiz : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
2672  def int_aarch64_sme_st1w_horiz : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
2673  def int_aarch64_sme_st1d_horiz : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
2674  def int_aarch64_sme_st1q_horiz : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
2675  def int_aarch64_sme_st1b_vert  : SME_Load_Store_Intrinsic<llvm_nxv16i1_ty>;
2676  def int_aarch64_sme_st1h_vert  : SME_Load_Store_Intrinsic<llvm_nxv8i1_ty>;
2677  def int_aarch64_sme_st1w_vert  : SME_Load_Store_Intrinsic<llvm_nxv4i1_ty>;
2678  def int_aarch64_sme_st1d_vert  : SME_Load_Store_Intrinsic<llvm_nxv2i1_ty>;
2679  def int_aarch64_sme_st1q_vert  : SME_Load_Store_Intrinsic<llvm_nxv1i1_ty>;
2680
2681  // Spill + fill
2682  def int_aarch64_sme_ldr : DefaultAttrsIntrinsic<
2683    [], [llvm_i32_ty, llvm_ptr_ty]>;
2684  def int_aarch64_sme_str : DefaultAttrsIntrinsic<
2685    [], [llvm_i32_ty, llvm_ptr_ty]>;
2686
2687  class SME_TileToVector_Intrinsic
2688      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
2689          [LLVMMatchType<0>, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
2690           llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<2>>]>;
2691  class SME_VectorToTile_Intrinsic
2692      : DefaultAttrsIntrinsic<[],
2693          [llvm_i32_ty, llvm_i32_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
2694           llvm_anyvector_ty], [ImmArg<ArgIndex<0>>]>;
2695
2696  def int_aarch64_sme_read_horiz  : SME_TileToVector_Intrinsic;
2697  def int_aarch64_sme_read_vert   : SME_TileToVector_Intrinsic;
2698  def int_aarch64_sme_write_horiz : SME_VectorToTile_Intrinsic;
2699  def int_aarch64_sme_write_vert  : SME_VectorToTile_Intrinsic;
2700
2701  def int_aarch64_sme_readq_horiz  : SME_TileToVector_Intrinsic;
2702  def int_aarch64_sme_readq_vert   : SME_TileToVector_Intrinsic;
2703  def int_aarch64_sme_writeq_horiz : SME_VectorToTile_Intrinsic;
2704  def int_aarch64_sme_writeq_vert  : SME_VectorToTile_Intrinsic;
2705
2706  def int_aarch64_sme_zero : DefaultAttrsIntrinsic<[], [llvm_i32_ty], [ImmArg<ArgIndex<0>>]>;
2707
2708  class SME_OuterProduct_Intrinsic
2709      : DefaultAttrsIntrinsic<[],
2710          [llvm_i32_ty,
2711           LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
2712           LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
2713           LLVMMatchType<0>,
2714           llvm_anyvector_ty], [ImmArg<ArgIndex<0>>]>;
2715
2716  def int_aarch64_sme_mopa : SME_OuterProduct_Intrinsic;
2717  def int_aarch64_sme_mops : SME_OuterProduct_Intrinsic;
2718
2719  def int_aarch64_sme_mopa_wide : SME_OuterProduct_Intrinsic;
2720  def int_aarch64_sme_mops_wide : SME_OuterProduct_Intrinsic;
2721
2722  def int_aarch64_sme_smopa_wide  : SME_OuterProduct_Intrinsic;
2723  def int_aarch64_sme_smops_wide  : SME_OuterProduct_Intrinsic;
2724  def int_aarch64_sme_umopa_wide  : SME_OuterProduct_Intrinsic;
2725  def int_aarch64_sme_umops_wide  : SME_OuterProduct_Intrinsic;
2726  def int_aarch64_sme_sumopa_wide : SME_OuterProduct_Intrinsic;
2727  def int_aarch64_sme_sumops_wide : SME_OuterProduct_Intrinsic;
2728  def int_aarch64_sme_usmopa_wide : SME_OuterProduct_Intrinsic;
2729  def int_aarch64_sme_usmops_wide : SME_OuterProduct_Intrinsic;
2730
2731  class SME_AddVectorToTile_Intrinsic
2732      : DefaultAttrsIntrinsic<[],
2733          [llvm_i32_ty,
2734           LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
2735           LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
2736           llvm_anyvector_ty], [ImmArg<ArgIndex<0>>]>;
2737
2738  def int_aarch64_sme_addha : SME_AddVectorToTile_Intrinsic;
2739  def int_aarch64_sme_addva : SME_AddVectorToTile_Intrinsic;
2740
2741  //
2742  // Counting elements
2743  //
2744
2745  class AdvSIMD_SME_CNTSB_Intrinsic
2746    : DefaultAttrsIntrinsic<[llvm_i64_ty], [], [IntrNoMem]>;
2747
2748  def int_aarch64_sme_cntsb : AdvSIMD_SME_CNTSB_Intrinsic;
2749  def int_aarch64_sme_cntsh : AdvSIMD_SME_CNTSB_Intrinsic;
2750  def int_aarch64_sme_cntsw : AdvSIMD_SME_CNTSB_Intrinsic;
2751  def int_aarch64_sme_cntsd : AdvSIMD_SME_CNTSB_Intrinsic;
2752
2753  //
2754  // PSTATE Functions
2755  //
2756
2757  def int_aarch64_sme_get_tpidr2
2758      : DefaultAttrsIntrinsic<[llvm_i64_ty], [],
2759                              [IntrNoMem, IntrHasSideEffects]>;
2760  def int_aarch64_sme_set_tpidr2
2761      : DefaultAttrsIntrinsic<[], [llvm_i64_ty],
2762                              [IntrNoMem, IntrHasSideEffects]>;
2763
2764  def int_aarch64_sme_za_enable
2765      : DefaultAttrsIntrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
2766  def int_aarch64_sme_za_disable
2767      : DefaultAttrsIntrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
2768
2769  // Clamp
2770  //
2771
2772  def int_aarch64_sve_sclamp : AdvSIMD_3VectorArg_Intrinsic;
2773  def int_aarch64_sve_uclamp : AdvSIMD_3VectorArg_Intrinsic;
2774  def int_aarch64_sve_fclamp : AdvSIMD_3VectorArg_Intrinsic;
2775
2776
2777  //
2778  // Reversal
2779  //
2780
2781  def int_aarch64_sve_revd : AdvSIMD_Merged1VectorArg_Intrinsic;
2782
2783  //
2784  // Predicate selection
2785  //
2786
2787  def int_aarch64_sve_psel
2788      : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
2789                              [llvm_nxv16i1_ty,
2790                               llvm_anyvector_ty, llvm_i32_ty],
2791                              [IntrNoMem]>;
2792
2793  //
2794  // Predicate-pair intrinsics
2795  //
2796  foreach cmp = ["ge", "gt", "hi", "hs", "le", "lo", "ls", "lt"] in {
2797    def int_aarch64_sve_while # cmp # _x2
2798        : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
2799                                [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
2800  }
2801
2802  //
2803  // Predicate-as-counter intrinsics
2804  //
2805
2806  def int_aarch64_sve_pext
2807      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
2808                              [llvm_aarch64_svcount_ty, llvm_i32_ty],
2809                              [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2810
2811  def int_aarch64_sve_pext_x2
2812      : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
2813                              [llvm_aarch64_svcount_ty, llvm_i32_ty],
2814                              [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2815
2816  def int_aarch64_sve_ptrue_c8
2817      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
2818  def int_aarch64_sve_ptrue_c16
2819      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
2820  def int_aarch64_sve_ptrue_c32
2821      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
2822  def int_aarch64_sve_ptrue_c64
2823      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
2824
2825  def int_aarch64_sve_cntp_c8
2826      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
2827                              [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2828  def int_aarch64_sve_cntp_c16
2829      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
2830                              [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2831  def int_aarch64_sve_cntp_c32
2832      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
2833                              [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2834  def int_aarch64_sve_cntp_c64
2835      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
2836                              [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2837
2838  // While (predicate-as-counter) intrinsics
2839  foreach cmp = ["ge", "gt", "hi", "hs", "le", "lo", "ls", "lt"] in {
2840    foreach ty = ["c8", "c16", "c32", "c64"] in {
2841      def int_aarch64_sve_while # cmp # _ # ty
2842          : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty],
2843                                  [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty],
2844                                  [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2845    }
2846  }
2847
2848  //
2849  // SME2 Intrinsics
2850  //
2851
2852  class SME2_Matrix_ArrayVector_Single_Single_Intrinsic
2853    : DefaultAttrsIntrinsic<[],
2854                [llvm_i32_ty,
2855                 llvm_anyvector_ty, LLVMMatchType<0>],
2856                []>;
2857
2858  class SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic
2859    : DefaultAttrsIntrinsic<[],
2860                [llvm_i32_ty,
2861                 llvm_anyvector_ty, LLVMMatchType<0>,
2862                 LLVMMatchType<0>],
2863                []>;
2864
2865  class SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic
2866    : DefaultAttrsIntrinsic<[],
2867                [llvm_i32_ty,
2868                 llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
2869                 LLVMMatchType<0>],
2870                []>;
2871
2872  class SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic
2873    : DefaultAttrsIntrinsic<[],
2874                [llvm_i32_ty,
2875                 llvm_anyvector_ty, LLVMMatchType<0>,
2876                 LLVMMatchType<0>, LLVMMatchType<0>],
2877                []>;
2878
2879  class SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic
2880    : DefaultAttrsIntrinsic<[],
2881                [llvm_i32_ty,
2882                 llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
2883                 LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
2884                []>;
2885
2886  class SME2_Matrix_ArrayVector_Single_Index_Intrinsic
2887    : DefaultAttrsIntrinsic<[],
2888                [llvm_i32_ty,
2889                llvm_anyvector_ty,
2890                LLVMMatchType<0>, llvm_i32_ty],
2891                [ImmArg<ArgIndex<3>>]>;
2892
2893  class SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic
2894    : DefaultAttrsIntrinsic<[],
2895                [llvm_i32_ty,
2896                 llvm_anyvector_ty, LLVMMatchType<0>,
2897                 LLVMMatchType<0>, llvm_i32_ty],
2898                [ImmArg<ArgIndex<4>>]>;
2899
2900  class SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic
2901    : DefaultAttrsIntrinsic<[],
2902                [llvm_i32_ty,
2903                 llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
2904                 LLVMMatchType<0>, llvm_i32_ty],
2905                [ImmArg<ArgIndex<6>>]>;
2906
2907  class SME2_VG2_Multi_Imm_Intrinsic
2908    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
2909                [llvm_anyvector_ty, LLVMMatchType<0>,
2910                 llvm_i32_ty],
2911                [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2912
2913  class SME2_VG4_Multi_Imm_Intrinsic
2914    : DefaultAttrsIntrinsic<[LLVMSubdivide4VectorType<0>],
2915                [llvm_anyvector_ty, LLVMMatchType<0>,
2916                 LLVMMatchType<0>, LLVMMatchType<0>,
2917                 llvm_i32_ty],
2918                [IntrNoMem, ImmArg<ArgIndex<4>>]>;
2919
2920  class SME2_ZA_Write_VG2_Intrinsic
2921   : DefaultAttrsIntrinsic<[],
2922               [llvm_i32_ty,
2923                llvm_anyvector_ty, LLVMMatchType<0>],
2924               []>;
2925
2926  class SME2_ZA_Write_VG4_Intrinsic
2927   : DefaultAttrsIntrinsic<[],
2928               [llvm_i32_ty,
2929                llvm_anyvector_ty, LLVMMatchType<0>,
2930                LLVMMatchType<0>,  LLVMMatchType<0>],
2931               []>;
2932
2933  class SME2_VG2_Multi_Single_Intrinsic
2934    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
2935                [LLVMMatchType<0>, LLVMMatchType<0>,
2936                 LLVMMatchType<0>],
2937                [IntrNoMem]>;
2938
2939  class SME2_VG4_Multi_Single_Intrinsic
2940    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
2941                             LLVMMatchType<0>,  LLVMMatchType<0>],
2942                            [LLVMMatchType<0>,  LLVMMatchType<0>,
2943                             LLVMMatchType<0>,  LLVMMatchType<0>,
2944                             LLVMMatchType<0>],
2945                            [IntrNoMem]>;
2946
2947  class SME2_VG2_Multi_Multi_Intrinsic
2948    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
2949                [LLVMMatchType<0>, LLVMMatchType<0>,
2950                 LLVMMatchType<0>, LLVMMatchType<0>],
2951                [IntrNoMem]>;
2952
2953  class SME2_VG4_Multi_Multi_Intrinsic
2954    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
2955                             LLVMMatchType<0>,  LLVMMatchType<0>],
2956                            [LLVMMatchType<0>,  LLVMMatchType<0>,
2957                             LLVMMatchType<0>,  LLVMMatchType<0>,
2958                             LLVMMatchType<0>, LLVMMatchType<0>,
2959                             LLVMMatchType<0>, LLVMMatchType<0>],
2960                            [IntrNoMem]>;
2961
2962  class SVE2_VG2_Sel_Intrinsic
2963    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
2964                [llvm_aarch64_svcount_ty, LLVMMatchType<0>,
2965                 LLVMMatchType<0>, LLVMMatchType<0>,
2966                 LLVMMatchType<0>], [IntrNoMem]>;
2967
2968  class SVE2_VG4_Sel_Intrinsic
2969    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
2970                             LLVMMatchType<0>, LLVMMatchType<0>],
2971                [llvm_aarch64_svcount_ty, LLVMMatchType<0>,
2972                 LLVMMatchType<0>, LLVMMatchType<0>,
2973                 LLVMMatchType<0>, LLVMMatchType<0>,
2974                 LLVMMatchType<0>, LLVMMatchType<0>,
2975                 LLVMMatchType<0>], [IntrNoMem]>;
2976
2977  class SME2_CVT_VG2_SINGLE_Intrinsic
2978    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
2979                            [llvm_anyvector_ty, LLVMMatchType<0>],
2980                            [IntrNoMem]>;
2981
2982  class SME2_CVT_VG2_SINGLE_BF16_Intrinsic
2983    : DefaultAttrsIntrinsic<[llvm_nxv8bf16_ty],
2984                            [llvm_nxv4f32_ty, llvm_nxv4f32_ty],
2985                            [IntrNoMem]>;
2986
2987  class SME2_CVT_VG4_SINGLE_Intrinsic
2988    : DefaultAttrsIntrinsic<[LLVMSubdivide4VectorType<0>],
2989                            [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
2990                            [IntrNoMem]>;
2991
2992  class SME2_CVT_FtoI_VG2_Intrinsic
2993    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
2994                            [LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
2995                            [IntrNoMem]>;
2996
2997  class SME2_CVT_ItoF_VG2_Intrinsic
2998    : DefaultAttrsIntrinsic<[LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
2999                            [llvm_anyvector_ty, LLVMMatchType<0>],
3000                            [IntrNoMem]>;
3001
3002  class SME2_CVT_FtoI_VG4_Intrinsic
3003    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
3004                            [LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>,
3005                             LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
3006                            [IntrNoMem]>;
3007
3008  class SME2_CVT_ItoF_VG4_Intrinsic
3009    : DefaultAttrsIntrinsic<[LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>,
3010                             LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
3011                            [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
3012                            [IntrNoMem]>;
3013
3014  class SME2_ZA_ArrayVector_Read_VG2_Intrinsic
3015    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
3016                [llvm_i32_ty],
3017                []>;
3018
3019  class SME2_ZA_ArrayVector_Read_VG4_Intrinsic
3020    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
3021                             LLVMMatchType<0>,  LLVMMatchType<0>],
3022                [llvm_i32_ty],
3023                []>;
3024
3025  class SME2_Matrix_TileVector_Read_VG2_Intrinsic
3026    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
3027                [llvm_i32_ty, llvm_i32_ty],
3028                []>;
3029
3030  class SME2_Matrix_TileVector_Read_VG4_Intrinsic
3031    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
3032                             LLVMMatchType<0>,  LLVMMatchType<0>],
3033                [llvm_i32_ty, llvm_i32_ty],
3034                []>;
3035
3036  class SME2_ZA_ArrayVector_Write_VG2_Intrinsic
3037   : DefaultAttrsIntrinsic<[],
3038               [llvm_i32_ty,
3039                llvm_anyvector_ty, LLVMMatchType<0>],
3040               []>;
3041
3042  class SME2_ZA_ArrayVector_Write_VG4_Intrinsic
3043   : DefaultAttrsIntrinsic<[],
3044               [llvm_i32_ty,
3045                llvm_anyvector_ty, LLVMMatchType<0>,
3046                LLVMMatchType<0>,  LLVMMatchType<0>],
3047               []>;
3048
3049  class SME2_Matrix_TileVector_Write_VG2_Intrinsic
3050   : DefaultAttrsIntrinsic<[],
3051               [llvm_i32_ty, llvm_i32_ty,
3052                llvm_anyvector_ty, LLVMMatchType<0>],
3053               [ImmArg<ArgIndex<0>>]>;
3054
3055  class SME2_Matrix_TileVector_Write_VG4_Intrinsic
3056   : DefaultAttrsIntrinsic<[],
3057               [llvm_i32_ty, llvm_i32_ty,
3058                llvm_anyvector_ty, LLVMMatchType<0>,
3059                LLVMMatchType<0>,  LLVMMatchType<0>],
3060               [ImmArg<ArgIndex<0>>]>;
3061
3062  class SME2_VG2_Multi_Single_Single_Intrinsic
3063    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
3064                [LLVMMatchType<0>, LLVMMatchType<0>,
3065                 LLVMMatchType<0>, LLVMMatchType<0>],
3066                [IntrNoMem]>;
3067
3068  class SME2_VG4_Multi_Single_Single_Intrinsic
3069    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
3070                             LLVMMatchType<0>, LLVMMatchType<0>],
3071                [LLVMMatchType<0>, LLVMMatchType<0>,
3072                 LLVMMatchType<0>, LLVMMatchType<0>,
3073                 LLVMMatchType<0>, LLVMMatchType<0>],
3074                [IntrNoMem]>;
3075
3076  class SVE2_VG2_ZipUzp_Intrinsic
3077    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
3078                [LLVMMatchType<0>, LLVMMatchType<0>], [IntrNoMem]>;
3079
3080  class SVE2_VG4_ZipUzp_Intrinsic
3081    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
3082                             LLVMMatchType<0>, LLVMMatchType<0>],
3083                [LLVMMatchType<0>, LLVMMatchType<0>,
3084                 LLVMMatchType<0>, LLVMMatchType<0>], [IntrNoMem]>;
3085
3086  class SME2_VG2_Unpk_Intrinsic
3087    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
3088                [LLVMSubdivide2VectorType<0>], [IntrNoMem]>;
3089
3090  class SME2_VG4_Unpk_Intrinsic
3091    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
3092                             LLVMMatchType<0>, LLVMMatchType<0>],
3093                [LLVMSubdivide2VectorType<0>, LLVMSubdivide2VectorType<0>],
3094                [IntrNoMem]>;
3095
3096  //
3097  // Multi-vector fused multiply-add/subtract
3098  //
3099
3100  def int_aarch64_sme_fmla_single_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3101  def int_aarch64_sme_fmls_single_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3102  def int_aarch64_sme_fmla_single_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3103  def int_aarch64_sme_fmls_single_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3104
3105  def int_aarch64_sme_fmla_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3106  def int_aarch64_sme_fmls_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3107  def int_aarch64_sme_fmla_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3108  def int_aarch64_sme_fmls_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3109
3110  def int_aarch64_sme_fmla_lane_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3111  def int_aarch64_sme_fmls_lane_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3112  def int_aarch64_sme_fmla_lane_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3113  def int_aarch64_sme_fmls_lane_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3114
3115  //
3116  // Outer product and accumulate/subtract intrinsics
3117  //
3118
3119  def int_aarch64_sme_smopa_za32 : SME_OuterProduct_Intrinsic;
3120  def int_aarch64_sme_umopa_za32 : SME_OuterProduct_Intrinsic;
3121  def int_aarch64_sme_smops_za32 : SME_OuterProduct_Intrinsic;
3122  def int_aarch64_sme_umops_za32 : SME_OuterProduct_Intrinsic;
3123
3124  def int_aarch64_sme_bmopa_za32 : SME_OuterProduct_Intrinsic;
3125  def int_aarch64_sme_bmops_za32 : SME_OuterProduct_Intrinsic;
3126
3127  //
3128  // Multi-vector rounding shift left intrinsics
3129  //
3130
3131  def int_aarch64_sve_srshl_single_x2 : SME2_VG2_Multi_Single_Intrinsic;
3132  def int_aarch64_sve_urshl_single_x2 : SME2_VG2_Multi_Single_Intrinsic;
3133  def int_aarch64_sve_srshl_single_x4 : SME2_VG4_Multi_Single_Intrinsic;
3134  def int_aarch64_sve_urshl_single_x4 : SME2_VG4_Multi_Single_Intrinsic;
3135
3136  def int_aarch64_sve_srshl_x2 : SME2_VG2_Multi_Multi_Intrinsic;
3137  def int_aarch64_sve_urshl_x2 : SME2_VG2_Multi_Multi_Intrinsic;
3138  def int_aarch64_sve_srshl_x4 : SME2_VG4_Multi_Multi_Intrinsic;
3139  def int_aarch64_sve_urshl_x4 : SME2_VG4_Multi_Multi_Intrinsic;
3140
3141  // Multi-vector saturating rounding shift right intrinsics
3142
3143  def int_aarch64_sve_sqrshr_x2 : SME2_VG2_Multi_Imm_Intrinsic;
3144  def int_aarch64_sve_uqrshr_x2 : SME2_VG2_Multi_Imm_Intrinsic;
3145  def int_aarch64_sve_sqrshr_x4 : SME2_VG4_Multi_Imm_Intrinsic;
3146  def int_aarch64_sve_uqrshr_x4 : SME2_VG4_Multi_Imm_Intrinsic;
3147
3148  def int_aarch64_sve_sqrshrn_x2 : SME2_VG2_Multi_Imm_Intrinsic;
3149  def int_aarch64_sve_uqrshrn_x2 : SME2_VG2_Multi_Imm_Intrinsic;
3150  def int_aarch64_sve_sqrshrn_x4 : SME2_VG4_Multi_Imm_Intrinsic;
3151  def int_aarch64_sve_uqrshrn_x4 : SME2_VG4_Multi_Imm_Intrinsic;
3152
3153  def int_aarch64_sve_sqrshru_x2 : SME2_VG2_Multi_Imm_Intrinsic;
3154  def int_aarch64_sve_sqrshru_x4 : SME2_VG4_Multi_Imm_Intrinsic;
3155
3156  def int_aarch64_sve_sqrshrun_x2 : SME2_VG2_Multi_Imm_Intrinsic;
3157  def int_aarch64_sve_sqrshrun_x4 : SME2_VG4_Multi_Imm_Intrinsic;
3158
3159  //
3160  // Multi-vector multiply-add/subtract long
3161  //
3162
3163  foreach ty = ["f", "s", "u"] in {
3164    foreach instr = ["mlal", "mlsl"] in {
3165      def int_aarch64_sme_ # ty # instr # _single_vg2x1  : SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
3166      def int_aarch64_sme_ # ty # instr # _single_vg2x2  : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3167      def int_aarch64_sme_ # ty # instr # _single_vg2x4  : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3168
3169      def int_aarch64_sme_ # ty # instr # _vg2x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3170      def int_aarch64_sme_ # ty # instr # _vg2x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3171
3172      def int_aarch64_sme_ # ty # instr # _lane_vg2x1  : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
3173      def int_aarch64_sme_ # ty # instr # _lane_vg2x2  : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3174      def int_aarch64_sme_ # ty # instr # _lane_vg2x4  : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3175    }
3176  }
3177
3178  //
3179  // Multi-vector multiply-add long long
3180  //
3181
3182  foreach ty = ["s", "u"] in {
3183    foreach instr = ["mla", "mls"] in {
3184      foreach za = ["za32", "za64"] in {
3185        def int_aarch64_sme_ # ty # instr # _ # za # _single_vg4x1 : SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
3186        def int_aarch64_sme_ # ty # instr # _ # za # _single_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3187        def int_aarch64_sme_ # ty # instr # _ # za # _single_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3188
3189        def int_aarch64_sme_ # ty # instr # _ # za # _vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3190        def int_aarch64_sme_ # ty # instr # _ # za # _vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3191
3192        def int_aarch64_sme_ # ty # instr # _ # za # _lane_vg4x1 : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
3193        def int_aarch64_sme_ # ty # instr # _ # za # _lane_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3194        def int_aarch64_sme_ # ty # instr # _ # za # _lane_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3195      }
3196    }
3197  }
3198
3199  def int_aarch64_sme_sumla_za32_single_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3200  def int_aarch64_sme_sumla_za32_single_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3201
3202  def int_aarch64_sme_sumla_za32_lane_vg4x1 : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
3203  def int_aarch64_sme_sumla_za32_lane_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3204  def int_aarch64_sme_sumla_za32_lane_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3205
3206  def int_aarch64_sme_usmla_za32_single_vg4x1 : SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
3207  def int_aarch64_sme_usmla_za32_single_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3208  def int_aarch64_sme_usmla_za32_single_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3209
3210  def int_aarch64_sme_usmla_za32_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3211  def int_aarch64_sme_usmla_za32_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3212
3213  def int_aarch64_sme_usmla_za32_lane_vg4x1 : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
3214  def int_aarch64_sme_usmla_za32_lane_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3215  def int_aarch64_sme_usmla_za32_lane_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3216
3217  // Multi-vector signed saturating doubling multiply high
3218
3219  def int_aarch64_sve_sqdmulh_single_vgx2 : SME2_VG2_Multi_Single_Intrinsic;
3220  def int_aarch64_sve_sqdmulh_single_vgx4 : SME2_VG4_Multi_Single_Intrinsic;
3221
3222  def int_aarch64_sve_sqdmulh_vgx2 : SME2_VG2_Multi_Multi_Intrinsic;
3223  def int_aarch64_sve_sqdmulh_vgx4 : SME2_VG4_Multi_Multi_Intrinsic;
3224
3225  // Multi-vector floating-point round to integral value
3226
3227  foreach inst = ["a", "m", "n", "p"] in {
3228    def int_aarch64_sve_frint # inst # _x2 : SVE2_VG2_ZipUzp_Intrinsic;
3229    def int_aarch64_sve_frint # inst # _x4 : SVE2_VG4_ZipUzp_Intrinsic;
3230  }
3231
3232  //
3233  // Multi-vector min/max
3234  //
3235
3236  foreach ty = ["f", "s", "u"] in {
3237    foreach instr = ["max", "min"] in {
3238      def int_aarch64_sve_ # ty # instr # _single_x2 : SME2_VG2_Multi_Single_Intrinsic;
3239      def int_aarch64_sve_ # ty # instr # _single_x4 : SME2_VG4_Multi_Single_Intrinsic;
3240
3241      def int_aarch64_sve_ # ty # instr # _x2 : SME2_VG2_Multi_Multi_Intrinsic;
3242      def int_aarch64_sve_ # ty # instr # _x4 : SME2_VG4_Multi_Multi_Intrinsic;
3243    }
3244  }
3245
3246  //
3247  // Multi-vector floating point min/max number
3248  //
3249
3250  foreach instr = ["fmaxnm", "fminnm"] in {
3251    def int_aarch64_sve_ # instr # _single_x2 : SME2_VG2_Multi_Single_Intrinsic;
3252    def int_aarch64_sve_ # instr # _single_x4 : SME2_VG4_Multi_Single_Intrinsic;
3253
3254    def int_aarch64_sve_ # instr # _x2 : SME2_VG2_Multi_Multi_Intrinsic;
3255    def int_aarch64_sve_ # instr # _x4 : SME2_VG4_Multi_Multi_Intrinsic;
3256  }
3257
3258  //
3259  // Multi-vector vertical dot-products
3260  //
3261
3262  def int_aarch64_sme_fvdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3263
3264  foreach ty = ["s", "u"] in {
3265    def int_aarch64_sme_ #ty # vdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3266    def int_aarch64_sme_ #ty # vdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3267    def int_aarch64_sme_ #ty # vdot_lane_za64_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3268  }
3269
3270  def int_aarch64_sme_suvdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3271  def int_aarch64_sme_usvdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3272
3273  //
3274  // Multi-vector floating-point CVT from single-precision to interleaved half-precision/BFloat16
3275  //
3276  def int_aarch64_sve_fcvtn_x2  : SME2_CVT_VG2_SINGLE_Intrinsic;
3277  def int_aarch64_sve_bfcvtn_x2 : SME2_CVT_VG2_SINGLE_BF16_Intrinsic;
3278
3279  //
3280  // Multi-vector convert to/from floating-point.
3281  //
3282  def int_aarch64_sve_fcvt_x2  : SME2_CVT_VG2_SINGLE_Intrinsic;
3283  def int_aarch64_sve_bfcvt_x2 : SME2_CVT_VG2_SINGLE_BF16_Intrinsic;
3284  def int_aarch64_sve_fcvts_x2 : SME2_CVT_FtoI_VG2_Intrinsic;
3285  def int_aarch64_sve_fcvtu_x2 : SME2_CVT_FtoI_VG2_Intrinsic;
3286  def int_aarch64_sve_scvtf_x2 : SME2_CVT_ItoF_VG2_Intrinsic;
3287  def int_aarch64_sve_ucvtf_x2 : SME2_CVT_ItoF_VG2_Intrinsic;
3288  def int_aarch64_sve_fcvts_x4 : SME2_CVT_FtoI_VG4_Intrinsic;
3289  def int_aarch64_sve_fcvtu_x4 : SME2_CVT_FtoI_VG4_Intrinsic;
3290  def int_aarch64_sve_scvtf_x4 : SME2_CVT_ItoF_VG4_Intrinsic;
3291  def int_aarch64_sve_ucvtf_x4 : SME2_CVT_ItoF_VG4_Intrinsic;
3292
3293  //
3294  // Multi-vector saturating extract narrow
3295  //
3296  def int_aarch64_sve_sqcvt_x2  : SME2_CVT_VG2_SINGLE_Intrinsic;
3297  def int_aarch64_sve_uqcvt_x2  : SME2_CVT_VG2_SINGLE_Intrinsic;
3298  def int_aarch64_sve_sqcvtu_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
3299  def int_aarch64_sve_sqcvt_x4  : SME2_CVT_VG4_SINGLE_Intrinsic;
3300  def int_aarch64_sve_uqcvt_x4  : SME2_CVT_VG4_SINGLE_Intrinsic;
3301  def int_aarch64_sve_sqcvtu_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
3302
3303  //
3304  // Multi-vector saturating extract narrow and interleave
3305  //
3306  def int_aarch64_sve_sqcvtn_x2  : SME2_CVT_VG2_SINGLE_Intrinsic;
3307  def int_aarch64_sve_uqcvtn_x2  : SME2_CVT_VG2_SINGLE_Intrinsic;
3308  def int_aarch64_sve_sqcvtun_x2 : SME2_CVT_VG2_SINGLE_Intrinsic;
3309  def int_aarch64_sve_sqcvtn_x4  : SME2_CVT_VG4_SINGLE_Intrinsic;
3310  def int_aarch64_sve_uqcvtn_x4  : SME2_CVT_VG4_SINGLE_Intrinsic;
3311  def int_aarch64_sve_sqcvtun_x4 : SME2_CVT_VG4_SINGLE_Intrinsic;
3312
3313  //
3314  // Multi-Single add/sub
3315  //
3316  def int_aarch64_sme_add_write_single_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3317  def int_aarch64_sme_sub_write_single_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3318  def int_aarch64_sme_add_write_single_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3319  def int_aarch64_sme_sub_write_single_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3320
3321  //
3322  // Multi-Multi add/sub
3323  //
3324  def int_aarch64_sme_add_write_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3325  def int_aarch64_sme_sub_write_za_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3326  def int_aarch64_sme_add_write_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3327  def int_aarch64_sme_sub_write_za_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3328
3329  // Multi-vector clamps
3330  def int_aarch64_sve_sclamp_single_x2 : SME2_VG2_Multi_Single_Single_Intrinsic;
3331  def int_aarch64_sve_uclamp_single_x2 : SME2_VG2_Multi_Single_Single_Intrinsic;
3332  def int_aarch64_sve_fclamp_single_x2 : SME2_VG2_Multi_Single_Single_Intrinsic;
3333
3334  def int_aarch64_sve_sclamp_single_x4 : SME2_VG4_Multi_Single_Single_Intrinsic;
3335  def int_aarch64_sve_uclamp_single_x4 : SME2_VG4_Multi_Single_Single_Intrinsic;
3336  def int_aarch64_sve_fclamp_single_x4 : SME2_VG4_Multi_Single_Single_Intrinsic;
3337
3338  //
3339  // Multi-vector add/sub and accumulate into ZA
3340  //
3341  foreach intr = ["add", "sub"] in {
3342    foreach za = ["za32", "za64"] in {
3343      def int_aarch64_sme_ # intr # _ # za # _vg1x2 : SME2_ZA_Write_VG2_Intrinsic;
3344      def int_aarch64_sme_ # intr # _ # za # _vg1x4 : SME2_ZA_Write_VG4_Intrinsic;
3345    }
3346  }
3347
3348  //
3349  // Move multi-vectors to/from ZA
3350  //
3351
3352  def int_aarch64_sme_read_hor_vg2   : SME2_Matrix_TileVector_Read_VG2_Intrinsic;
3353  def int_aarch64_sme_read_hor_vg4   : SME2_Matrix_TileVector_Read_VG4_Intrinsic;
3354
3355  def int_aarch64_sme_read_ver_vg2   : SME2_Matrix_TileVector_Read_VG2_Intrinsic;
3356  def int_aarch64_sme_read_ver_vg4   : SME2_Matrix_TileVector_Read_VG4_Intrinsic;
3357
3358  def int_aarch64_sme_read_vg1x2 : SME2_ZA_ArrayVector_Read_VG2_Intrinsic;
3359  def int_aarch64_sme_read_vg1x4 : SME2_ZA_ArrayVector_Read_VG4_Intrinsic;
3360
3361  def int_aarch64_sme_write_hor_vg2 : SME2_Matrix_TileVector_Write_VG2_Intrinsic;
3362  def int_aarch64_sme_write_hor_vg4 : SME2_Matrix_TileVector_Write_VG4_Intrinsic;
3363
3364  def int_aarch64_sme_write_ver_vg2 : SME2_Matrix_TileVector_Write_VG2_Intrinsic;
3365  def int_aarch64_sme_write_ver_vg4 : SME2_Matrix_TileVector_Write_VG4_Intrinsic;
3366
3367  def int_aarch64_sme_write_vg1x2 : SME2_ZA_ArrayVector_Write_VG2_Intrinsic;
3368  def int_aarch64_sme_write_vg1x4 : SME2_ZA_ArrayVector_Write_VG4_Intrinsic;
3369
3370  //
3371  // Multi-Single Vector add
3372  //
3373  def int_aarch64_sve_add_single_x2 : SME2_VG2_Multi_Single_Intrinsic;
3374  def int_aarch64_sve_add_single_x4 : SME2_VG4_Multi_Single_Intrinsic;
3375
3376  // 2-way and 4-way multi-vector signed/unsigned integer dot-product
3377  foreach ty = ["s", "u"] in {
3378    foreach sz = ["za32", "za64"] in {
3379      def int_aarch64_sme_ # ty # dot_single_ # sz # _vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3380      def int_aarch64_sme_ # ty # dot_single_ # sz # _vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3381
3382      def int_aarch64_sme_ # ty # dot_ # sz # _vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3383      def int_aarch64_sme_ # ty # dot_ # sz # _vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3384
3385      def int_aarch64_sme_ # ty # dot_lane_ # sz # _vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3386      def int_aarch64_sme_ # ty # dot_lane_ # sz # _vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3387    }
3388  }
3389
3390  foreach ty = ["su", "us"] in {
3391    def int_aarch64_sme_ # ty # dot_single_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3392    def int_aarch64_sme_ # ty # dot_single_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3393
3394    def int_aarch64_sme_ # ty # dot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3395    def int_aarch64_sme_ # ty # dot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3396  }
3397
3398  def int_aarch64_sme_usdot_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3399  def int_aarch64_sme_usdot_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3400
3401  // Multi-vector half-precision or bfloat floating-point dot-product
3402  def int_aarch64_sme_fdot_single_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
3403  def int_aarch64_sme_fdot_single_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
3404
3405  def int_aarch64_sme_fdot_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
3406  def int_aarch64_sme_fdot_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
3407
3408  def int_aarch64_sme_fdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
3409  def int_aarch64_sme_fdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
3410
3411  // Multi-vector zip and unzips
3412  def int_aarch64_sve_zip_x2  : SVE2_VG2_ZipUzp_Intrinsic;
3413  def int_aarch64_sve_zipq_x2 : SVE2_VG2_ZipUzp_Intrinsic;
3414  def int_aarch64_sve_zip_x4  : SVE2_VG4_ZipUzp_Intrinsic;
3415  def int_aarch64_sve_zipq_x4 : SVE2_VG4_ZipUzp_Intrinsic;
3416  def int_aarch64_sve_uzp_x2  : SVE2_VG2_ZipUzp_Intrinsic;
3417  def int_aarch64_sve_uzpq_x2 : SVE2_VG2_ZipUzp_Intrinsic;
3418  def int_aarch64_sve_uzp_x4  : SVE2_VG4_ZipUzp_Intrinsic;
3419  def int_aarch64_sve_uzpq_x4 : SVE2_VG4_ZipUzp_Intrinsic;
3420
3421  // Vector dot-products (2-way)
3422  def int_aarch64_sve_sdot_x2 : SVE2_3VectorArg_Long_Intrinsic;
3423  def int_aarch64_sve_udot_x2 : SVE2_3VectorArg_Long_Intrinsic;
3424  def int_aarch64_sve_fdot_x2 : SVE2_3VectorArg_Long_Intrinsic;
3425  def int_aarch64_sve_sdot_lane_x2 : SVE2_3VectorArgIndexed_Long_Intrinsic;
3426  def int_aarch64_sve_udot_lane_x2 : SVE2_3VectorArgIndexed_Long_Intrinsic;
3427  def int_aarch64_sve_fdot_lane_x2 : SVE2_3VectorArgIndexed_Long_Intrinsic;
3428
3429  //
3430  // Signed/unsigned multi-vector unpacks
3431  //
3432  def int_aarch64_sve_sunpk_x2 : SME2_VG2_Unpk_Intrinsic;
3433  def int_aarch64_sve_uunpk_x2 : SME2_VG2_Unpk_Intrinsic;
3434  def int_aarch64_sve_sunpk_x4 : SME2_VG4_Unpk_Intrinsic;
3435  def int_aarch64_sve_uunpk_x4 : SME2_VG4_Unpk_Intrinsic;
3436
3437  // 2-way and 4-way vector selects
3438  def int_aarch64_sve_sel_x2  : SVE2_VG2_Sel_Intrinsic;
3439  def int_aarch64_sve_sel_x4  : SVE2_VG4_Sel_Intrinsic;
3440
3441}
3442