Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
//===- IntrinsicsX86.td - Defines X86 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 X86-specific intrinsics.
10
//
11
//===----------------------------------------------------------------------===//
12
 
13
//===----------------------------------------------------------------------===//
14
// Interrupt traps
15
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
16
  def int_x86_int : Intrinsic<[], [llvm_i8_ty], [ImmArg<ArgIndex<0>>]>;
17
}
18
 
19
//===----------------------------------------------------------------------===//
20
// SEH intrinsics for Windows
21
let TargetPrefix = "x86" in {
22
  def int_x86_seh_lsda : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], [IntrNoMem]>;
23
 
24
  // Marks the EH registration node created in LLVM IR prior to code generation.
25
  def int_x86_seh_ehregnode : Intrinsic<[], [llvm_ptr_ty], []>;
26
 
27
  // Marks the EH guard slot node created in LLVM IR prior to code generation.
28
  def int_x86_seh_ehguard : Intrinsic<[], [llvm_ptr_ty], []>;
29
}
30
 
31
//===----------------------------------------------------------------------===//
32
// FLAGS.
33
let TargetPrefix = "x86" in {
34
  def int_x86_flags_read_u32 : ClangBuiltin<"__builtin_ia32_readeflags_u32">,
35
        Intrinsic<[llvm_i32_ty], [], []>;
36
  def int_x86_flags_read_u64 : ClangBuiltin<"__builtin_ia32_readeflags_u64">,
37
        Intrinsic<[llvm_i64_ty], [], []>;
38
  def int_x86_flags_write_u32 : ClangBuiltin<"__builtin_ia32_writeeflags_u32">,
39
        Intrinsic<[], [llvm_i32_ty], []>;
40
  def int_x86_flags_write_u64 : ClangBuiltin<"__builtin_ia32_writeeflags_u64">,
41
        Intrinsic<[], [llvm_i64_ty], []>;
42
}
43
 
44
//===----------------------------------------------------------------------===//
45
// Read Time Stamp Counter.
46
let TargetPrefix = "x86" in {
47
  def int_x86_rdtsc : ClangBuiltin<"__builtin_ia32_rdtsc">,
48
              Intrinsic<[llvm_i64_ty], [], []>;
49
  def int_x86_rdtscp :
50
              Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
51
}
52
 
53
// Read Performance-Monitoring Counter.
54
let TargetPrefix = "x86" in {
55
  def int_x86_rdpmc : ClangBuiltin<"__builtin_ia32_rdpmc">,
56
              Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
57
}
58
 
59
// Read processor ID.
60
let TargetPrefix = "x86" in {
61
  def int_x86_rdpid : ClangBuiltin<"__builtin_ia32_rdpid">,
62
              Intrinsic<[llvm_i32_ty], [], []>;
63
}
64
 
65
// Lock bit test.
66
let TargetPrefix = "x86" in {
67
  def int_x86_atomic_bts : Intrinsic<[llvm_anyint_ty], [llvm_ptr_ty, llvm_i8_ty],
68
                                     [ImmArg<ArgIndex<1>>]>;
69
  def int_x86_atomic_btc : Intrinsic<[llvm_anyint_ty], [llvm_ptr_ty, llvm_i8_ty],
70
                                     [ImmArg<ArgIndex<1>>]>;
71
  def int_x86_atomic_btr : Intrinsic<[llvm_anyint_ty], [llvm_ptr_ty, llvm_i8_ty],
72
                                     [ImmArg<ArgIndex<1>>]>;
73
  def int_x86_atomic_bts_rm  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty],
74
                                         []>;
75
  def int_x86_atomic_btc_rm  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty],
76
                                         []>;
77
  def int_x86_atomic_btr_rm  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty],
78
                                         []>;
79
 
80
 
81
}
82
 
83
// Lock binary arith with CC.
84
let TargetPrefix = "x86" in {
85
  def int_x86_atomic_add_cc  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
86
                                         [ImmArg<ArgIndex<2>>]>;
87
  def int_x86_atomic_sub_cc  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
88
                                         [ImmArg<ArgIndex<2>>]>;
89
  def int_x86_atomic_or_cc  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
90
                                         [ImmArg<ArgIndex<2>>]>;
91
  def int_x86_atomic_and_cc  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
92
                                         [ImmArg<ArgIndex<2>>]>;
93
  def int_x86_atomic_xor_cc  : Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_anyint_ty, llvm_i32_ty],
94
                                         [ImmArg<ArgIndex<2>>]>;
95
}
96
 
97
// Read Processor Register.
98
let TargetPrefix = "x86" in {
99
  def int_x86_rdpru : ClangBuiltin<"__builtin_ia32_rdpru">,
100
              Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
101
}
102
 
103
//===----------------------------------------------------------------------===//
104
// CET SS
105
let TargetPrefix = "x86" in {
106
  def int_x86_incsspd : ClangBuiltin<"__builtin_ia32_incsspd">,
107
              Intrinsic<[], [llvm_i32_ty], []>;
108
  def int_x86_incsspq : ClangBuiltin<"__builtin_ia32_incsspq">,
109
              Intrinsic<[], [llvm_i64_ty], []>;
110
  def int_x86_rdsspd : ClangBuiltin<"__builtin_ia32_rdsspd">,
111
              Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>;
112
  def int_x86_rdsspq : ClangBuiltin<"__builtin_ia32_rdsspq">,
113
              Intrinsic<[llvm_i64_ty], [llvm_i64_ty], []>;
114
  def int_x86_saveprevssp : ClangBuiltin<"__builtin_ia32_saveprevssp">,
115
              Intrinsic<[], [], []>;
116
  def int_x86_rstorssp : ClangBuiltin<"__builtin_ia32_rstorssp">,
117
              Intrinsic<[], [llvm_ptr_ty], []>;
118
  def int_x86_wrssd : ClangBuiltin<"__builtin_ia32_wrssd">,
119
              Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
120
  def int_x86_wrssq : ClangBuiltin<"__builtin_ia32_wrssq">,
121
              Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], []>;
122
  def int_x86_wrussd : ClangBuiltin<"__builtin_ia32_wrussd">,
123
              Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
124
  def int_x86_wrussq : ClangBuiltin<"__builtin_ia32_wrussq">,
125
              Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], []>;
126
  def int_x86_setssbsy : ClangBuiltin<"__builtin_ia32_setssbsy">,
127
              Intrinsic<[], [], []>;
128
  def int_x86_clrssbsy : ClangBuiltin<"__builtin_ia32_clrssbsy">,
129
              Intrinsic<[], [llvm_ptr_ty], []>;
130
}
131
 
132
//===----------------------------------------------------------------------===//
133
// 3DNow!
134
 
135
let TargetPrefix = "x86" in {
136
  def int_x86_3dnow_pavgusb : ClangBuiltin<"__builtin_ia32_pavgusb">,
137
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
138
                            [IntrNoMem]>;
139
  def int_x86_3dnow_pf2id : ClangBuiltin<"__builtin_ia32_pf2id">,
140
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
141
  def int_x86_3dnow_pfacc : ClangBuiltin<"__builtin_ia32_pfacc">,
142
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
143
                            [IntrNoMem]>;
144
  def int_x86_3dnow_pfadd : ClangBuiltin<"__builtin_ia32_pfadd">,
145
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
146
                            [IntrNoMem]>;
147
  def int_x86_3dnow_pfcmpeq : ClangBuiltin<"__builtin_ia32_pfcmpeq">,
148
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
149
                            [IntrNoMem]>;
150
  def int_x86_3dnow_pfcmpge : ClangBuiltin<"__builtin_ia32_pfcmpge">,
151
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
152
                            [IntrNoMem]>;
153
  def int_x86_3dnow_pfcmpgt : ClangBuiltin<"__builtin_ia32_pfcmpgt">,
154
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
155
                            [IntrNoMem]>;
156
  def int_x86_3dnow_pfmax : ClangBuiltin<"__builtin_ia32_pfmax">,
157
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
158
                            [IntrNoMem]>;
159
  def int_x86_3dnow_pfmin : ClangBuiltin<"__builtin_ia32_pfmin">,
160
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
161
                            [IntrNoMem]>;
162
  def int_x86_3dnow_pfmul : ClangBuiltin<"__builtin_ia32_pfmul">,
163
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
164
                            [IntrNoMem]>;
165
  def int_x86_3dnow_pfrcp : ClangBuiltin<"__builtin_ia32_pfrcp">,
166
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
167
  def int_x86_3dnow_pfrcpit1 : ClangBuiltin<"__builtin_ia32_pfrcpit1">,
168
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
169
                            [IntrNoMem]>;
170
  def int_x86_3dnow_pfrcpit2 : ClangBuiltin<"__builtin_ia32_pfrcpit2">,
171
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
172
                            [IntrNoMem]>;
173
  def int_x86_3dnow_pfrsqrt : ClangBuiltin<"__builtin_ia32_pfrsqrt">,
174
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
175
  def int_x86_3dnow_pfrsqit1 : ClangBuiltin<"__builtin_ia32_pfrsqit1">,
176
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
177
                            [IntrNoMem]>;
178
  def int_x86_3dnow_pfsub : ClangBuiltin<"__builtin_ia32_pfsub">,
179
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
180
                            [IntrNoMem]>;
181
  def int_x86_3dnow_pfsubr : ClangBuiltin<"__builtin_ia32_pfsubr">,
182
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
183
                            [IntrNoMem]>;
184
  def int_x86_3dnow_pi2fd : ClangBuiltin<"__builtin_ia32_pi2fd">,
185
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
186
  def int_x86_3dnow_pmulhrw : ClangBuiltin<"__builtin_ia32_pmulhrw">,
187
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
188
                            [IntrNoMem]>;
189
}
190
 
191
//===----------------------------------------------------------------------===//
192
// 3DNow! extensions
193
 
194
let TargetPrefix = "x86" in {
195
  def int_x86_3dnowa_pf2iw : ClangBuiltin<"__builtin_ia32_pf2iw">,
196
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
197
  def int_x86_3dnowa_pfnacc : ClangBuiltin<"__builtin_ia32_pfnacc">,
198
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
199
                            [IntrNoMem]>;
200
  def int_x86_3dnowa_pfpnacc : ClangBuiltin<"__builtin_ia32_pfpnacc">,
201
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
202
                            [IntrNoMem]>;
203
  def int_x86_3dnowa_pi2fw : ClangBuiltin<"__builtin_ia32_pi2fw">,
204
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
205
  def int_x86_3dnowa_pswapd :
206
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
207
}
208
 
209
//===----------------------------------------------------------------------===//
210
// SSE1
211
 
212
// Arithmetic ops
213
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
214
  def int_x86_sse_rcp_ss : ClangBuiltin<"__builtin_ia32_rcpss">,
215
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
216
                            [IntrNoMem]>;
217
  def int_x86_sse_rcp_ps : ClangBuiltin<"__builtin_ia32_rcpps">,
218
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
219
                            [IntrNoMem]>;
220
  def int_x86_sse_rsqrt_ss : ClangBuiltin<"__builtin_ia32_rsqrtss">,
221
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
222
                            [IntrNoMem]>;
223
  def int_x86_sse_rsqrt_ps : ClangBuiltin<"__builtin_ia32_rsqrtps">,
224
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
225
                            [IntrNoMem]>;
226
  def int_x86_sse_min_ss : ClangBuiltin<"__builtin_ia32_minss">,
227
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
228
                             llvm_v4f32_ty], [IntrNoMem]>;
229
  def int_x86_sse_min_ps : ClangBuiltin<"__builtin_ia32_minps">,
230
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
231
                             llvm_v4f32_ty], [IntrNoMem]>;
232
  def int_x86_sse_max_ss : ClangBuiltin<"__builtin_ia32_maxss">,
233
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
234
                             llvm_v4f32_ty], [IntrNoMem]>;
235
  def int_x86_sse_max_ps : ClangBuiltin<"__builtin_ia32_maxps">,
236
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
237
                             llvm_v4f32_ty], [IntrNoMem]>;
238
}
239
 
240
// Comparison ops
241
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
242
  def int_x86_sse_cmp_ss : ClangBuiltin<"__builtin_ia32_cmpss">,
243
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
244
                             llvm_v4f32_ty, llvm_i8_ty],
245
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
246
  // NOTE: This comparison intrinsic is not used by clang as long as the
247
  //       distinction in signaling behaviour is not implemented.
248
  def int_x86_sse_cmp_ps :
249
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
250
                             llvm_v4f32_ty, llvm_i8_ty],
251
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
252
  def int_x86_sse_comieq_ss : ClangBuiltin<"__builtin_ia32_comieq">,
253
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
254
                             llvm_v4f32_ty], [IntrNoMem]>;
255
  def int_x86_sse_comilt_ss : ClangBuiltin<"__builtin_ia32_comilt">,
256
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
257
                             llvm_v4f32_ty], [IntrNoMem]>;
258
  def int_x86_sse_comile_ss : ClangBuiltin<"__builtin_ia32_comile">,
259
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
260
                             llvm_v4f32_ty], [IntrNoMem]>;
261
  def int_x86_sse_comigt_ss : ClangBuiltin<"__builtin_ia32_comigt">,
262
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
263
                             llvm_v4f32_ty], [IntrNoMem]>;
264
  def int_x86_sse_comige_ss : ClangBuiltin<"__builtin_ia32_comige">,
265
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
266
                             llvm_v4f32_ty], [IntrNoMem]>;
267
  def int_x86_sse_comineq_ss : ClangBuiltin<"__builtin_ia32_comineq">,
268
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
269
                             llvm_v4f32_ty], [IntrNoMem]>;
270
  def int_x86_sse_ucomieq_ss : ClangBuiltin<"__builtin_ia32_ucomieq">,
271
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
272
                             llvm_v4f32_ty], [IntrNoMem]>;
273
  def int_x86_sse_ucomilt_ss : ClangBuiltin<"__builtin_ia32_ucomilt">,
274
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
275
                             llvm_v4f32_ty], [IntrNoMem]>;
276
  def int_x86_sse_ucomile_ss : ClangBuiltin<"__builtin_ia32_ucomile">,
277
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
278
                             llvm_v4f32_ty], [IntrNoMem]>;
279
  def int_x86_sse_ucomigt_ss : ClangBuiltin<"__builtin_ia32_ucomigt">,
280
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
281
                             llvm_v4f32_ty], [IntrNoMem]>;
282
  def int_x86_sse_ucomige_ss : ClangBuiltin<"__builtin_ia32_ucomige">,
283
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
284
                             llvm_v4f32_ty], [IntrNoMem]>;
285
  def int_x86_sse_ucomineq_ss : ClangBuiltin<"__builtin_ia32_ucomineq">,
286
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
287
                             llvm_v4f32_ty], [IntrNoMem]>;
288
}
289
 
290
 
291
// Conversion ops
292
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
293
  def int_x86_sse_cvtss2si : ClangBuiltin<"__builtin_ia32_cvtss2si">,
294
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
295
  def int_x86_sse_cvtss2si64 : ClangBuiltin<"__builtin_ia32_cvtss2si64">,
296
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
297
  def int_x86_sse_cvttss2si : ClangBuiltin<"__builtin_ia32_cvttss2si">,
298
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
299
  def int_x86_sse_cvttss2si64 : ClangBuiltin<"__builtin_ia32_cvttss2si64">,
300
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
301
 
302
  def int_x86_sse_cvtps2pi : ClangBuiltin<"__builtin_ia32_cvtps2pi">,
303
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
304
  def int_x86_sse_cvttps2pi: ClangBuiltin<"__builtin_ia32_cvttps2pi">,
305
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
306
  def int_x86_sse_cvtpi2ps : ClangBuiltin<"__builtin_ia32_cvtpi2ps">,
307
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
308
                             llvm_x86mmx_ty], [IntrNoMem]>;
309
}
310
 
311
// Cacheability support ops
312
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
313
  def int_x86_sse_sfence : ClangBuiltin<"__builtin_ia32_sfence">,
314
              Intrinsic<[], [], []>;
315
}
316
 
317
// Control register.
318
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
319
  def int_x86_sse_stmxcsr :
320
              Intrinsic<[], [llvm_ptr_ty],
321
                         [IntrWriteMem, IntrArgMemOnly,
322
                         // This prevents reordering with ldmxcsr
323
                         IntrHasSideEffects]>;
324
  def int_x86_sse_ldmxcsr :
325
              Intrinsic<[], [llvm_ptr_ty],
326
                         // FIXME: LDMXCSR does not actually write to memory,
327
                         // but intrinsic properties are generated incorrectly
328
                         // for IntrReadMem+IntrHasSideEffects.
329
                        [/*IntrReadMem, IntrArgMemOnly,*/ IntrHasSideEffects]>;
330
}
331
 
332
// Misc.
333
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
334
  def int_x86_sse_movmsk_ps : ClangBuiltin<"__builtin_ia32_movmskps">,
335
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
336
}
337
 
338
//===----------------------------------------------------------------------===//
339
// SSE2
340
 
341
// FP arithmetic ops
342
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
343
  def int_x86_sse2_min_sd : ClangBuiltin<"__builtin_ia32_minsd">,
344
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
345
                             llvm_v2f64_ty], [IntrNoMem]>;
346
  def int_x86_sse2_min_pd : ClangBuiltin<"__builtin_ia32_minpd">,
347
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
348
                             llvm_v2f64_ty], [IntrNoMem]>;
349
  def int_x86_sse2_max_sd : ClangBuiltin<"__builtin_ia32_maxsd">,
350
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
351
                             llvm_v2f64_ty], [IntrNoMem]>;
352
  def int_x86_sse2_max_pd : ClangBuiltin<"__builtin_ia32_maxpd">,
353
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
354
                             llvm_v2f64_ty], [IntrNoMem]>;
355
}
356
 
357
// FP comparison ops
358
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
359
  def int_x86_sse2_cmp_sd : ClangBuiltin<"__builtin_ia32_cmpsd">,
360
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
361
                             llvm_v2f64_ty, llvm_i8_ty],
362
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
363
  // NOTE: This comparison intrinsic is not used by clang as long as the
364
  //       distinction in signaling behaviour is not implemented.
365
  def int_x86_sse2_cmp_pd :
366
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
367
                             llvm_v2f64_ty, llvm_i8_ty],
368
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
369
  def int_x86_sse2_comieq_sd : ClangBuiltin<"__builtin_ia32_comisdeq">,
370
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
371
                             llvm_v2f64_ty], [IntrNoMem]>;
372
  def int_x86_sse2_comilt_sd : ClangBuiltin<"__builtin_ia32_comisdlt">,
373
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
374
                             llvm_v2f64_ty], [IntrNoMem]>;
375
  def int_x86_sse2_comile_sd : ClangBuiltin<"__builtin_ia32_comisdle">,
376
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
377
                             llvm_v2f64_ty], [IntrNoMem]>;
378
  def int_x86_sse2_comigt_sd : ClangBuiltin<"__builtin_ia32_comisdgt">,
379
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
380
                             llvm_v2f64_ty], [IntrNoMem]>;
381
  def int_x86_sse2_comige_sd : ClangBuiltin<"__builtin_ia32_comisdge">,
382
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
383
                             llvm_v2f64_ty], [IntrNoMem]>;
384
  def int_x86_sse2_comineq_sd : ClangBuiltin<"__builtin_ia32_comisdneq">,
385
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
386
                             llvm_v2f64_ty], [IntrNoMem]>;
387
  def int_x86_sse2_ucomieq_sd : ClangBuiltin<"__builtin_ia32_ucomisdeq">,
388
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
389
                             llvm_v2f64_ty], [IntrNoMem]>;
390
  def int_x86_sse2_ucomilt_sd : ClangBuiltin<"__builtin_ia32_ucomisdlt">,
391
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
392
                             llvm_v2f64_ty], [IntrNoMem]>;
393
  def int_x86_sse2_ucomile_sd : ClangBuiltin<"__builtin_ia32_ucomisdle">,
394
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
395
                             llvm_v2f64_ty], [IntrNoMem]>;
396
  def int_x86_sse2_ucomigt_sd : ClangBuiltin<"__builtin_ia32_ucomisdgt">,
397
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
398
                             llvm_v2f64_ty], [IntrNoMem]>;
399
  def int_x86_sse2_ucomige_sd : ClangBuiltin<"__builtin_ia32_ucomisdge">,
400
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
401
                             llvm_v2f64_ty], [IntrNoMem]>;
402
  def int_x86_sse2_ucomineq_sd : ClangBuiltin<"__builtin_ia32_ucomisdneq">,
403
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
404
                             llvm_v2f64_ty], [IntrNoMem]>;
405
}
406
 
407
// Integer arithmetic ops.
408
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
409
  def int_x86_sse2_pmulhu_w : ClangBuiltin<"__builtin_ia32_pmulhuw128">,
410
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
411
                             llvm_v8i16_ty], [IntrNoMem, Commutative]>;
412
  def int_x86_sse2_pmulh_w : ClangBuiltin<"__builtin_ia32_pmulhw128">,
413
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
414
                             llvm_v8i16_ty], [IntrNoMem, Commutative]>;
415
  def int_x86_sse2_pmadd_wd : ClangBuiltin<"__builtin_ia32_pmaddwd128">,
416
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty,
417
                             llvm_v8i16_ty], [IntrNoMem, Commutative]>;
418
  def int_x86_sse2_pavg_b : ClangBuiltin<"__builtin_ia32_pavgb128">,
419
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
420
                             llvm_v16i8_ty], [IntrNoMem, Commutative]>;
421
  def int_x86_sse2_pavg_w : ClangBuiltin<"__builtin_ia32_pavgw128">,
422
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
423
                             llvm_v8i16_ty], [IntrNoMem, Commutative]>;
424
  def int_x86_sse2_psad_bw : ClangBuiltin<"__builtin_ia32_psadbw128">,
425
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty,
426
                             llvm_v16i8_ty], [IntrNoMem, Commutative]>;
427
}
428
 
429
// Integer shift ops.
430
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
431
  def int_x86_sse2_psll_w : ClangBuiltin<"__builtin_ia32_psllw128">,
432
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
433
                             llvm_v8i16_ty], [IntrNoMem]>;
434
  def int_x86_sse2_psll_d : ClangBuiltin<"__builtin_ia32_pslld128">,
435
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
436
                             llvm_v4i32_ty], [IntrNoMem]>;
437
  def int_x86_sse2_psll_q : ClangBuiltin<"__builtin_ia32_psllq128">,
438
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
439
                             llvm_v2i64_ty], [IntrNoMem]>;
440
  def int_x86_sse2_psrl_w : ClangBuiltin<"__builtin_ia32_psrlw128">,
441
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
442
                             llvm_v8i16_ty], [IntrNoMem]>;
443
  def int_x86_sse2_psrl_d : ClangBuiltin<"__builtin_ia32_psrld128">,
444
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
445
                             llvm_v4i32_ty], [IntrNoMem]>;
446
  def int_x86_sse2_psrl_q : ClangBuiltin<"__builtin_ia32_psrlq128">,
447
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
448
                             llvm_v2i64_ty], [IntrNoMem]>;
449
  def int_x86_sse2_psra_w : ClangBuiltin<"__builtin_ia32_psraw128">,
450
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
451
                             llvm_v8i16_ty], [IntrNoMem]>;
452
  def int_x86_sse2_psra_d : ClangBuiltin<"__builtin_ia32_psrad128">,
453
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
454
                             llvm_v4i32_ty], [IntrNoMem]>;
455
 
456
  // Oddly these don't require an immediate due to a gcc compatibility issue.
457
  def int_x86_sse2_pslli_w : ClangBuiltin<"__builtin_ia32_psllwi128">,
458
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
459
                             llvm_i32_ty], [IntrNoMem]>;
460
  def int_x86_sse2_pslli_d : ClangBuiltin<"__builtin_ia32_pslldi128">,
461
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
462
                             llvm_i32_ty], [IntrNoMem]>;
463
  def int_x86_sse2_pslli_q : ClangBuiltin<"__builtin_ia32_psllqi128">,
464
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
465
                             llvm_i32_ty], [IntrNoMem]>;
466
  def int_x86_sse2_psrli_w : ClangBuiltin<"__builtin_ia32_psrlwi128">,
467
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
468
                             llvm_i32_ty], [IntrNoMem]>;
469
  def int_x86_sse2_psrli_d : ClangBuiltin<"__builtin_ia32_psrldi128">,
470
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
471
                             llvm_i32_ty], [IntrNoMem]>;
472
  def int_x86_sse2_psrli_q : ClangBuiltin<"__builtin_ia32_psrlqi128">,
473
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
474
                             llvm_i32_ty], [IntrNoMem]>;
475
  def int_x86_sse2_psrai_w : ClangBuiltin<"__builtin_ia32_psrawi128">,
476
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
477
                             llvm_i32_ty], [IntrNoMem]>;
478
  def int_x86_sse2_psrai_d : ClangBuiltin<"__builtin_ia32_psradi128">,
479
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
480
                             llvm_i32_ty], [IntrNoMem]>;
481
}
482
 
483
// Conversion ops
484
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
485
  def int_x86_sse2_cvtpd2dq : ClangBuiltin<"__builtin_ia32_cvtpd2dq">,
486
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
487
  def int_x86_sse2_cvttpd2dq : ClangBuiltin<"__builtin_ia32_cvttpd2dq">,
488
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
489
  def int_x86_sse2_cvtpd2ps : ClangBuiltin<"__builtin_ia32_cvtpd2ps">,
490
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
491
  def int_x86_sse2_cvtps2dq : ClangBuiltin<"__builtin_ia32_cvtps2dq">,
492
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
493
  def int_x86_sse2_cvttps2dq : ClangBuiltin<"__builtin_ia32_cvttps2dq">,
494
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
495
  def int_x86_sse2_cvtsd2si : ClangBuiltin<"__builtin_ia32_cvtsd2si">,
496
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
497
  def int_x86_sse2_cvtsd2si64 : ClangBuiltin<"__builtin_ia32_cvtsd2si64">,
498
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
499
  def int_x86_sse2_cvttsd2si : ClangBuiltin<"__builtin_ia32_cvttsd2si">,
500
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
501
  def int_x86_sse2_cvttsd2si64 : ClangBuiltin<"__builtin_ia32_cvttsd2si64">,
502
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
503
  def int_x86_sse2_cvtsd2ss : ClangBuiltin<"__builtin_ia32_cvtsd2ss">,
504
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
505
                             llvm_v2f64_ty], [IntrNoMem]>;
506
  def int_x86_sse_cvtpd2pi : ClangBuiltin<"__builtin_ia32_cvtpd2pi">,
507
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
508
  def int_x86_sse_cvttpd2pi: ClangBuiltin<"__builtin_ia32_cvttpd2pi">,
509
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
510
  def int_x86_sse_cvtpi2pd : ClangBuiltin<"__builtin_ia32_cvtpi2pd">,
511
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
512
}
513
 
514
// Misc.
515
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
516
  def int_x86_sse2_packsswb_128 : ClangBuiltin<"__builtin_ia32_packsswb128">,
517
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
518
                             llvm_v8i16_ty], [IntrNoMem]>;
519
  def int_x86_sse2_packssdw_128 : ClangBuiltin<"__builtin_ia32_packssdw128">,
520
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty,
521
                             llvm_v4i32_ty], [IntrNoMem]>;
522
  def int_x86_sse2_packuswb_128 : ClangBuiltin<"__builtin_ia32_packuswb128">,
523
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
524
                             llvm_v8i16_ty], [IntrNoMem]>;
525
  def int_x86_sse2_movmsk_pd : ClangBuiltin<"__builtin_ia32_movmskpd">,
526
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
527
  def int_x86_sse2_pmovmskb_128 : ClangBuiltin<"__builtin_ia32_pmovmskb128">,
528
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
529
  def int_x86_sse2_maskmov_dqu : ClangBuiltin<"__builtin_ia32_maskmovdqu">,
530
              Intrinsic<[], [llvm_v16i8_ty,
531
                         llvm_v16i8_ty, llvm_ptr_ty], []>;
532
  def int_x86_sse2_clflush : ClangBuiltin<"__builtin_ia32_clflush">,
533
              Intrinsic<[], [llvm_ptr_ty], []>;
534
  def int_x86_sse2_lfence : ClangBuiltin<"__builtin_ia32_lfence">,
535
              Intrinsic<[], [], []>;
536
  def int_x86_sse2_mfence : ClangBuiltin<"__builtin_ia32_mfence">,
537
              Intrinsic<[], [], []>;
538
  def int_x86_sse2_pause : ClangBuiltin<"__builtin_ia32_pause">,
539
              Intrinsic<[], [], []>;
540
}
541
 
542
//===----------------------------------------------------------------------===//
543
// SSE3
544
 
545
// Addition / subtraction ops.
546
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
547
  def int_x86_sse3_addsub_ps : ClangBuiltin<"__builtin_ia32_addsubps">,
548
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
549
                             llvm_v4f32_ty], [IntrNoMem]>;
550
  def int_x86_sse3_addsub_pd : ClangBuiltin<"__builtin_ia32_addsubpd">,
551
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
552
                             llvm_v2f64_ty], [IntrNoMem]>;
553
}
554
 
555
// Horizontal ops.
556
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
557
  def int_x86_sse3_hadd_ps : ClangBuiltin<"__builtin_ia32_haddps">,
558
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
559
                             llvm_v4f32_ty], [IntrNoMem]>;
560
  def int_x86_sse3_hadd_pd : ClangBuiltin<"__builtin_ia32_haddpd">,
561
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
562
                             llvm_v2f64_ty], [IntrNoMem]>;
563
  def int_x86_sse3_hsub_ps : ClangBuiltin<"__builtin_ia32_hsubps">,
564
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
565
                             llvm_v4f32_ty], [IntrNoMem]>;
566
  def int_x86_sse3_hsub_pd : ClangBuiltin<"__builtin_ia32_hsubpd">,
567
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
568
                             llvm_v2f64_ty], [IntrNoMem]>;
569
}
570
 
571
// Specialized unaligned load.
572
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
573
  def int_x86_sse3_ldu_dq : ClangBuiltin<"__builtin_ia32_lddqu">,
574
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
575
}
576
 
577
// Thread synchronization ops.
578
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
579
  def int_x86_sse3_monitor : ClangBuiltin<"__builtin_ia32_monitor">,
580
              Intrinsic<[], [llvm_ptr_ty,
581
                         llvm_i32_ty, llvm_i32_ty], []>;
582
  def int_x86_sse3_mwait : ClangBuiltin<"__builtin_ia32_mwait">,
583
              Intrinsic<[], [llvm_i32_ty,
584
                         llvm_i32_ty], []>;
585
}
586
 
587
//===----------------------------------------------------------------------===//
588
// SSSE3
589
 
590
// Horizontal arithmetic ops
591
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
592
  def int_x86_ssse3_phadd_w         : ClangBuiltin<"__builtin_ia32_phaddw">,
593
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
594
                             llvm_x86mmx_ty], [IntrNoMem]>;
595
  def int_x86_ssse3_phadd_w_128     : ClangBuiltin<"__builtin_ia32_phaddw128">,
596
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
597
                             llvm_v8i16_ty], [IntrNoMem]>;
598
 
599
  def int_x86_ssse3_phadd_d         : ClangBuiltin<"__builtin_ia32_phaddd">,
600
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
601
                             llvm_x86mmx_ty], [IntrNoMem]>;
602
  def int_x86_ssse3_phadd_d_128     : ClangBuiltin<"__builtin_ia32_phaddd128">,
603
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
604
                             llvm_v4i32_ty], [IntrNoMem]>;
605
 
606
  def int_x86_ssse3_phadd_sw        : ClangBuiltin<"__builtin_ia32_phaddsw">,
607
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
608
                             llvm_x86mmx_ty], [IntrNoMem]>;
609
  def int_x86_ssse3_phadd_sw_128    : ClangBuiltin<"__builtin_ia32_phaddsw128">,
610
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
611
                             llvm_v8i16_ty], [IntrNoMem]>;
612
 
613
  def int_x86_ssse3_phsub_w         : ClangBuiltin<"__builtin_ia32_phsubw">,
614
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
615
                             llvm_x86mmx_ty], [IntrNoMem]>;
616
  def int_x86_ssse3_phsub_w_128     : ClangBuiltin<"__builtin_ia32_phsubw128">,
617
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
618
                             llvm_v8i16_ty], [IntrNoMem]>;
619
 
620
  def int_x86_ssse3_phsub_d         : ClangBuiltin<"__builtin_ia32_phsubd">,
621
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
622
                             llvm_x86mmx_ty], [IntrNoMem]>;
623
  def int_x86_ssse3_phsub_d_128     : ClangBuiltin<"__builtin_ia32_phsubd128">,
624
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
625
                             llvm_v4i32_ty], [IntrNoMem]>;
626
 
627
  def int_x86_ssse3_phsub_sw        : ClangBuiltin<"__builtin_ia32_phsubsw">,
628
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
629
                             llvm_x86mmx_ty], [IntrNoMem]>;
630
  def int_x86_ssse3_phsub_sw_128    : ClangBuiltin<"__builtin_ia32_phsubsw128">,
631
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
632
                             llvm_v8i16_ty], [IntrNoMem]>;
633
 
634
  def int_x86_ssse3_pmadd_ub_sw     : ClangBuiltin<"__builtin_ia32_pmaddubsw">,
635
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
636
                             llvm_x86mmx_ty], [IntrNoMem]>;
637
  def int_x86_ssse3_pmadd_ub_sw_128 : ClangBuiltin<"__builtin_ia32_pmaddubsw128">,
638
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty,
639
                             llvm_v16i8_ty], [IntrNoMem]>;
640
}
641
 
642
// Packed multiply high with round and scale
643
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
644
  def int_x86_ssse3_pmul_hr_sw      : ClangBuiltin<"__builtin_ia32_pmulhrsw">,
645
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
646
                             llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
647
  def int_x86_ssse3_pmul_hr_sw_128  : ClangBuiltin<"__builtin_ia32_pmulhrsw128">,
648
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
649
                             llvm_v8i16_ty], [IntrNoMem, Commutative]>;
650
}
651
 
652
// Shuffle ops
653
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
654
  def int_x86_ssse3_pshuf_b         : ClangBuiltin<"__builtin_ia32_pshufb">,
655
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
656
                             llvm_x86mmx_ty], [IntrNoMem]>;
657
  def int_x86_ssse3_pshuf_b_128     : ClangBuiltin<"__builtin_ia32_pshufb128">,
658
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
659
                             llvm_v16i8_ty], [IntrNoMem]>;
660
  def int_x86_sse_pshuf_w           : ClangBuiltin<"__builtin_ia32_pshufw">,
661
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i8_ty],
662
                             [IntrNoMem, ImmArg<ArgIndex<1>>]>;
663
}
664
 
665
// Sign ops
666
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
667
  def int_x86_ssse3_psign_b         : ClangBuiltin<"__builtin_ia32_psignb">,
668
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
669
                             llvm_x86mmx_ty], [IntrNoMem]>;
670
  def int_x86_ssse3_psign_b_128     : ClangBuiltin<"__builtin_ia32_psignb128">,
671
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
672
                             llvm_v16i8_ty], [IntrNoMem]>;
673
 
674
  def int_x86_ssse3_psign_w         : ClangBuiltin<"__builtin_ia32_psignw">,
675
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
676
                             llvm_x86mmx_ty], [IntrNoMem]>;
677
  def int_x86_ssse3_psign_w_128     : ClangBuiltin<"__builtin_ia32_psignw128">,
678
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
679
                             llvm_v8i16_ty], [IntrNoMem]>;
680
 
681
  def int_x86_ssse3_psign_d         : ClangBuiltin<"__builtin_ia32_psignd">,
682
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
683
                             llvm_x86mmx_ty], [IntrNoMem]>;
684
  def int_x86_ssse3_psign_d_128     : ClangBuiltin<"__builtin_ia32_psignd128">,
685
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
686
                             llvm_v4i32_ty], [IntrNoMem]>;
687
}
688
 
689
// Absolute value ops
690
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
691
  def int_x86_ssse3_pabs_b     : ClangBuiltin<"__builtin_ia32_pabsb">,
692
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
693
 
694
  def int_x86_ssse3_pabs_w     : ClangBuiltin<"__builtin_ia32_pabsw">,
695
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
696
 
697
  def int_x86_ssse3_pabs_d     : ClangBuiltin<"__builtin_ia32_pabsd">,
698
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
699
}
700
 
701
//===----------------------------------------------------------------------===//
702
// SSE4.1
703
 
704
// FP rounding ops
705
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
706
  def int_x86_sse41_round_ss        : ClangBuiltin<"__builtin_ia32_roundss">,
707
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
708
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
709
  def int_x86_sse41_round_ps        : ClangBuiltin<"__builtin_ia32_roundps">,
710
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
711
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
712
  def int_x86_sse41_round_sd        : ClangBuiltin<"__builtin_ia32_roundsd">,
713
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
714
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
715
  def int_x86_sse41_round_pd        : ClangBuiltin<"__builtin_ia32_roundpd">,
716
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
717
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<1>>]>;
718
}
719
 
720
// Vector min element
721
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
722
  def int_x86_sse41_phminposuw     : ClangBuiltin<"__builtin_ia32_phminposuw128">,
723
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
724
}
725
 
726
// Advanced Encryption Standard (AES) Instructions
727
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
728
  def int_x86_aesni_aesimc          : ClangBuiltin<"__builtin_ia32_aesimc128">,
729
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
730
 
731
  def int_x86_aesni_aesenc          : ClangBuiltin<"__builtin_ia32_aesenc128">,
732
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
733
                            [IntrNoMem]>;
734
  def int_x86_aesni_aesenc_256      : ClangBuiltin<"__builtin_ia32_aesenc256">,
735
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
736
                            [IntrNoMem]>;
737
  def int_x86_aesni_aesenc_512      : ClangBuiltin<"__builtin_ia32_aesenc512">,
738
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
739
                            [IntrNoMem]>;
740
 
741
  def int_x86_aesni_aesenclast : ClangBuiltin<"__builtin_ia32_aesenclast128">,
742
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
743
                            [IntrNoMem]>;
744
  def int_x86_aesni_aesenclast_256 :
745
    ClangBuiltin<"__builtin_ia32_aesenclast256">,
746
    DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
747
                          [IntrNoMem]>;
748
  def int_x86_aesni_aesenclast_512 :
749
    ClangBuiltin<"__builtin_ia32_aesenclast512">,
750
    DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
751
                          [IntrNoMem]>;
752
 
753
  def int_x86_aesni_aesdec          : ClangBuiltin<"__builtin_ia32_aesdec128">,
754
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
755
                            [IntrNoMem]>;
756
  def int_x86_aesni_aesdec_256      : ClangBuiltin<"__builtin_ia32_aesdec256">,
757
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
758
                            [IntrNoMem]>;
759
  def int_x86_aesni_aesdec_512      : ClangBuiltin<"__builtin_ia32_aesdec512">,
760
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
761
                            [IntrNoMem]>;
762
 
763
  def int_x86_aesni_aesdeclast : ClangBuiltin<"__builtin_ia32_aesdeclast128">,
764
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
765
                            [IntrNoMem]>;
766
  def int_x86_aesni_aesdeclast_256 :
767
    ClangBuiltin<"__builtin_ia32_aesdeclast256">,
768
    DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
769
                          [IntrNoMem]>;
770
  def int_x86_aesni_aesdeclast_512 :
771
    ClangBuiltin<"__builtin_ia32_aesdeclast512">,
772
    DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
773
                          [IntrNoMem]>;
774
 
775
  def int_x86_aesni_aeskeygenassist :
776
    ClangBuiltin<"__builtin_ia32_aeskeygenassist128">,
777
    DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty],
778
                          [IntrNoMem, ImmArg<ArgIndex<1>>]>;
779
}
780
 
781
// PCLMUL instructions
782
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
783
  def int_x86_pclmulqdq : ClangBuiltin<"__builtin_ia32_pclmulqdq128">,
784
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
785
                            [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
786
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
787
  def int_x86_pclmulqdq_256 : ClangBuiltin<"__builtin_ia32_pclmulqdq256">,
788
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
789
                                [llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
790
                                [IntrNoMem, ImmArg<ArgIndex<2>>]>;
791
  def int_x86_pclmulqdq_512 : ClangBuiltin<"__builtin_ia32_pclmulqdq512">,
792
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
793
                                [llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty],
794
                                [IntrNoMem, ImmArg<ArgIndex<2>>]>;
795
}
796
 
797
// Vector pack
798
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
799
  def int_x86_sse41_packusdw : ClangBuiltin<"__builtin_ia32_packusdw128">,
800
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
801
                            [IntrNoMem]>;
802
}
803
 
804
// Vector insert
805
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
806
  def int_x86_sse41_insertps       : ClangBuiltin<"__builtin_ia32_insertps128">,
807
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
808
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
809
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
810
}
811
 
812
// Vector blend
813
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
814
  def int_x86_sse41_pblendvb       : ClangBuiltin<"__builtin_ia32_pblendvb128">,
815
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
816
                            [llvm_v16i8_ty, llvm_v16i8_ty,llvm_v16i8_ty],
817
                            [IntrNoMem]>;
818
  def int_x86_sse41_blendvpd       : ClangBuiltin<"__builtin_ia32_blendvpd">,
819
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
820
                            [llvm_v2f64_ty, llvm_v2f64_ty,llvm_v2f64_ty],
821
                            [IntrNoMem]>;
822
  def int_x86_sse41_blendvps       : ClangBuiltin<"__builtin_ia32_blendvps">,
823
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
824
                            [llvm_v4f32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
825
                            [IntrNoMem]>;
826
}
827
 
828
// Vector dot product
829
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
830
  def int_x86_sse41_dppd            : ClangBuiltin<"__builtin_ia32_dppd">,
831
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
832
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
833
                            [IntrNoMem, Commutative, ImmArg<ArgIndex<2>>]>;
834
  def int_x86_sse41_dpps            : ClangBuiltin<"__builtin_ia32_dpps">,
835
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
836
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
837
                            [IntrNoMem, Commutative, ImmArg<ArgIndex<2>>]>;
838
}
839
 
840
// Vector sum of absolute differences
841
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
842
  def int_x86_sse41_mpsadbw         : ClangBuiltin<"__builtin_ia32_mpsadbw128">,
843
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
844
                            [llvm_v16i8_ty, llvm_v16i8_ty,llvm_i8_ty],
845
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
846
}
847
 
848
// Test instruction with bitwise comparison.
849
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
850
  def int_x86_sse41_ptestz          : ClangBuiltin<"__builtin_ia32_ptestz128">,
851
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
852
                            [IntrNoMem]>;
853
  def int_x86_sse41_ptestc          : ClangBuiltin<"__builtin_ia32_ptestc128">,
854
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
855
                            [IntrNoMem]>;
856
  def int_x86_sse41_ptestnzc        : ClangBuiltin<"__builtin_ia32_ptestnzc128">,
857
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
858
                            [IntrNoMem]>;
859
}
860
 
861
//===----------------------------------------------------------------------===//
862
// SSE4.2
863
 
864
// Miscellaneous
865
// CRC Instruction
866
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
867
  def int_x86_sse42_crc32_32_8       : ClangBuiltin<"__builtin_ia32_crc32qi">,
868
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i8_ty],
869
                            [IntrNoMem]>;
870
  def int_x86_sse42_crc32_32_16      : ClangBuiltin<"__builtin_ia32_crc32hi">,
871
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i16_ty],
872
                            [IntrNoMem]>;
873
  def int_x86_sse42_crc32_32_32      : ClangBuiltin<"__builtin_ia32_crc32si">,
874
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
875
                            [IntrNoMem]>;
876
  def int_x86_sse42_crc32_64_64      : ClangBuiltin<"__builtin_ia32_crc32di">,
877
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
878
                            [IntrNoMem]>;
879
}
880
 
881
// String/text processing ops.
882
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
883
  def int_x86_sse42_pcmpistrm128  : ClangBuiltin<"__builtin_ia32_pcmpistrm128">,
884
    DefaultAttrsIntrinsic<[llvm_v16i8_ty],
885
        [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
886
        [IntrNoMem, ImmArg<ArgIndex<2>>]>;
887
  def int_x86_sse42_pcmpistri128  : ClangBuiltin<"__builtin_ia32_pcmpistri128">,
888
    DefaultAttrsIntrinsic<[llvm_i32_ty],
889
        [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
890
        [IntrNoMem, ImmArg<ArgIndex<2>>]>;
891
  def int_x86_sse42_pcmpistria128 : ClangBuiltin<"__builtin_ia32_pcmpistria128">,
892
    DefaultAttrsIntrinsic<[llvm_i32_ty],
893
        [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
894
        [IntrNoMem, ImmArg<ArgIndex<2>>]>;
895
  def int_x86_sse42_pcmpistric128 : ClangBuiltin<"__builtin_ia32_pcmpistric128">,
896
    DefaultAttrsIntrinsic<[llvm_i32_ty],
897
        [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
898
        [IntrNoMem, ImmArg<ArgIndex<2>>]>;
899
  def int_x86_sse42_pcmpistrio128 : ClangBuiltin<"__builtin_ia32_pcmpistrio128">,
900
    DefaultAttrsIntrinsic<[llvm_i32_ty],
901
        [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
902
        [IntrNoMem, ImmArg<ArgIndex<2>>]>;
903
  def int_x86_sse42_pcmpistris128 : ClangBuiltin<"__builtin_ia32_pcmpistris128">,
904
    DefaultAttrsIntrinsic<[llvm_i32_ty],
905
        [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
906
        [IntrNoMem, ImmArg<ArgIndex<2>>]>;
907
  def int_x86_sse42_pcmpistriz128 : ClangBuiltin<"__builtin_ia32_pcmpistriz128">,
908
    DefaultAttrsIntrinsic<[llvm_i32_ty],
909
        [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
910
        [IntrNoMem, ImmArg<ArgIndex<2>>]>;
911
  def int_x86_sse42_pcmpestrm128  : ClangBuiltin<"__builtin_ia32_pcmpestrm128">,
912
    DefaultAttrsIntrinsic<[llvm_v16i8_ty],
913
        [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
914
         llvm_i8_ty],
915
        [IntrNoMem, ImmArg<ArgIndex<4>>]>;
916
  def int_x86_sse42_pcmpestri128  : ClangBuiltin<"__builtin_ia32_pcmpestri128">,
917
    DefaultAttrsIntrinsic<[llvm_i32_ty],
918
        [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
919
         llvm_i8_ty],
920
        [IntrNoMem, ImmArg<ArgIndex<4>>]>;
921
  def int_x86_sse42_pcmpestria128 : ClangBuiltin<"__builtin_ia32_pcmpestria128">,
922
    DefaultAttrsIntrinsic<[llvm_i32_ty],
923
        [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
924
         llvm_i8_ty],
925
        [IntrNoMem, ImmArg<ArgIndex<4>>]>;
926
  def int_x86_sse42_pcmpestric128 : ClangBuiltin<"__builtin_ia32_pcmpestric128">,
927
    DefaultAttrsIntrinsic<[llvm_i32_ty],
928
        [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
929
         llvm_i8_ty],
930
        [IntrNoMem, ImmArg<ArgIndex<4>>]>;
931
  def int_x86_sse42_pcmpestrio128 : ClangBuiltin<"__builtin_ia32_pcmpestrio128">,
932
    DefaultAttrsIntrinsic<[llvm_i32_ty],
933
        [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
934
         llvm_i8_ty],
935
        [IntrNoMem, ImmArg<ArgIndex<4>>]>;
936
  def int_x86_sse42_pcmpestris128 : ClangBuiltin<"__builtin_ia32_pcmpestris128">,
937
    DefaultAttrsIntrinsic<[llvm_i32_ty],
938
        [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
939
         llvm_i8_ty],
940
        [IntrNoMem, ImmArg<ArgIndex<4>>]>;
941
  def int_x86_sse42_pcmpestriz128 : ClangBuiltin<"__builtin_ia32_pcmpestriz128">,
942
    DefaultAttrsIntrinsic<[llvm_i32_ty],
943
        [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
944
         llvm_i8_ty],
945
        [IntrNoMem, ImmArg<ArgIndex<4>>]>;
946
}
947
 
948
//===----------------------------------------------------------------------===//
949
// SSE4A
950
 
951
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
952
  def int_x86_sse4a_extrqi : ClangBuiltin<"__builtin_ia32_extrqi">,
953
    DefaultAttrsIntrinsic<[llvm_v2i64_ty],
954
                          [llvm_v2i64_ty, llvm_i8_ty, llvm_i8_ty],
955
                          [IntrNoMem, ImmArg<ArgIndex<1>>,
956
                           ImmArg<ArgIndex<2>>]>;
957
  def int_x86_sse4a_extrq  : ClangBuiltin<"__builtin_ia32_extrq">,
958
    DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v16i8_ty],
959
                          [IntrNoMem]>;
960
 
961
  def int_x86_sse4a_insertqi : ClangBuiltin<"__builtin_ia32_insertqi">,
962
    DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
963
                                            llvm_i8_ty, llvm_i8_ty],
964
                          [IntrNoMem, ImmArg<ArgIndex<2>>,
965
                           ImmArg<ArgIndex<3>>]>;
966
  def int_x86_sse4a_insertq  : ClangBuiltin<"__builtin_ia32_insertq">,
967
    DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
968
                          [IntrNoMem]>;
969
}
970
 
971
//===----------------------------------------------------------------------===//
972
// AVX
973
 
974
// Arithmetic ops
975
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
976
  def int_x86_avx_addsub_pd_256 : ClangBuiltin<"__builtin_ia32_addsubpd256">,
977
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
978
                            [IntrNoMem]>;
979
  def int_x86_avx_addsub_ps_256 : ClangBuiltin<"__builtin_ia32_addsubps256">,
980
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
981
                            [IntrNoMem]>;
982
  def int_x86_avx_max_pd_256 : ClangBuiltin<"__builtin_ia32_maxpd256">,
983
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
984
                            [IntrNoMem]>;
985
  def int_x86_avx_max_ps_256 : ClangBuiltin<"__builtin_ia32_maxps256">,
986
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
987
                            [IntrNoMem]>;
988
  def int_x86_avx_min_pd_256 : ClangBuiltin<"__builtin_ia32_minpd256">,
989
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
990
                            [IntrNoMem]>;
991
  def int_x86_avx_min_ps_256 : ClangBuiltin<"__builtin_ia32_minps256">,
992
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
993
                            [IntrNoMem]>;
994
 
995
  def int_x86_avx_rsqrt_ps_256 : ClangBuiltin<"__builtin_ia32_rsqrtps256">,
996
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
997
 
998
  def int_x86_avx_rcp_ps_256 : ClangBuiltin<"__builtin_ia32_rcpps256">,
999
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1000
 
1001
  def int_x86_avx_round_pd_256 : ClangBuiltin<"__builtin_ia32_roundpd256">,
1002
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i32_ty],
1003
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1004
  def int_x86_avx_round_ps_256 : ClangBuiltin<"__builtin_ia32_roundps256">,
1005
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i32_ty],
1006
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1007
}
1008
 
1009
// Horizontal ops
1010
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1011
  def int_x86_avx_hadd_pd_256 : ClangBuiltin<"__builtin_ia32_haddpd256">,
1012
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
1013
                            [IntrNoMem]>;
1014
  def int_x86_avx_hsub_ps_256 : ClangBuiltin<"__builtin_ia32_hsubps256">,
1015
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
1016
                            [IntrNoMem]>;
1017
  def int_x86_avx_hsub_pd_256 : ClangBuiltin<"__builtin_ia32_hsubpd256">,
1018
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
1019
                            [IntrNoMem]>;
1020
  def int_x86_avx_hadd_ps_256 : ClangBuiltin<"__builtin_ia32_haddps256">,
1021
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
1022
                            [IntrNoMem]>;
1023
}
1024
 
1025
// Vector permutation
1026
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1027
  def int_x86_avx_vpermilvar_pd : ClangBuiltin<"__builtin_ia32_vpermilvarpd">,
1028
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2i64_ty],
1029
                            [IntrNoMem]>;
1030
  def int_x86_avx_vpermilvar_ps : ClangBuiltin<"__builtin_ia32_vpermilvarps">,
1031
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4i32_ty],
1032
                            [IntrNoMem]>;
1033
 
1034
  def int_x86_avx_vpermilvar_pd_256 :
1035
        ClangBuiltin<"__builtin_ia32_vpermilvarpd256">,
1036
        DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty],
1037
                              [IntrNoMem]>;
1038
  def int_x86_avx_vpermilvar_ps_256 :
1039
        ClangBuiltin<"__builtin_ia32_vpermilvarps256">,
1040
        DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty],
1041
                              [IntrNoMem]>;
1042
 
1043
  def int_x86_avx512_vpermi2var_d_128 :
1044
       ClangBuiltin<"__builtin_ia32_vpermi2vard128">,
1045
       DefaultAttrsIntrinsic<[llvm_v4i32_ty],
1046
                             [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1047
                             [IntrNoMem]>;
1048
 
1049
  def int_x86_avx512_vpermi2var_d_256 :
1050
        ClangBuiltin<"__builtin_ia32_vpermi2vard256">,
1051
        DefaultAttrsIntrinsic<[llvm_v8i32_ty],
1052
                              [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
1053
                              [IntrNoMem]>;
1054
 
1055
  def int_x86_avx512_vpermi2var_d_512 :
1056
        ClangBuiltin<"__builtin_ia32_vpermi2vard512">,
1057
        DefaultAttrsIntrinsic<[llvm_v16i32_ty],
1058
                              [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty],
1059
                              [IntrNoMem]>;
1060
 
1061
  def int_x86_avx512_vpermi2var_hi_128 :
1062
        ClangBuiltin<"__builtin_ia32_vpermi2varhi128">,
1063
        DefaultAttrsIntrinsic<[llvm_v8i16_ty],
1064
                              [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
1065
                              [IntrNoMem]>;
1066
 
1067
  def int_x86_avx512_vpermi2var_hi_256 :
1068
        ClangBuiltin<"__builtin_ia32_vpermi2varhi256">,
1069
        DefaultAttrsIntrinsic<[llvm_v16i16_ty],
1070
                              [llvm_v16i16_ty, llvm_v16i16_ty, llvm_v16i16_ty],
1071
                              [IntrNoMem]>;
1072
 
1073
  def int_x86_avx512_vpermi2var_hi_512 :
1074
        ClangBuiltin<"__builtin_ia32_vpermi2varhi512">,
1075
        DefaultAttrsIntrinsic<[llvm_v32i16_ty],
1076
                              [llvm_v32i16_ty, llvm_v32i16_ty, llvm_v32i16_ty],
1077
                              [IntrNoMem]>;
1078
 
1079
  def int_x86_avx512_vpermi2var_pd_128 :
1080
        ClangBuiltin<"__builtin_ia32_vpermi2varpd128">,
1081
        DefaultAttrsIntrinsic<[llvm_v2f64_ty],
1082
                              [llvm_v2f64_ty, llvm_v2i64_ty, llvm_v2f64_ty],
1083
                              [IntrNoMem]>;
1084
 
1085
  def int_x86_avx512_vpermi2var_pd_256 :
1086
        ClangBuiltin<"__builtin_ia32_vpermi2varpd256">,
1087
        DefaultAttrsIntrinsic<[llvm_v4f64_ty],
1088
                              [llvm_v4f64_ty, llvm_v4i64_ty, llvm_v4f64_ty],
1089
                              [IntrNoMem]>;
1090
 
1091
  def int_x86_avx512_vpermi2var_pd_512 :
1092
        ClangBuiltin<"__builtin_ia32_vpermi2varpd512">,
1093
        DefaultAttrsIntrinsic<[llvm_v8f64_ty],
1094
                              [llvm_v8f64_ty, llvm_v8i64_ty, llvm_v8f64_ty],
1095
                              [IntrNoMem]>;
1096
 
1097
  def int_x86_avx512_vpermi2var_ps_128 :
1098
        ClangBuiltin<"__builtin_ia32_vpermi2varps128">,
1099
        DefaultAttrsIntrinsic<[llvm_v4f32_ty],
1100
                              [llvm_v4f32_ty, llvm_v4i32_ty, llvm_v4f32_ty],
1101
                              [IntrNoMem]>;
1102
 
1103
  def int_x86_avx512_vpermi2var_ps_256 :
1104
        ClangBuiltin<"__builtin_ia32_vpermi2varps256">,
1105
        DefaultAttrsIntrinsic<[llvm_v8f32_ty],
1106
                              [llvm_v8f32_ty, llvm_v8i32_ty, llvm_v8f32_ty],
1107
                              [IntrNoMem]>;
1108
 
1109
  def int_x86_avx512_vpermi2var_ps_512 :
1110
        ClangBuiltin<"__builtin_ia32_vpermi2varps512">,
1111
        DefaultAttrsIntrinsic<[llvm_v16f32_ty],
1112
                              [llvm_v16f32_ty, llvm_v16i32_ty, llvm_v16f32_ty],
1113
                              [IntrNoMem]>;
1114
 
1115
  def int_x86_avx512_vpermi2var_q_128 :
1116
        ClangBuiltin<"__builtin_ia32_vpermi2varq128">,
1117
        DefaultAttrsIntrinsic<[llvm_v2i64_ty],
1118
                              [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
1119
                              [IntrNoMem]>;
1120
 
1121
  def int_x86_avx512_vpermi2var_q_256 :
1122
        ClangBuiltin<"__builtin_ia32_vpermi2varq256">,
1123
        DefaultAttrsIntrinsic<[llvm_v4i64_ty],
1124
                              [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty],
1125
                              [IntrNoMem]>;
1126
 
1127
  def int_x86_avx512_vpermi2var_q_512 :
1128
        ClangBuiltin<"__builtin_ia32_vpermi2varq512">,
1129
        DefaultAttrsIntrinsic<[llvm_v8i64_ty],
1130
                              [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty],
1131
                              [IntrNoMem]>;
1132
 
1133
  def int_x86_avx512_vpermi2var_qi_128 :
1134
        ClangBuiltin<"__builtin_ia32_vpermi2varqi128">,
1135
        DefaultAttrsIntrinsic<[llvm_v16i8_ty],
1136
                              [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
1137
                              [IntrNoMem]>;
1138
 
1139
  def int_x86_avx512_vpermi2var_qi_256 :
1140
        ClangBuiltin<"__builtin_ia32_vpermi2varqi256">,
1141
        DefaultAttrsIntrinsic<[llvm_v32i8_ty],
1142
                              [llvm_v32i8_ty, llvm_v32i8_ty, llvm_v32i8_ty],
1143
                              [IntrNoMem]>;
1144
 
1145
  def int_x86_avx512_vpermi2var_qi_512 :
1146
        ClangBuiltin<"__builtin_ia32_vpermi2varqi512">,
1147
        DefaultAttrsIntrinsic<[llvm_v64i8_ty],
1148
                              [llvm_v64i8_ty, llvm_v64i8_ty, llvm_v64i8_ty],
1149
                              [IntrNoMem]>;
1150
 
1151
  def int_x86_avx512_vpermilvar_pd_512 :
1152
        ClangBuiltin<"__builtin_ia32_vpermilvarpd512">,
1153
        DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8i64_ty],
1154
                              [IntrNoMem]>;
1155
 
1156
  def int_x86_avx512_vpermilvar_ps_512 :
1157
        ClangBuiltin<"__builtin_ia32_vpermilvarps512">,
1158
        DefaultAttrsIntrinsic<[llvm_v16f32_ty],
1159
                              [llvm_v16f32_ty, llvm_v16i32_ty], [IntrNoMem]>;
1160
 
1161
  def int_x86_avx512_pshuf_b_512 :
1162
        ClangBuiltin<"__builtin_ia32_pshufb512">,
1163
        DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
1164
                              [IntrNoMem]>;
1165
 
1166
}
1167
 
1168
// GFNI Instructions
1169
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1170
  def int_x86_vgf2p8affineinvqb_128 :
1171
         ClangBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v16qi">,
1172
         DefaultAttrsIntrinsic<[llvm_v16i8_ty],
1173
                               [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
1174
                               [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1175
  def int_x86_vgf2p8affineinvqb_256 :
1176
         ClangBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v32qi">,
1177
         DefaultAttrsIntrinsic<[llvm_v32i8_ty],
1178
                               [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i8_ty],
1179
                               [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1180
  def int_x86_vgf2p8affineinvqb_512 :
1181
         ClangBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v64qi">,
1182
         DefaultAttrsIntrinsic<[llvm_v64i8_ty],
1183
                               [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i8_ty],
1184
                               [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1185
 
1186
  def int_x86_vgf2p8affineqb_128 :
1187
         ClangBuiltin<"__builtin_ia32_vgf2p8affineqb_v16qi">,
1188
         DefaultAttrsIntrinsic<[llvm_v16i8_ty],
1189
                               [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
1190
                               [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1191
  def int_x86_vgf2p8affineqb_256 :
1192
         ClangBuiltin<"__builtin_ia32_vgf2p8affineqb_v32qi">,
1193
         DefaultAttrsIntrinsic<[llvm_v32i8_ty],
1194
                               [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i8_ty],
1195
                               [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1196
  def int_x86_vgf2p8affineqb_512 :
1197
         ClangBuiltin<"__builtin_ia32_vgf2p8affineqb_v64qi">,
1198
         DefaultAttrsIntrinsic<[llvm_v64i8_ty],
1199
                               [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i8_ty],
1200
                               [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1201
 
1202
  def int_x86_vgf2p8mulb_128     :
1203
         ClangBuiltin<"__builtin_ia32_vgf2p8mulb_v16qi">,
1204
         DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
1205
                               [IntrNoMem]>;
1206
  def int_x86_vgf2p8mulb_256     :
1207
         ClangBuiltin<"__builtin_ia32_vgf2p8mulb_v32qi">,
1208
         DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
1209
                               [IntrNoMem]>;
1210
  def int_x86_vgf2p8mulb_512     :
1211
         ClangBuiltin<"__builtin_ia32_vgf2p8mulb_v64qi">,
1212
         DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
1213
                               [IntrNoMem]>;
1214
}
1215
 
1216
// Vector blend
1217
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1218
  def int_x86_avx_blendv_pd_256 : ClangBuiltin<"__builtin_ia32_blendvpd256">,
1219
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
1220
                            [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
1221
                            [IntrNoMem]>;
1222
  def int_x86_avx_blendv_ps_256 : ClangBuiltin<"__builtin_ia32_blendvps256">,
1223
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
1224
                            [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
1225
                            [IntrNoMem]>;
1226
}
1227
 
1228
// Vector dot product
1229
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1230
  def int_x86_avx_dp_ps_256 : ClangBuiltin<"__builtin_ia32_dpps256">,
1231
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
1232
                            [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
1233
                            [IntrNoMem, Commutative, ImmArg<ArgIndex<2>>]>;
1234
}
1235
 
1236
// Vector compare
1237
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1238
  def int_x86_avx_cmp_pd_256 :
1239
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
1240
                            [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
1241
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1242
  def int_x86_avx_cmp_ps_256 :
1243
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
1244
                            [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
1245
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1246
}
1247
 
1248
// Vector convert
1249
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1250
  def int_x86_avx_cvt_pd2_ps_256 : ClangBuiltin<"__builtin_ia32_cvtpd2ps256">,
1251
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1252
  def int_x86_avx_cvt_ps2dq_256 : ClangBuiltin<"__builtin_ia32_cvtps2dq256">,
1253
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1254
  def int_x86_avx_cvtt_pd2dq_256 : ClangBuiltin<"__builtin_ia32_cvttpd2dq256">,
1255
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1256
  def int_x86_avx_cvt_pd2dq_256 : ClangBuiltin<"__builtin_ia32_cvtpd2dq256">,
1257
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1258
  def int_x86_avx_cvtt_ps2dq_256 : ClangBuiltin<"__builtin_ia32_cvttps2dq256">,
1259
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1260
}
1261
 
1262
// Vector bit test
1263
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1264
  def int_x86_avx_vtestz_pd : ClangBuiltin<"__builtin_ia32_vtestzpd">,
1265
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty],
1266
                            [IntrNoMem]>;
1267
  def int_x86_avx_vtestc_pd : ClangBuiltin<"__builtin_ia32_vtestcpd">,
1268
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty],
1269
                            [IntrNoMem]>;
1270
  def int_x86_avx_vtestnzc_pd : ClangBuiltin<"__builtin_ia32_vtestnzcpd">,
1271
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty],
1272
                            [IntrNoMem]>;
1273
  def int_x86_avx_vtestz_ps : ClangBuiltin<"__builtin_ia32_vtestzps">,
1274
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
1275
                            [IntrNoMem]>;
1276
  def int_x86_avx_vtestc_ps : ClangBuiltin<"__builtin_ia32_vtestcps">,
1277
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
1278
                            [IntrNoMem]>;
1279
  def int_x86_avx_vtestnzc_ps : ClangBuiltin<"__builtin_ia32_vtestnzcps">,
1280
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
1281
                            [IntrNoMem]>;
1282
  def int_x86_avx_vtestz_pd_256 : ClangBuiltin<"__builtin_ia32_vtestzpd256">,
1283
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
1284
                            [IntrNoMem]>;
1285
  def int_x86_avx_vtestc_pd_256 : ClangBuiltin<"__builtin_ia32_vtestcpd256">,
1286
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
1287
                            [IntrNoMem]>;
1288
  def int_x86_avx_vtestnzc_pd_256 : ClangBuiltin<"__builtin_ia32_vtestnzcpd256">,
1289
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty, llvm_v4f64_ty],
1290
                            [IntrNoMem]>;
1291
  def int_x86_avx_vtestz_ps_256 : ClangBuiltin<"__builtin_ia32_vtestzps256">,
1292
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
1293
                            [IntrNoMem]>;
1294
  def int_x86_avx_vtestc_ps_256 : ClangBuiltin<"__builtin_ia32_vtestcps256">,
1295
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
1296
                            [IntrNoMem]>;
1297
  def int_x86_avx_vtestnzc_ps_256 : ClangBuiltin<"__builtin_ia32_vtestnzcps256">,
1298
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
1299
                            [IntrNoMem]>;
1300
  def int_x86_avx_ptestz_256 : ClangBuiltin<"__builtin_ia32_ptestz256">,
1301
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1302
                            [IntrNoMem]>;
1303
  def int_x86_avx_ptestc_256 : ClangBuiltin<"__builtin_ia32_ptestc256">,
1304
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1305
                            [IntrNoMem]>;
1306
  def int_x86_avx_ptestnzc_256 : ClangBuiltin<"__builtin_ia32_ptestnzc256">,
1307
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1308
                            [IntrNoMem]>;
1309
 
1310
  def int_x86_avx512_fpclass_pd_128 :
1311
      DefaultAttrsIntrinsic<[llvm_v2i1_ty], [llvm_v2f64_ty, llvm_i32_ty],
1312
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1313
  def int_x86_avx512_fpclass_pd_256 :
1314
      DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f64_ty, llvm_i32_ty],
1315
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1316
  def int_x86_avx512_fpclass_pd_512 :
1317
      DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f64_ty, llvm_i32_ty],
1318
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1319
  def int_x86_avx512_fpclass_ps_128 :
1320
      DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f32_ty, llvm_i32_ty],
1321
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1322
  def int_x86_avx512_fpclass_ps_256 :
1323
      DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f32_ty, llvm_i32_ty],
1324
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1325
  def int_x86_avx512_fpclass_ps_512 :
1326
      DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16f32_ty, llvm_i32_ty],
1327
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1328
  def int_x86_avx512_mask_fpclass_sd :
1329
      ClangBuiltin<"__builtin_ia32_fpclasssd_mask">,
1330
      DefaultAttrsIntrinsic<[llvm_i8_ty],
1331
                            [llvm_v2f64_ty, llvm_i32_ty, llvm_i8_ty],
1332
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1333
  def int_x86_avx512_mask_fpclass_ss :
1334
      ClangBuiltin<"__builtin_ia32_fpclassss_mask">,
1335
      DefaultAttrsIntrinsic<[llvm_i8_ty],
1336
                            [llvm_v4f32_ty, llvm_i32_ty, llvm_i8_ty],
1337
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
1338
}
1339
 
1340
// Vector extract sign mask
1341
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1342
  def int_x86_avx_movmsk_pd_256 : ClangBuiltin<"__builtin_ia32_movmskpd256">,
1343
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1344
  def int_x86_avx_movmsk_ps_256 : ClangBuiltin<"__builtin_ia32_movmskps256">,
1345
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1346
}
1347
 
1348
// Vector zero
1349
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1350
  def int_x86_avx_vzeroall : ClangBuiltin<"__builtin_ia32_vzeroall">,
1351
        Intrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
1352
  def int_x86_avx_vzeroupper : ClangBuiltin<"__builtin_ia32_vzeroupper">,
1353
        Intrinsic<[], [], [IntrNoMem, IntrHasSideEffects]>;
1354
}
1355
 
1356
// SIMD load ops
1357
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1358
  def int_x86_avx_ldu_dq_256 : ClangBuiltin<"__builtin_ia32_lddqu256">,
1359
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
1360
}
1361
 
1362
// Conditional load ops
1363
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1364
  def int_x86_avx_maskload_pd : ClangBuiltin<"__builtin_ia32_maskloadpd">,
1365
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
1366
                            [IntrReadMem, IntrArgMemOnly]>;
1367
  def int_x86_avx_maskload_ps : ClangBuiltin<"__builtin_ia32_maskloadps">,
1368
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
1369
                            [IntrReadMem, IntrArgMemOnly]>;
1370
  def int_x86_avx_maskload_pd_256 : ClangBuiltin<"__builtin_ia32_maskloadpd256">,
1371
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
1372
                            [IntrReadMem, IntrArgMemOnly]>;
1373
  def int_x86_avx_maskload_ps_256 : ClangBuiltin<"__builtin_ia32_maskloadps256">,
1374
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
1375
                            [IntrReadMem, IntrArgMemOnly]>;
1376
}
1377
 
1378
// Conditional store ops
1379
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1380
  def int_x86_avx_maskstore_pd : ClangBuiltin<"__builtin_ia32_maskstorepd">,
1381
        Intrinsic<[], [llvm_ptr_ty,
1382
                  llvm_v2i64_ty, llvm_v2f64_ty], [IntrArgMemOnly]>;
1383
  def int_x86_avx_maskstore_ps : ClangBuiltin<"__builtin_ia32_maskstoreps">,
1384
        Intrinsic<[], [llvm_ptr_ty,
1385
                  llvm_v4i32_ty, llvm_v4f32_ty], [IntrArgMemOnly]>;
1386
  def int_x86_avx_maskstore_pd_256 :
1387
        ClangBuiltin<"__builtin_ia32_maskstorepd256">,
1388
        Intrinsic<[], [llvm_ptr_ty,
1389
                  llvm_v4i64_ty, llvm_v4f64_ty], [IntrArgMemOnly]>;
1390
  def int_x86_avx_maskstore_ps_256 :
1391
        ClangBuiltin<"__builtin_ia32_maskstoreps256">,
1392
        Intrinsic<[], [llvm_ptr_ty,
1393
                  llvm_v8i32_ty, llvm_v8f32_ty], [IntrArgMemOnly]>;
1394
}
1395
 
1396
// BITALG bits shuffle
1397
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1398
  def int_x86_avx512_vpshufbitqmb_128 :
1399
    DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
1400
                          [IntrNoMem]>;
1401
  def int_x86_avx512_vpshufbitqmb_256 :
1402
    DefaultAttrsIntrinsic<[llvm_v32i1_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
1403
                          [IntrNoMem]>;
1404
  def int_x86_avx512_vpshufbitqmb_512 :
1405
    DefaultAttrsIntrinsic<[llvm_v64i1_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
1406
                          [IntrNoMem]>;
1407
}
1408
 
1409
//===----------------------------------------------------------------------===//
1410
// AVX2
1411
 
1412
// Integer arithmetic ops.
1413
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1414
  def int_x86_avx2_pmulhu_w : ClangBuiltin<"__builtin_ia32_pmulhuw256">,
1415
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1416
                             llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1417
  def int_x86_avx2_pmulh_w : ClangBuiltin<"__builtin_ia32_pmulhw256">,
1418
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1419
                             llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1420
  def int_x86_avx2_pmadd_wd : ClangBuiltin<"__builtin_ia32_pmaddwd256">,
1421
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v16i16_ty,
1422
                             llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1423
  def int_x86_avx2_pavg_b : ClangBuiltin<"__builtin_ia32_pavgb256">,
1424
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
1425
                             llvm_v32i8_ty], [IntrNoMem, Commutative]>;
1426
  def int_x86_avx2_pavg_w : ClangBuiltin<"__builtin_ia32_pavgw256">,
1427
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1428
                             llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1429
  def int_x86_avx2_psad_bw : ClangBuiltin<"__builtin_ia32_psadbw256">,
1430
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v32i8_ty,
1431
                             llvm_v32i8_ty], [IntrNoMem, Commutative]>;
1432
}
1433
 
1434
// Integer shift ops.
1435
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1436
  def int_x86_avx2_psll_w : ClangBuiltin<"__builtin_ia32_psllw256">,
1437
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1438
                             llvm_v8i16_ty], [IntrNoMem]>;
1439
  def int_x86_avx2_psll_d : ClangBuiltin<"__builtin_ia32_pslld256">,
1440
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1441
                             llvm_v4i32_ty], [IntrNoMem]>;
1442
  def int_x86_avx2_psll_q : ClangBuiltin<"__builtin_ia32_psllq256">,
1443
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1444
                             llvm_v2i64_ty], [IntrNoMem]>;
1445
  def int_x86_avx2_psrl_w : ClangBuiltin<"__builtin_ia32_psrlw256">,
1446
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1447
                             llvm_v8i16_ty], [IntrNoMem]>;
1448
  def int_x86_avx2_psrl_d : ClangBuiltin<"__builtin_ia32_psrld256">,
1449
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1450
                             llvm_v4i32_ty], [IntrNoMem]>;
1451
  def int_x86_avx2_psrl_q : ClangBuiltin<"__builtin_ia32_psrlq256">,
1452
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1453
                             llvm_v2i64_ty], [IntrNoMem]>;
1454
  def int_x86_avx2_psra_w : ClangBuiltin<"__builtin_ia32_psraw256">,
1455
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1456
                             llvm_v8i16_ty], [IntrNoMem]>;
1457
  def int_x86_avx2_psra_d : ClangBuiltin<"__builtin_ia32_psrad256">,
1458
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1459
                             llvm_v4i32_ty], [IntrNoMem]>;
1460
 
1461
  // Oddly these don't require an immediate due to a gcc compatibility issue.
1462
  def int_x86_avx2_pslli_w : ClangBuiltin<"__builtin_ia32_psllwi256">,
1463
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1464
                             llvm_i32_ty], [IntrNoMem]>;
1465
  def int_x86_avx2_pslli_d : ClangBuiltin<"__builtin_ia32_pslldi256">,
1466
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1467
                             llvm_i32_ty], [IntrNoMem]>;
1468
  def int_x86_avx2_pslli_q : ClangBuiltin<"__builtin_ia32_psllqi256">,
1469
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1470
                             llvm_i32_ty], [IntrNoMem]>;
1471
  def int_x86_avx2_psrli_w : ClangBuiltin<"__builtin_ia32_psrlwi256">,
1472
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1473
                             llvm_i32_ty], [IntrNoMem]>;
1474
  def int_x86_avx2_psrli_d : ClangBuiltin<"__builtin_ia32_psrldi256">,
1475
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1476
                             llvm_i32_ty], [IntrNoMem]>;
1477
  def int_x86_avx2_psrli_q : ClangBuiltin<"__builtin_ia32_psrlqi256">,
1478
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1479
                             llvm_i32_ty], [IntrNoMem]>;
1480
  def int_x86_avx2_psrai_w : ClangBuiltin<"__builtin_ia32_psrawi256">,
1481
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1482
                             llvm_i32_ty], [IntrNoMem]>;
1483
  def int_x86_avx2_psrai_d : ClangBuiltin<"__builtin_ia32_psradi256">,
1484
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1485
                             llvm_i32_ty], [IntrNoMem]>;
1486
 
1487
  def int_x86_avx512_psra_q_128 : ClangBuiltin<"__builtin_ia32_psraq128">,
1488
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
1489
                             llvm_v2i64_ty], [IntrNoMem]>;
1490
  def int_x86_avx512_psra_q_256 : ClangBuiltin<"__builtin_ia32_psraq256">,
1491
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1492
                             llvm_v2i64_ty], [IntrNoMem]>;
1493
 
1494
  // Oddly these don't require an immediate due to a gcc compatibility issue.
1495
  def int_x86_avx512_psrai_q_128 : ClangBuiltin<"__builtin_ia32_psraqi128">,
1496
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
1497
                             llvm_i32_ty], [IntrNoMem]>;
1498
  def int_x86_avx512_psrai_q_256 : ClangBuiltin<"__builtin_ia32_psraqi256">,
1499
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1500
                             llvm_i32_ty], [IntrNoMem]>;
1501
 
1502
  def int_x86_avx512_psll_w_512 : ClangBuiltin<"__builtin_ia32_psllw512">,
1503
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1504
                             llvm_v8i16_ty], [IntrNoMem]>;
1505
  def int_x86_avx512_psll_d_512 : ClangBuiltin<"__builtin_ia32_pslld512">,
1506
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1507
                             llvm_v4i32_ty], [IntrNoMem]>;
1508
  def int_x86_avx512_psll_q_512 : ClangBuiltin<"__builtin_ia32_psllq512">,
1509
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1510
                             llvm_v2i64_ty], [IntrNoMem]>;
1511
  def int_x86_avx512_psrl_w_512 : ClangBuiltin<"__builtin_ia32_psrlw512">,
1512
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1513
                             llvm_v8i16_ty], [IntrNoMem]>;
1514
  def int_x86_avx512_psrl_d_512 : ClangBuiltin<"__builtin_ia32_psrld512">,
1515
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1516
                             llvm_v4i32_ty], [IntrNoMem]>;
1517
  def int_x86_avx512_psrl_q_512 : ClangBuiltin<"__builtin_ia32_psrlq512">,
1518
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1519
                             llvm_v2i64_ty], [IntrNoMem]>;
1520
  def int_x86_avx512_psra_w_512 : ClangBuiltin<"__builtin_ia32_psraw512">,
1521
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1522
                             llvm_v8i16_ty], [IntrNoMem]>;
1523
  def int_x86_avx512_psra_d_512 : ClangBuiltin<"__builtin_ia32_psrad512">,
1524
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1525
                             llvm_v4i32_ty], [IntrNoMem]>;
1526
  def int_x86_avx512_psra_q_512 : ClangBuiltin<"__builtin_ia32_psraq512">,
1527
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1528
                             llvm_v2i64_ty], [IntrNoMem]>;
1529
 
1530
  // Oddly these don't require an immediate due to a gcc compatibility issue.
1531
  def int_x86_avx512_pslli_w_512 : ClangBuiltin<"__builtin_ia32_psllwi512">,
1532
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1533
                             llvm_i32_ty], [IntrNoMem]>;
1534
  def int_x86_avx512_pslli_d_512 : ClangBuiltin<"__builtin_ia32_pslldi512">,
1535
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1536
                             llvm_i32_ty], [IntrNoMem]>;
1537
  def int_x86_avx512_pslli_q_512 : ClangBuiltin<"__builtin_ia32_psllqi512">,
1538
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1539
                             llvm_i32_ty], [IntrNoMem]>;
1540
  def int_x86_avx512_psrli_w_512 : ClangBuiltin<"__builtin_ia32_psrlwi512">,
1541
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1542
                             llvm_i32_ty], [IntrNoMem]>;
1543
  def int_x86_avx512_psrli_d_512 : ClangBuiltin<"__builtin_ia32_psrldi512">,
1544
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1545
                             llvm_i32_ty], [IntrNoMem]>;
1546
  def int_x86_avx512_psrli_q_512 : ClangBuiltin<"__builtin_ia32_psrlqi512">,
1547
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1548
                             llvm_i32_ty], [IntrNoMem]>;
1549
  def int_x86_avx512_psrai_w_512 : ClangBuiltin<"__builtin_ia32_psrawi512">,
1550
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1551
                             llvm_i32_ty], [IntrNoMem]>;
1552
  def int_x86_avx512_psrai_d_512 : ClangBuiltin<"__builtin_ia32_psradi512">,
1553
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1554
                             llvm_i32_ty], [IntrNoMem]>;
1555
  def int_x86_avx512_psrai_q_512 : ClangBuiltin<"__builtin_ia32_psraqi512">,
1556
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1557
                             llvm_i32_ty], [IntrNoMem]>;
1558
 
1559
  def int_x86_avx512_pmultishift_qb_128:
1560
        ClangBuiltin<"__builtin_ia32_vpmultishiftqb128">,
1561
        DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
1562
                              [IntrNoMem]>;
1563
  def int_x86_avx512_pmultishift_qb_256:
1564
        ClangBuiltin<"__builtin_ia32_vpmultishiftqb256">,
1565
        DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
1566
                              [IntrNoMem]>;
1567
  def int_x86_avx512_pmultishift_qb_512:
1568
        ClangBuiltin<"__builtin_ia32_vpmultishiftqb512">,
1569
        DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
1570
                              [IntrNoMem]>;
1571
}
1572
 
1573
// Pack ops.
1574
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1575
  def int_x86_avx2_packsswb : ClangBuiltin<"__builtin_ia32_packsswb256">,
1576
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
1577
                             llvm_v16i16_ty], [IntrNoMem]>;
1578
  def int_x86_avx2_packssdw : ClangBuiltin<"__builtin_ia32_packssdw256">,
1579
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
1580
                             llvm_v8i32_ty], [IntrNoMem]>;
1581
  def int_x86_avx2_packuswb : ClangBuiltin<"__builtin_ia32_packuswb256">,
1582
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
1583
                             llvm_v16i16_ty], [IntrNoMem]>;
1584
  def int_x86_avx2_packusdw : ClangBuiltin<"__builtin_ia32_packusdw256">,
1585
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
1586
                             llvm_v8i32_ty], [IntrNoMem]>;
1587
}
1588
 
1589
// Horizontal arithmetic ops
1590
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1591
  def int_x86_avx2_phadd_w : ClangBuiltin<"__builtin_ia32_phaddw256">,
1592
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1593
                             llvm_v16i16_ty], [IntrNoMem]>;
1594
  def int_x86_avx2_phadd_d : ClangBuiltin<"__builtin_ia32_phaddd256">,
1595
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1596
                             llvm_v8i32_ty], [IntrNoMem]>;
1597
  def int_x86_avx2_phadd_sw : ClangBuiltin<"__builtin_ia32_phaddsw256">,
1598
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1599
                             llvm_v16i16_ty], [IntrNoMem]>;
1600
  def int_x86_avx2_phsub_w : ClangBuiltin<"__builtin_ia32_phsubw256">,
1601
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1602
                             llvm_v16i16_ty], [IntrNoMem]>;
1603
  def int_x86_avx2_phsub_d : ClangBuiltin<"__builtin_ia32_phsubd256">,
1604
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1605
                             llvm_v8i32_ty], [IntrNoMem]>;
1606
  def int_x86_avx2_phsub_sw : ClangBuiltin<"__builtin_ia32_phsubsw256">,
1607
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1608
                             llvm_v16i16_ty], [IntrNoMem]>;
1609
  def int_x86_avx2_pmadd_ub_sw : ClangBuiltin<"__builtin_ia32_pmaddubsw256">,
1610
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty,
1611
                             llvm_v32i8_ty], [IntrNoMem]>;
1612
}
1613
 
1614
// Sign ops
1615
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1616
  def int_x86_avx2_psign_b : ClangBuiltin<"__builtin_ia32_psignb256">,
1617
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
1618
                             llvm_v32i8_ty], [IntrNoMem]>;
1619
  def int_x86_avx2_psign_w : ClangBuiltin<"__builtin_ia32_psignw256">,
1620
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1621
                             llvm_v16i16_ty], [IntrNoMem]>;
1622
  def int_x86_avx2_psign_d : ClangBuiltin<"__builtin_ia32_psignd256">,
1623
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1624
                             llvm_v8i32_ty], [IntrNoMem]>;
1625
}
1626
 
1627
// Packed multiply high with round and scale
1628
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1629
  def int_x86_avx2_pmul_hr_sw : ClangBuiltin<"__builtin_ia32_pmulhrsw256">,
1630
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1631
                             llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1632
  def int_x86_avx512_pmul_hr_sw_512 : ClangBuiltin<"__builtin_ia32_pmulhrsw512">,
1633
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1634
                             llvm_v32i16_ty], [IntrNoMem, Commutative]>;
1635
}
1636
 
1637
// Vector blend
1638
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1639
  def int_x86_avx2_pblendvb : ClangBuiltin<"__builtin_ia32_pblendvb256">,
1640
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
1641
                             llvm_v32i8_ty], [IntrNoMem]>;
1642
}
1643
 
1644
 
1645
// Vector permutation
1646
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1647
  def int_x86_avx2_permd : ClangBuiltin<"__builtin_ia32_permvarsi256">,
1648
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1649
                            [IntrNoMem]>;
1650
  def int_x86_avx2_permps : ClangBuiltin<"__builtin_ia32_permvarsf256">,
1651
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty],
1652
                            [IntrNoMem]>;
1653
}
1654
 
1655
// Conditional load ops
1656
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1657
  def int_x86_avx2_maskload_d : ClangBuiltin<"__builtin_ia32_maskloadd">,
1658
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
1659
                            [IntrReadMem, IntrArgMemOnly]>;
1660
  def int_x86_avx2_maskload_q : ClangBuiltin<"__builtin_ia32_maskloadq">,
1661
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
1662
                            [IntrReadMem, IntrArgMemOnly]>;
1663
  def int_x86_avx2_maskload_d_256 : ClangBuiltin<"__builtin_ia32_maskloadd256">,
1664
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
1665
                            [IntrReadMem, IntrArgMemOnly]>;
1666
  def int_x86_avx2_maskload_q_256 : ClangBuiltin<"__builtin_ia32_maskloadq256">,
1667
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
1668
                            [IntrReadMem, IntrArgMemOnly]>;
1669
}
1670
 
1671
// Conditional store ops
1672
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1673
  def int_x86_avx2_maskstore_d : ClangBuiltin<"__builtin_ia32_maskstored">,
1674
        Intrinsic<[], [llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1675
                  [IntrArgMemOnly]>;
1676
  def int_x86_avx2_maskstore_q : ClangBuiltin<"__builtin_ia32_maskstoreq">,
1677
        Intrinsic<[], [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty],
1678
                  [IntrArgMemOnly]>;
1679
  def int_x86_avx2_maskstore_d_256 :
1680
        ClangBuiltin<"__builtin_ia32_maskstored256">,
1681
        Intrinsic<[], [llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty],
1682
                  [IntrArgMemOnly]>;
1683
  def int_x86_avx2_maskstore_q_256 :
1684
        ClangBuiltin<"__builtin_ia32_maskstoreq256">,
1685
        Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty],
1686
                  [IntrArgMemOnly]>;
1687
}
1688
 
1689
// Variable bit shift ops
1690
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1691
  def int_x86_avx2_psllv_d : ClangBuiltin<"__builtin_ia32_psllv4si">,
1692
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
1693
                            [IntrNoMem]>;
1694
  def int_x86_avx2_psllv_d_256 : ClangBuiltin<"__builtin_ia32_psllv8si">,
1695
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1696
                            [IntrNoMem]>;
1697
  def int_x86_avx2_psllv_q : ClangBuiltin<"__builtin_ia32_psllv2di">,
1698
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
1699
                            [IntrNoMem]>;
1700
  def int_x86_avx2_psllv_q_256 : ClangBuiltin<"__builtin_ia32_psllv4di">,
1701
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1702
                            [IntrNoMem]>;
1703
 
1704
  def int_x86_avx512_psllv_d_512 : ClangBuiltin<"__builtin_ia32_psllv16si">,
1705
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
1706
                            [IntrNoMem]>;
1707
  def int_x86_avx512_psllv_q_512 : ClangBuiltin<"__builtin_ia32_psllv8di">,
1708
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
1709
                            [IntrNoMem]>;
1710
 
1711
  def int_x86_avx2_psrlv_d : ClangBuiltin<"__builtin_ia32_psrlv4si">,
1712
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
1713
                            [IntrNoMem]>;
1714
  def int_x86_avx2_psrlv_d_256 : ClangBuiltin<"__builtin_ia32_psrlv8si">,
1715
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1716
                            [IntrNoMem]>;
1717
  def int_x86_avx2_psrlv_q : ClangBuiltin<"__builtin_ia32_psrlv2di">,
1718
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
1719
                            [IntrNoMem]>;
1720
  def int_x86_avx2_psrlv_q_256 : ClangBuiltin<"__builtin_ia32_psrlv4di">,
1721
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1722
                            [IntrNoMem]>;
1723
 
1724
  def int_x86_avx512_psrlv_d_512 : ClangBuiltin<"__builtin_ia32_psrlv16si">,
1725
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
1726
                            [IntrNoMem]>;
1727
  def int_x86_avx512_psrlv_q_512 : ClangBuiltin<"__builtin_ia32_psrlv8di">,
1728
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
1729
                            [IntrNoMem]>;
1730
 
1731
  def int_x86_avx2_psrav_d : ClangBuiltin<"__builtin_ia32_psrav4si">,
1732
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
1733
                            [IntrNoMem]>;
1734
  def int_x86_avx2_psrav_d_256 : ClangBuiltin<"__builtin_ia32_psrav8si">,
1735
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1736
                            [IntrNoMem]>;
1737
 
1738
  def int_x86_avx512_psrav_d_512 : ClangBuiltin<"__builtin_ia32_psrav16si">,
1739
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
1740
                            [IntrNoMem]>;
1741
  def int_x86_avx512_psrav_q_128 : ClangBuiltin<"__builtin_ia32_psravq128">,
1742
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
1743
                            [IntrNoMem]>;
1744
  def int_x86_avx512_psrav_q_256 : ClangBuiltin<"__builtin_ia32_psravq256">,
1745
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1746
                            [IntrNoMem]>;
1747
  def int_x86_avx512_psrav_q_512 : ClangBuiltin<"__builtin_ia32_psrav8di">,
1748
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
1749
                            [IntrNoMem]>;
1750
 
1751
  def int_x86_avx512_psllv_w_128 : ClangBuiltin<"__builtin_ia32_psllv8hi">,
1752
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
1753
                            [IntrNoMem]>;
1754
  def int_x86_avx512_psllv_w_256 : ClangBuiltin<"__builtin_ia32_psllv16hi">,
1755
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
1756
                            [IntrNoMem]>;
1757
  def int_x86_avx512_psllv_w_512 : ClangBuiltin<"__builtin_ia32_psllv32hi">,
1758
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
1759
                            [IntrNoMem]>;
1760
 
1761
  def int_x86_avx512_psrlv_w_128 : ClangBuiltin<"__builtin_ia32_psrlv8hi">,
1762
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
1763
                            [IntrNoMem]>;
1764
  def int_x86_avx512_psrlv_w_256 : ClangBuiltin<"__builtin_ia32_psrlv16hi">,
1765
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
1766
                            [IntrNoMem]>;
1767
  def int_x86_avx512_psrlv_w_512 : ClangBuiltin<"__builtin_ia32_psrlv32hi">,
1768
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
1769
                            [IntrNoMem]>;
1770
 
1771
  def int_x86_avx512_psrav_w_128 : ClangBuiltin<"__builtin_ia32_psrav8hi">,
1772
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
1773
                            [IntrNoMem]>;
1774
  def int_x86_avx512_psrav_w_256 : ClangBuiltin<"__builtin_ia32_psrav16hi">,
1775
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
1776
                            [IntrNoMem]>;
1777
  def int_x86_avx512_psrav_w_512 : ClangBuiltin<"__builtin_ia32_psrav32hi">,
1778
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
1779
                            [IntrNoMem]>;
1780
}
1781
 
1782
// Gather ops
1783
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1784
  // NOTE: These can't be ArgMemOnly because you can put the address completely
1785
  // in the index register.
1786
  def int_x86_avx2_gather_d_pd : ClangBuiltin<"__builtin_ia32_gatherd_pd">,
1787
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
1788
        [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i8_ty],
1789
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1790
  def int_x86_avx2_gather_d_pd_256 : ClangBuiltin<"__builtin_ia32_gatherd_pd256">,
1791
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
1792
        [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i8_ty],
1793
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1794
  def int_x86_avx2_gather_q_pd : ClangBuiltin<"__builtin_ia32_gatherq_pd">,
1795
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
1796
        [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty],
1797
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1798
  def int_x86_avx2_gather_q_pd_256 : ClangBuiltin<"__builtin_ia32_gatherq_pd256">,
1799
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
1800
        [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty],
1801
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1802
  def int_x86_avx2_gather_d_ps : ClangBuiltin<"__builtin_ia32_gatherd_ps">,
1803
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
1804
        [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty],
1805
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1806
  def int_x86_avx2_gather_d_ps_256 : ClangBuiltin<"__builtin_ia32_gatherd_ps256">,
1807
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
1808
        [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty],
1809
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1810
  def int_x86_avx2_gather_q_ps : ClangBuiltin<"__builtin_ia32_gatherq_ps">,
1811
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
1812
        [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
1813
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1814
  def int_x86_avx2_gather_q_ps_256 : ClangBuiltin<"__builtin_ia32_gatherq_ps256">,
1815
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
1816
        [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i8_ty],
1817
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1818
 
1819
  def int_x86_avx2_gather_d_q : ClangBuiltin<"__builtin_ia32_gatherd_q">,
1820
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
1821
        [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i8_ty],
1822
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1823
  def int_x86_avx2_gather_d_q_256 : ClangBuiltin<"__builtin_ia32_gatherd_q256">,
1824
      DefaultAttrsIntrinsic<[llvm_v4i64_ty],
1825
        [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i8_ty],
1826
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1827
  def int_x86_avx2_gather_q_q : ClangBuiltin<"__builtin_ia32_gatherq_q">,
1828
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
1829
        [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
1830
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1831
  def int_x86_avx2_gather_q_q_256 : ClangBuiltin<"__builtin_ia32_gatherq_q256">,
1832
      DefaultAttrsIntrinsic<[llvm_v4i64_ty],
1833
        [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
1834
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1835
  def int_x86_avx2_gather_d_d : ClangBuiltin<"__builtin_ia32_gatherd_d">,
1836
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
1837
        [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
1838
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1839
  def int_x86_avx2_gather_d_d_256 : ClangBuiltin<"__builtin_ia32_gatherd_d256">,
1840
      DefaultAttrsIntrinsic<[llvm_v8i32_ty],
1841
        [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
1842
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1843
  def int_x86_avx2_gather_q_d : ClangBuiltin<"__builtin_ia32_gatherq_d">,
1844
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
1845
        [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
1846
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1847
  def int_x86_avx2_gather_q_d_256 : ClangBuiltin<"__builtin_ia32_gatherq_d256">,
1848
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
1849
        [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
1850
        [IntrReadMem, ImmArg<ArgIndex<4>>]>;
1851
}
1852
 
1853
// Misc.
1854
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1855
  def int_x86_avx2_pmovmskb : ClangBuiltin<"__builtin_ia32_pmovmskb256">,
1856
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v32i8_ty], [IntrNoMem]>;
1857
  def int_x86_avx2_pshuf_b : ClangBuiltin<"__builtin_ia32_pshufb256">,
1858
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
1859
                             llvm_v32i8_ty], [IntrNoMem]>;
1860
  def int_x86_avx2_mpsadbw : ClangBuiltin<"__builtin_ia32_mpsadbw256">,
1861
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
1862
                             llvm_i8_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
1863
}
1864
 
1865
//===----------------------------------------------------------------------===//
1866
// FMA3 and FMA4
1867
 
1868
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1869
  def int_x86_fma_vfmaddsub_ps : ClangBuiltin<"__builtin_ia32_vfmaddsubps">,
1870
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
1871
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
1872
                            [IntrNoMem]>;
1873
  def int_x86_fma_vfmaddsub_pd : ClangBuiltin<"__builtin_ia32_vfmaddsubpd">,
1874
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
1875
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
1876
                            [IntrNoMem]>;
1877
  def int_x86_fma_vfmaddsub_ps_256 :
1878
      ClangBuiltin<"__builtin_ia32_vfmaddsubps256">,
1879
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
1880
                            [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
1881
                            [IntrNoMem]>;
1882
  def int_x86_fma_vfmaddsub_pd_256 :
1883
      ClangBuiltin<"__builtin_ia32_vfmaddsubpd256">,
1884
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
1885
                            [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
1886
                            [IntrNoMem]>;
1887
 
1888
  def int_x86_avx512_vfmadd_pd_512 :
1889
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
1890
          [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty],
1891
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1892
 
1893
  def int_x86_avx512_vfmadd_ps_512 :
1894
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
1895
          [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty],
1896
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1897
 
1898
  def int_x86_avx512_vfmaddsub_pd_512 :
1899
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
1900
          [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty],
1901
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1902
 
1903
  def int_x86_avx512_vfmaddsub_ps_512 :
1904
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
1905
          [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty],
1906
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1907
 
1908
  def int_x86_avx512_vfmadd_f64 :
1909
      DefaultAttrsIntrinsic<[llvm_double_ty],
1910
          [llvm_double_ty, llvm_double_ty, llvm_double_ty, llvm_i32_ty],
1911
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1912
  def int_x86_avx512_vfmadd_f32 :
1913
      DefaultAttrsIntrinsic<[llvm_float_ty],
1914
          [llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_i32_ty],
1915
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
1916
 
1917
  def int_x86_avx512_vpmadd52h_uq_128 :
1918
      ClangBuiltin<"__builtin_ia32_vpmadd52huq128">,
1919
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
1920
                             llvm_v2i64_ty], [IntrNoMem]>;
1921
  def int_x86_avx512_vpmadd52l_uq_128 :
1922
      ClangBuiltin<"__builtin_ia32_vpmadd52luq128">,
1923
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
1924
                             llvm_v2i64_ty], [IntrNoMem]>;
1925
  def int_x86_avx512_vpmadd52h_uq_256 :
1926
      ClangBuiltin<"__builtin_ia32_vpmadd52huq256">,
1927
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
1928
                             llvm_v4i64_ty], [IntrNoMem]>;
1929
  def int_x86_avx512_vpmadd52l_uq_256 :
1930
      ClangBuiltin<"__builtin_ia32_vpmadd52luq256">,
1931
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
1932
                             llvm_v4i64_ty], [IntrNoMem]>;
1933
  def int_x86_avx512_vpmadd52h_uq_512 :
1934
      ClangBuiltin<"__builtin_ia32_vpmadd52huq512">,
1935
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
1936
                             llvm_v8i64_ty], [IntrNoMem]>;
1937
  def int_x86_avx512_vpmadd52l_uq_512 :
1938
      ClangBuiltin<"__builtin_ia32_vpmadd52luq512">,
1939
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
1940
                             llvm_v8i64_ty], [IntrNoMem]>;
1941
}
1942
 
1943
// VNNI
1944
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
1945
  def int_x86_avx512_vpdpbusd_128 :
1946
      ClangBuiltin<"__builtin_ia32_vpdpbusd128">,
1947
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1948
                             llvm_v4i32_ty], [IntrNoMem]>;
1949
  def int_x86_avx512_vpdpbusd_256 :
1950
      ClangBuiltin<"__builtin_ia32_vpdpbusd256">,
1951
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1952
                             llvm_v8i32_ty], [IntrNoMem]>;
1953
  def int_x86_avx512_vpdpbusd_512 :
1954
      ClangBuiltin<"__builtin_ia32_vpdpbusd512">,
1955
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1956
                             llvm_v16i32_ty], [IntrNoMem]>;
1957
 
1958
  def int_x86_avx512_vpdpbusds_128 :
1959
      ClangBuiltin<"__builtin_ia32_vpdpbusds128">,
1960
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1961
                             llvm_v4i32_ty], [IntrNoMem]>;
1962
  def int_x86_avx512_vpdpbusds_256 :
1963
      ClangBuiltin<"__builtin_ia32_vpdpbusds256">,
1964
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1965
                             llvm_v8i32_ty], [IntrNoMem]>;
1966
  def int_x86_avx512_vpdpbusds_512 :
1967
      ClangBuiltin<"__builtin_ia32_vpdpbusds512">,
1968
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1969
                             llvm_v16i32_ty], [IntrNoMem]>;
1970
 
1971
  def int_x86_avx512_vpdpwssd_128 :
1972
      ClangBuiltin<"__builtin_ia32_vpdpwssd128">,
1973
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1974
                             llvm_v4i32_ty], [IntrNoMem]>;
1975
  def int_x86_avx512_vpdpwssd_256 :
1976
      ClangBuiltin<"__builtin_ia32_vpdpwssd256">,
1977
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1978
                             llvm_v8i32_ty], [IntrNoMem]>;
1979
  def int_x86_avx512_vpdpwssd_512 :
1980
      ClangBuiltin<"__builtin_ia32_vpdpwssd512">,
1981
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1982
                             llvm_v16i32_ty], [IntrNoMem]>;
1983
 
1984
  def int_x86_avx512_vpdpwssds_128 :
1985
      ClangBuiltin<"__builtin_ia32_vpdpwssds128">,
1986
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1987
                             llvm_v4i32_ty], [IntrNoMem]>;
1988
  def int_x86_avx512_vpdpwssds_256 :
1989
      ClangBuiltin<"__builtin_ia32_vpdpwssds256">,
1990
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1991
                             llvm_v8i32_ty], [IntrNoMem]>;
1992
  def int_x86_avx512_vpdpwssds_512 :
1993
      ClangBuiltin<"__builtin_ia32_vpdpwssds512">,
1994
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1995
                             llvm_v16i32_ty], [IntrNoMem]>;
1996
  def int_x86_avx2_vpdpbssd_128
1997
      : ClangBuiltin<"__builtin_ia32_vpdpbssd128">,
1998
        DefaultAttrsIntrinsic<[llvm_v4i32_ty],
1999
                              [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2000
                              [IntrNoMem]>;
2001
  def int_x86_avx2_vpdpbssd_256
2002
      : ClangBuiltin<"__builtin_ia32_vpdpbssd256">,
2003
        DefaultAttrsIntrinsic<[llvm_v8i32_ty],
2004
                              [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
2005
                              [IntrNoMem]>;
2006
  def int_x86_avx2_vpdpbssds_128
2007
      : ClangBuiltin<"__builtin_ia32_vpdpbssds128">,
2008
        DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2009
                              [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2010
                              [IntrNoMem]>;
2011
  def int_x86_avx2_vpdpbssds_256
2012
      : ClangBuiltin<"__builtin_ia32_vpdpbssds256">,
2013
        DefaultAttrsIntrinsic<[llvm_v8i32_ty],
2014
                              [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
2015
                              [IntrNoMem]>;
2016
  def int_x86_avx2_vpdpbsud_128
2017
      : ClangBuiltin<"__builtin_ia32_vpdpbsud128">,
2018
        DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2019
                              [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2020
                              [IntrNoMem]>;
2021
  def int_x86_avx2_vpdpbsud_256
2022
      : ClangBuiltin<"__builtin_ia32_vpdpbsud256">,
2023
        DefaultAttrsIntrinsic<[llvm_v8i32_ty],
2024
                              [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
2025
                              [IntrNoMem]>;
2026
  def int_x86_avx2_vpdpbsuds_128
2027
      : ClangBuiltin<"__builtin_ia32_vpdpbsuds128">,
2028
        DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2029
                              [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2030
                              [IntrNoMem]>;
2031
  def int_x86_avx2_vpdpbsuds_256
2032
      : ClangBuiltin<"__builtin_ia32_vpdpbsuds256">,
2033
        DefaultAttrsIntrinsic<[llvm_v8i32_ty],
2034
                              [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
2035
                              [IntrNoMem]>;
2036
  def int_x86_avx2_vpdpbuud_128
2037
      : ClangBuiltin<"__builtin_ia32_vpdpbuud128">,
2038
        DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2039
                              [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2040
                              [IntrNoMem]>;
2041
  def int_x86_avx2_vpdpbuud_256
2042
      : ClangBuiltin<"__builtin_ia32_vpdpbuud256">,
2043
        DefaultAttrsIntrinsic<[llvm_v8i32_ty],
2044
                              [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
2045
                              [IntrNoMem]>;
2046
  def int_x86_avx2_vpdpbuuds_128
2047
      : ClangBuiltin<"__builtin_ia32_vpdpbuuds128">,
2048
        DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2049
                              [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2050
                              [IntrNoMem]>;
2051
  def int_x86_avx2_vpdpbuuds_256
2052
      : ClangBuiltin<"__builtin_ia32_vpdpbuuds256">,
2053
        DefaultAttrsIntrinsic<[llvm_v8i32_ty],
2054
                              [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty],
2055
                              [IntrNoMem]>;
2056
}
2057
 
2058
//===----------------------------------------------------------------------===//
2059
// XOP
2060
 
2061
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2062
  def int_x86_xop_vpermil2pd : ClangBuiltin<"__builtin_ia32_vpermil2pd">,
2063
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
2064
                                              llvm_v2i64_ty, llvm_i8_ty],
2065
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2066
 
2067
  def int_x86_xop_vpermil2pd_256 :
2068
      ClangBuiltin<"__builtin_ia32_vpermil2pd256">,
2069
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
2070
                                              llvm_v4i64_ty, llvm_i8_ty],
2071
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2072
 
2073
  def int_x86_xop_vpermil2ps : ClangBuiltin<"__builtin_ia32_vpermil2ps">,
2074
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
2075
                                              llvm_v4i32_ty, llvm_i8_ty],
2076
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2077
  def int_x86_xop_vpermil2ps_256 :
2078
      ClangBuiltin<"__builtin_ia32_vpermil2ps256">,
2079
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
2080
                                              llvm_v8i32_ty, llvm_i8_ty],
2081
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2082
 
2083
  def int_x86_xop_vfrcz_pd : ClangBuiltin<"__builtin_ia32_vfrczpd">,
2084
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
2085
  def int_x86_xop_vfrcz_ps : ClangBuiltin<"__builtin_ia32_vfrczps">,
2086
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
2087
  def int_x86_xop_vfrcz_sd : ClangBuiltin<"__builtin_ia32_vfrczsd">,
2088
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
2089
  def int_x86_xop_vfrcz_ss : ClangBuiltin<"__builtin_ia32_vfrczss">,
2090
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
2091
  def int_x86_xop_vfrcz_pd_256 : ClangBuiltin<"__builtin_ia32_vfrczpd256">,
2092
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>;
2093
  def int_x86_xop_vfrcz_ps_256 : ClangBuiltin<"__builtin_ia32_vfrczps256">,
2094
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
2095
 
2096
  def int_x86_xop_vphaddbd :
2097
      ClangBuiltin<"__builtin_ia32_vphaddbd">,
2098
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
2099
  def int_x86_xop_vphaddbq :
2100
      ClangBuiltin<"__builtin_ia32_vphaddbq">,
2101
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
2102
  def int_x86_xop_vphaddbw :
2103
      ClangBuiltin<"__builtin_ia32_vphaddbw">,
2104
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
2105
  def int_x86_xop_vphadddq :
2106
      ClangBuiltin<"__builtin_ia32_vphadddq">,
2107
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
2108
  def int_x86_xop_vphaddubd :
2109
      ClangBuiltin<"__builtin_ia32_vphaddubd">,
2110
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
2111
  def int_x86_xop_vphaddubq :
2112
      ClangBuiltin<"__builtin_ia32_vphaddubq">,
2113
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
2114
  def int_x86_xop_vphaddubw :
2115
      ClangBuiltin<"__builtin_ia32_vphaddubw">,
2116
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
2117
  def int_x86_xop_vphaddudq :
2118
      ClangBuiltin<"__builtin_ia32_vphaddudq">,
2119
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
2120
  def int_x86_xop_vphadduwd :
2121
      ClangBuiltin<"__builtin_ia32_vphadduwd">,
2122
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
2123
  def int_x86_xop_vphadduwq :
2124
      ClangBuiltin<"__builtin_ia32_vphadduwq">,
2125
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
2126
  def int_x86_xop_vphaddwd :
2127
      ClangBuiltin<"__builtin_ia32_vphaddwd">,
2128
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
2129
  def int_x86_xop_vphaddwq :
2130
      ClangBuiltin<"__builtin_ia32_vphaddwq">,
2131
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
2132
  def int_x86_xop_vphsubbw :
2133
      ClangBuiltin<"__builtin_ia32_vphsubbw">,
2134
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
2135
  def int_x86_xop_vphsubdq :
2136
      ClangBuiltin<"__builtin_ia32_vphsubdq">,
2137
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
2138
  def int_x86_xop_vphsubwd :
2139
      ClangBuiltin<"__builtin_ia32_vphsubwd">,
2140
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
2141
  def int_x86_xop_vpmacsdd :
2142
      ClangBuiltin<"__builtin_ia32_vpmacsdd">,
2143
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2144
                            [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2145
                            [IntrNoMem, Commutative]>;
2146
  def int_x86_xop_vpmacsdqh :
2147
      ClangBuiltin<"__builtin_ia32_vpmacsdqh">,
2148
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
2149
                            [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
2150
                            [IntrNoMem, Commutative]>;
2151
  def int_x86_xop_vpmacsdql :
2152
      ClangBuiltin<"__builtin_ia32_vpmacsdql">,
2153
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
2154
                            [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
2155
                            [IntrNoMem, Commutative]>;
2156
  def int_x86_xop_vpmacssdd :
2157
      ClangBuiltin<"__builtin_ia32_vpmacssdd">,
2158
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2159
                            [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2160
                            [IntrNoMem, Commutative]>;
2161
  def int_x86_xop_vpmacssdqh :
2162
      ClangBuiltin<"__builtin_ia32_vpmacssdqh">,
2163
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
2164
                            [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
2165
                            [IntrNoMem, Commutative]>;
2166
  def int_x86_xop_vpmacssdql :
2167
      ClangBuiltin<"__builtin_ia32_vpmacssdql">,
2168
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
2169
                            [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
2170
                            [IntrNoMem, Commutative]>;
2171
  def int_x86_xop_vpmacsswd :
2172
      ClangBuiltin<"__builtin_ia32_vpmacsswd">,
2173
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2174
                            [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2175
                            [IntrNoMem, Commutative]>;
2176
  def int_x86_xop_vpmacssww :
2177
      ClangBuiltin<"__builtin_ia32_vpmacssww">,
2178
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
2179
                            [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
2180
                            [IntrNoMem, Commutative]>;
2181
  def int_x86_xop_vpmacswd :
2182
      ClangBuiltin<"__builtin_ia32_vpmacswd">,
2183
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2184
                            [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2185
                            [IntrNoMem, Commutative]>;
2186
  def int_x86_xop_vpmacsww :
2187
      ClangBuiltin<"__builtin_ia32_vpmacsww">,
2188
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
2189
                            [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
2190
                            [IntrNoMem, Commutative]>;
2191
  def int_x86_xop_vpmadcsswd :
2192
      ClangBuiltin<"__builtin_ia32_vpmadcsswd">,
2193
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2194
                            [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2195
                            [IntrNoMem, Commutative]>;
2196
  def int_x86_xop_vpmadcswd :
2197
      ClangBuiltin<"__builtin_ia32_vpmadcswd">,
2198
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2199
                            [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2200
                            [IntrNoMem, Commutative]>;
2201
  def int_x86_xop_vpperm :
2202
      ClangBuiltin<"__builtin_ia32_vpperm">,
2203
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
2204
                            [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
2205
                            [IntrNoMem]>;
2206
  def int_x86_xop_vpshab :
2207
      ClangBuiltin<"__builtin_ia32_vpshab">,
2208
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
2209
                            [IntrNoMem]>;
2210
  def int_x86_xop_vpshad :
2211
      ClangBuiltin<"__builtin_ia32_vpshad">,
2212
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
2213
                            [IntrNoMem]>;
2214
  def int_x86_xop_vpshaq :
2215
      ClangBuiltin<"__builtin_ia32_vpshaq">,
2216
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
2217
                            [IntrNoMem]>;
2218
  def int_x86_xop_vpshaw :
2219
      ClangBuiltin<"__builtin_ia32_vpshaw">,
2220
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
2221
                            [IntrNoMem]>;
2222
  def int_x86_xop_vpshlb :
2223
      ClangBuiltin<"__builtin_ia32_vpshlb">,
2224
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
2225
                            [IntrNoMem]>;
2226
  def int_x86_xop_vpshld :
2227
      ClangBuiltin<"__builtin_ia32_vpshld">,
2228
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
2229
                            [IntrNoMem]>;
2230
  def int_x86_xop_vpshlq :
2231
      ClangBuiltin<"__builtin_ia32_vpshlq">,
2232
      DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
2233
                            [IntrNoMem]>;
2234
  def int_x86_xop_vpshlw :
2235
      ClangBuiltin<"__builtin_ia32_vpshlw">,
2236
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
2237
                            [IntrNoMem]>;
2238
}
2239
 
2240
//===----------------------------------------------------------------------===//
2241
// LWP
2242
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2243
  def int_x86_llwpcb :
2244
              ClangBuiltin<"__builtin_ia32_llwpcb">,
2245
              Intrinsic<[], [llvm_ptr_ty], []>;
2246
  def int_x86_slwpcb :
2247
              ClangBuiltin<"__builtin_ia32_slwpcb">,
2248
              Intrinsic<[llvm_ptr_ty], [], []>;
2249
  def int_x86_lwpins32 :
2250
              ClangBuiltin<"__builtin_ia32_lwpins32">,
2251
              Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2252
                        [ImmArg<ArgIndex<2>>]>;
2253
  def int_x86_lwpins64 :
2254
              ClangBuiltin<"__builtin_ia32_lwpins64">,
2255
              Intrinsic<[llvm_i8_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
2256
                        [ImmArg<ArgIndex<2>>]>;
2257
  def int_x86_lwpval32 :
2258
              ClangBuiltin<"__builtin_ia32_lwpval32">,
2259
              Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2260
                        [ImmArg<ArgIndex<2>>]>;
2261
  def int_x86_lwpval64 :
2262
              ClangBuiltin<"__builtin_ia32_lwpval64">,
2263
              Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
2264
                        [ImmArg<ArgIndex<2>>]>;
2265
}
2266
 
2267
//===----------------------------------------------------------------------===//
2268
// MMX
2269
 
2270
// Empty MMX state op.
2271
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2272
  def int_x86_mmx_emms  : ClangBuiltin<"__builtin_ia32_emms">,
2273
              Intrinsic<[], [], []>;
2274
  def int_x86_mmx_femms : ClangBuiltin<"__builtin_ia32_femms">,
2275
              Intrinsic<[], [], []>;
2276
}
2277
 
2278
// Integer arithmetic ops.
2279
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2280
  // Addition
2281
  def int_x86_mmx_padd_b : ClangBuiltin<"__builtin_ia32_paddb">,
2282
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2283
                            [IntrNoMem, Commutative]>;
2284
  def int_x86_mmx_padd_w : ClangBuiltin<"__builtin_ia32_paddw">,
2285
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2286
                            [IntrNoMem, Commutative]>;
2287
  def int_x86_mmx_padd_d : ClangBuiltin<"__builtin_ia32_paddd">,
2288
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2289
                            [IntrNoMem, Commutative]>;
2290
  def int_x86_mmx_padd_q : ClangBuiltin<"__builtin_ia32_paddq">,
2291
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2292
                            [IntrNoMem, Commutative]>;
2293
 
2294
  def int_x86_mmx_padds_b : ClangBuiltin<"__builtin_ia32_paddsb">,
2295
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2296
                            [IntrNoMem, Commutative]>;
2297
  def int_x86_mmx_padds_w : ClangBuiltin<"__builtin_ia32_paddsw">,
2298
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2299
                            [IntrNoMem, Commutative]>;
2300
 
2301
  def int_x86_mmx_paddus_b : ClangBuiltin<"__builtin_ia32_paddusb">,
2302
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2303
                            [IntrNoMem, Commutative]>;
2304
  def int_x86_mmx_paddus_w : ClangBuiltin<"__builtin_ia32_paddusw">,
2305
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2306
                            [IntrNoMem, Commutative]>;
2307
 
2308
  // Subtraction
2309
  def int_x86_mmx_psub_b : ClangBuiltin<"__builtin_ia32_psubb">,
2310
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2311
                            [IntrNoMem]>;
2312
  def int_x86_mmx_psub_w : ClangBuiltin<"__builtin_ia32_psubw">,
2313
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2314
                            [IntrNoMem]>;
2315
  def int_x86_mmx_psub_d : ClangBuiltin<"__builtin_ia32_psubd">,
2316
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2317
                            [IntrNoMem]>;
2318
  def int_x86_mmx_psub_q : ClangBuiltin<"__builtin_ia32_psubq">,
2319
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2320
                            [IntrNoMem]>;
2321
 
2322
  def int_x86_mmx_psubs_b : ClangBuiltin<"__builtin_ia32_psubsb">,
2323
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2324
                            [IntrNoMem]>;
2325
  def int_x86_mmx_psubs_w : ClangBuiltin<"__builtin_ia32_psubsw">,
2326
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2327
                            [IntrNoMem]>;
2328
 
2329
  def int_x86_mmx_psubus_b : ClangBuiltin<"__builtin_ia32_psubusb">,
2330
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2331
                            [IntrNoMem]>;
2332
  def int_x86_mmx_psubus_w : ClangBuiltin<"__builtin_ia32_psubusw">,
2333
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2334
                            [IntrNoMem]>;
2335
 
2336
  // Multiplication
2337
  def int_x86_mmx_pmulh_w : ClangBuiltin<"__builtin_ia32_pmulhw">,
2338
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2339
                            [IntrNoMem, Commutative]>;
2340
  def int_x86_mmx_pmull_w : ClangBuiltin<"__builtin_ia32_pmullw">,
2341
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2342
                            [IntrNoMem, Commutative]>;
2343
  def int_x86_mmx_pmulhu_w : ClangBuiltin<"__builtin_ia32_pmulhuw">,
2344
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2345
                            [IntrNoMem, Commutative]>;
2346
  def int_x86_mmx_pmulu_dq : ClangBuiltin<"__builtin_ia32_pmuludq">,
2347
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2348
                            [IntrNoMem, Commutative]>;
2349
  def int_x86_mmx_pmadd_wd : ClangBuiltin<"__builtin_ia32_pmaddwd">,
2350
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2351
                            [IntrNoMem, Commutative]>;
2352
 
2353
  // Bitwise operations
2354
  def int_x86_mmx_pand : ClangBuiltin<"__builtin_ia32_pand">,
2355
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2356
                            [IntrNoMem, Commutative]>;
2357
  def int_x86_mmx_pandn : ClangBuiltin<"__builtin_ia32_pandn">,
2358
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2359
                            [IntrNoMem]>;
2360
  def int_x86_mmx_por : ClangBuiltin<"__builtin_ia32_por">,
2361
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2362
                            [IntrNoMem, Commutative]>;
2363
  def int_x86_mmx_pxor : ClangBuiltin<"__builtin_ia32_pxor">,
2364
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2365
                            [IntrNoMem, Commutative]>;
2366
 
2367
  // Averages
2368
  def int_x86_mmx_pavg_b : ClangBuiltin<"__builtin_ia32_pavgb">,
2369
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2370
                            [IntrNoMem, Commutative]>;
2371
  def int_x86_mmx_pavg_w : ClangBuiltin<"__builtin_ia32_pavgw">,
2372
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2373
                            [IntrNoMem, Commutative]>;
2374
 
2375
  // Maximum
2376
  def int_x86_mmx_pmaxu_b : ClangBuiltin<"__builtin_ia32_pmaxub">,
2377
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2378
                            [IntrNoMem, Commutative]>;
2379
  def int_x86_mmx_pmaxs_w : ClangBuiltin<"__builtin_ia32_pmaxsw">,
2380
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2381
                            [IntrNoMem, Commutative]>;
2382
 
2383
  // Minimum
2384
  def int_x86_mmx_pminu_b : ClangBuiltin<"__builtin_ia32_pminub">,
2385
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2386
                            [IntrNoMem, Commutative]>;
2387
  def int_x86_mmx_pmins_w : ClangBuiltin<"__builtin_ia32_pminsw">,
2388
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2389
                            [IntrNoMem, Commutative]>;
2390
 
2391
  // Packed sum of absolute differences
2392
  def int_x86_mmx_psad_bw : ClangBuiltin<"__builtin_ia32_psadbw">,
2393
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2394
                            [IntrNoMem, Commutative]>;
2395
}
2396
 
2397
// Integer shift ops.
2398
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2399
  // Shift left logical
2400
  def int_x86_mmx_psll_w : ClangBuiltin<"__builtin_ia32_psllw">,
2401
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2402
                            [IntrNoMem]>;
2403
  def int_x86_mmx_psll_d : ClangBuiltin<"__builtin_ia32_pslld">,
2404
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2405
                            [IntrNoMem]>;
2406
  def int_x86_mmx_psll_q : ClangBuiltin<"__builtin_ia32_psllq">,
2407
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2408
                            [IntrNoMem]>;
2409
 
2410
  def int_x86_mmx_psrl_w : ClangBuiltin<"__builtin_ia32_psrlw">,
2411
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2412
                            [IntrNoMem]>;
2413
  def int_x86_mmx_psrl_d : ClangBuiltin<"__builtin_ia32_psrld">,
2414
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2415
                            [IntrNoMem]>;
2416
  def int_x86_mmx_psrl_q : ClangBuiltin<"__builtin_ia32_psrlq">,
2417
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2418
                            [IntrNoMem]>;
2419
 
2420
  def int_x86_mmx_psra_w : ClangBuiltin<"__builtin_ia32_psraw">,
2421
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2422
                            [IntrNoMem]>;
2423
  def int_x86_mmx_psra_d : ClangBuiltin<"__builtin_ia32_psrad">,
2424
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2425
                            [IntrNoMem]>;
2426
 
2427
  // Oddly these don't require an immediate due to a gcc compatibility issue.
2428
  def int_x86_mmx_pslli_w : ClangBuiltin<"__builtin_ia32_psllwi">,
2429
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2430
                            [IntrNoMem]>;
2431
  def int_x86_mmx_pslli_d : ClangBuiltin<"__builtin_ia32_pslldi">,
2432
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2433
                            [IntrNoMem]>;
2434
  def int_x86_mmx_pslli_q : ClangBuiltin<"__builtin_ia32_psllqi">,
2435
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2436
                            [IntrNoMem]>;
2437
 
2438
  def int_x86_mmx_psrli_w : ClangBuiltin<"__builtin_ia32_psrlwi">,
2439
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2440
                            [IntrNoMem]>;
2441
  def int_x86_mmx_psrli_d : ClangBuiltin<"__builtin_ia32_psrldi">,
2442
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2443
                            [IntrNoMem]>;
2444
  def int_x86_mmx_psrli_q : ClangBuiltin<"__builtin_ia32_psrlqi">,
2445
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2446
                            [IntrNoMem]>;
2447
 
2448
  def int_x86_mmx_psrai_w : ClangBuiltin<"__builtin_ia32_psrawi">,
2449
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2450
                            [IntrNoMem]>;
2451
  def int_x86_mmx_psrai_d : ClangBuiltin<"__builtin_ia32_psradi">,
2452
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2453
                            [IntrNoMem]>;
2454
}
2455
// Permute
2456
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2457
  def int_x86_avx512_permvar_df_256 : ClangBuiltin<"__builtin_ia32_permvardf256">,
2458
      DefaultAttrsIntrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty],
2459
                            [IntrNoMem]>;
2460
  def int_x86_avx512_permvar_df_512 : ClangBuiltin<"__builtin_ia32_permvardf512">,
2461
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8i64_ty],
2462
                            [IntrNoMem]>;
2463
  def int_x86_avx512_permvar_di_256 : ClangBuiltin<"__builtin_ia32_permvardi256">,
2464
      DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
2465
                            [IntrNoMem]>;
2466
  def int_x86_avx512_permvar_di_512 : ClangBuiltin<"__builtin_ia32_permvardi512">,
2467
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
2468
                            [IntrNoMem]>;
2469
  def int_x86_avx512_permvar_hi_128 : ClangBuiltin<"__builtin_ia32_permvarhi128">,
2470
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
2471
                            [IntrNoMem]>;
2472
  def int_x86_avx512_permvar_hi_256 : ClangBuiltin<"__builtin_ia32_permvarhi256">,
2473
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
2474
                            [IntrNoMem]>;
2475
  def int_x86_avx512_permvar_hi_512 : ClangBuiltin<"__builtin_ia32_permvarhi512">,
2476
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
2477
                            [IntrNoMem]>;
2478
  def int_x86_avx512_permvar_qi_128 : ClangBuiltin<"__builtin_ia32_permvarqi128">,
2479
      DefaultAttrsIntrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
2480
                            [IntrNoMem]>;
2481
  def int_x86_avx512_permvar_qi_256 : ClangBuiltin<"__builtin_ia32_permvarqi256">,
2482
      DefaultAttrsIntrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty],
2483
                            [IntrNoMem]>;
2484
  def int_x86_avx512_permvar_qi_512 : ClangBuiltin<"__builtin_ia32_permvarqi512">,
2485
      DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
2486
                            [IntrNoMem]>;
2487
  def int_x86_avx512_permvar_sf_512 : ClangBuiltin<"__builtin_ia32_permvarsf512">,
2488
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16i32_ty],
2489
                            [IntrNoMem]>;
2490
  def int_x86_avx512_permvar_si_512 : ClangBuiltin<"__builtin_ia32_permvarsi512">,
2491
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
2492
                            [IntrNoMem]>;
2493
}
2494
// Pack ops.
2495
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2496
  def int_x86_mmx_packsswb : ClangBuiltin<"__builtin_ia32_packsswb">,
2497
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2498
                            [IntrNoMem]>;
2499
  def int_x86_mmx_packssdw : ClangBuiltin<"__builtin_ia32_packssdw">,
2500
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2501
                            [IntrNoMem]>;
2502
  def int_x86_mmx_packuswb : ClangBuiltin<"__builtin_ia32_packuswb">,
2503
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2504
                            [IntrNoMem]>;
2505
}
2506
 
2507
// Unpacking ops.
2508
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2509
  def int_x86_mmx_punpckhbw : ClangBuiltin<"__builtin_ia32_punpckhbw">,
2510
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2511
                            [IntrNoMem]>;
2512
  def int_x86_mmx_punpckhwd : ClangBuiltin<"__builtin_ia32_punpckhwd">,
2513
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2514
                            [IntrNoMem]>;
2515
  def int_x86_mmx_punpckhdq : ClangBuiltin<"__builtin_ia32_punpckhdq">,
2516
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2517
                            [IntrNoMem]>;
2518
  def int_x86_mmx_punpcklbw : ClangBuiltin<"__builtin_ia32_punpcklbw">,
2519
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2520
                            [IntrNoMem]>;
2521
  def int_x86_mmx_punpcklwd : ClangBuiltin<"__builtin_ia32_punpcklwd">,
2522
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2523
                            [IntrNoMem]>;
2524
  def int_x86_mmx_punpckldq : ClangBuiltin<"__builtin_ia32_punpckldq">,
2525
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2526
                            [IntrNoMem]>;
2527
}
2528
 
2529
// Integer comparison ops
2530
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2531
  def int_x86_mmx_pcmpeq_b : ClangBuiltin<"__builtin_ia32_pcmpeqb">,
2532
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2533
                            [IntrNoMem, Commutative]>;
2534
  def int_x86_mmx_pcmpeq_w : ClangBuiltin<"__builtin_ia32_pcmpeqw">,
2535
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2536
                            [IntrNoMem, Commutative]>;
2537
  def int_x86_mmx_pcmpeq_d : ClangBuiltin<"__builtin_ia32_pcmpeqd">,
2538
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2539
                            [IntrNoMem, Commutative]>;
2540
 
2541
  def int_x86_mmx_pcmpgt_b : ClangBuiltin<"__builtin_ia32_pcmpgtb">,
2542
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2543
                            [IntrNoMem]>;
2544
  def int_x86_mmx_pcmpgt_w : ClangBuiltin<"__builtin_ia32_pcmpgtw">,
2545
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2546
                            [IntrNoMem]>;
2547
  def int_x86_mmx_pcmpgt_d : ClangBuiltin<"__builtin_ia32_pcmpgtd">,
2548
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2549
                            [IntrNoMem]>;
2550
}
2551
 
2552
// Misc.
2553
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2554
  def int_x86_mmx_maskmovq : ClangBuiltin<"__builtin_ia32_maskmovq">,
2555
              Intrinsic<[], [llvm_x86mmx_ty, llvm_x86mmx_ty, llvm_ptr_ty], []>;
2556
 
2557
  def int_x86_mmx_pmovmskb : ClangBuiltin<"__builtin_ia32_pmovmskb">,
2558
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
2559
 
2560
  def int_x86_mmx_movnt_dq : ClangBuiltin<"__builtin_ia32_movntq">,
2561
              Intrinsic<[], [llvm_ptrx86mmx_ty, llvm_x86mmx_ty], []>;
2562
 
2563
  def int_x86_mmx_palignr_b : ClangBuiltin<"__builtin_ia32_palignr">,
2564
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty],
2565
                            [llvm_x86mmx_ty, llvm_x86mmx_ty, llvm_i8_ty],
2566
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2567
 
2568
  def int_x86_mmx_pextr_w : ClangBuiltin<"__builtin_ia32_vec_ext_v4hi">,
2569
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2570
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2571
 
2572
  def int_x86_mmx_pinsr_w : ClangBuiltin<"__builtin_ia32_vec_set_v4hi">,
2573
      DefaultAttrsIntrinsic<[llvm_x86mmx_ty],
2574
                            [llvm_x86mmx_ty, llvm_i32_ty, llvm_i32_ty],
2575
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2576
}
2577
 
2578
//===----------------------------------------------------------------------===//
2579
// BMI
2580
 
2581
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2582
  def int_x86_bmi_bextr_32 : ClangBuiltin<"__builtin_ia32_bextr_u32">,
2583
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
2584
                            [IntrNoMem]>;
2585
  def int_x86_bmi_bextr_64 : ClangBuiltin<"__builtin_ia32_bextr_u64">,
2586
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
2587
                            [IntrNoMem]>;
2588
  def int_x86_bmi_bzhi_32 : ClangBuiltin<"__builtin_ia32_bzhi_si">,
2589
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
2590
                            [IntrNoMem]>;
2591
  def int_x86_bmi_bzhi_64 : ClangBuiltin<"__builtin_ia32_bzhi_di">,
2592
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
2593
                            [IntrNoMem]>;
2594
  def int_x86_bmi_pdep_32 : ClangBuiltin<"__builtin_ia32_pdep_si">,
2595
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
2596
                            [IntrNoMem]>;
2597
  def int_x86_bmi_pdep_64 : ClangBuiltin<"__builtin_ia32_pdep_di">,
2598
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
2599
                            [IntrNoMem]>;
2600
  def int_x86_bmi_pext_32 : ClangBuiltin<"__builtin_ia32_pext_si">,
2601
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
2602
                            [IntrNoMem]>;
2603
  def int_x86_bmi_pext_64 : ClangBuiltin<"__builtin_ia32_pext_di">,
2604
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
2605
                            [IntrNoMem]>;
2606
}
2607
 
2608
//===----------------------------------------------------------------------===//
2609
// FS/GS Base
2610
 
2611
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2612
  def int_x86_rdfsbase_32 : ClangBuiltin<"__builtin_ia32_rdfsbase32">,
2613
              Intrinsic<[llvm_i32_ty], []>;
2614
  def int_x86_rdgsbase_32 : ClangBuiltin<"__builtin_ia32_rdgsbase32">,
2615
              Intrinsic<[llvm_i32_ty], []>;
2616
  def int_x86_rdfsbase_64 : ClangBuiltin<"__builtin_ia32_rdfsbase64">,
2617
              Intrinsic<[llvm_i64_ty], []>;
2618
  def int_x86_rdgsbase_64 : ClangBuiltin<"__builtin_ia32_rdgsbase64">,
2619
              Intrinsic<[llvm_i64_ty], []>;
2620
  def int_x86_wrfsbase_32 : ClangBuiltin<"__builtin_ia32_wrfsbase32">,
2621
              Intrinsic<[], [llvm_i32_ty]>;
2622
  def int_x86_wrgsbase_32 : ClangBuiltin<"__builtin_ia32_wrgsbase32">,
2623
              Intrinsic<[], [llvm_i32_ty]>;
2624
  def int_x86_wrfsbase_64 : ClangBuiltin<"__builtin_ia32_wrfsbase64">,
2625
              Intrinsic<[], [llvm_i64_ty]>;
2626
  def int_x86_wrgsbase_64 : ClangBuiltin<"__builtin_ia32_wrgsbase64">,
2627
              Intrinsic<[], [llvm_i64_ty]>;
2628
}
2629
 
2630
//===----------------------------------------------------------------------===//
2631
// FXSR
2632
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2633
  def int_x86_fxrstor : ClangBuiltin<"__builtin_ia32_fxrstor">,
2634
              Intrinsic<[], [llvm_ptr_ty], []>;
2635
  def int_x86_fxrstor64 : ClangBuiltin<"__builtin_ia32_fxrstor64">,
2636
              Intrinsic<[], [llvm_ptr_ty], []>;
2637
  def int_x86_fxsave : ClangBuiltin<"__builtin_ia32_fxsave">,
2638
              Intrinsic<[], [llvm_ptr_ty], []>;
2639
  def int_x86_fxsave64 : ClangBuiltin<"__builtin_ia32_fxsave64">,
2640
              Intrinsic<[], [llvm_ptr_ty], []>;
2641
}
2642
 
2643
//===----------------------------------------------------------------------===//
2644
// XSAVE
2645
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2646
  def int_x86_xsave :
2647
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2648
  def int_x86_xsave64 :
2649
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2650
  def int_x86_xrstor :
2651
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2652
  def int_x86_xrstor64 :
2653
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2654
  def int_x86_xsaveopt :
2655
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2656
  def int_x86_xsaveopt64 :
2657
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2658
  def int_x86_xrstors :
2659
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2660
  def int_x86_xrstors64 :
2661
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2662
  def int_x86_xsavec :
2663
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2664
  def int_x86_xsavec64 :
2665
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2666
  def int_x86_xsaves :
2667
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2668
  def int_x86_xsaves64 :
2669
              Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2670
  def int_x86_xgetbv :
2671
              Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
2672
  def int_x86_xsetbv :
2673
              Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
2674
}
2675
 
2676
//===----------------------------------------------------------------------===//
2677
// CLFLUSHOPT and CLWB
2678
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2679
  def int_x86_clflushopt : ClangBuiltin<"__builtin_ia32_clflushopt">,
2680
              Intrinsic<[], [llvm_ptr_ty], []>;
2681
 
2682
  def int_x86_clwb : ClangBuiltin<"__builtin_ia32_clwb">,
2683
              Intrinsic<[], [llvm_ptr_ty], []>;
2684
}
2685
 
2686
//===----------------------------------------------------------------------===//
2687
// Support protection key
2688
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2689
  def int_x86_rdpkru : ClangBuiltin <"__builtin_ia32_rdpkru">,
2690
              Intrinsic<[llvm_i32_ty], [], []>;
2691
  def int_x86_wrpkru : ClangBuiltin<"__builtin_ia32_wrpkru">,
2692
              Intrinsic<[], [llvm_i32_ty], []>;
2693
}
2694
//===----------------------------------------------------------------------===//
2695
// Half float conversion
2696
 
2697
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2698
  def int_x86_vcvtps2ph_128 : ClangBuiltin<"__builtin_ia32_vcvtps2ph">,
2699
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty],
2700
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2701
  def int_x86_vcvtps2ph_256 : ClangBuiltin<"__builtin_ia32_vcvtps2ph256">,
2702
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty],
2703
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2704
  def int_x86_avx512_mask_vcvtph2ps_512 :
2705
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16i16_ty, llvm_v16f32_ty,
2706
                                           llvm_i16_ty, llvm_i32_ty],
2707
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2708
  def int_x86_avx512_mask_vcvtps2ph_512 : ClangBuiltin<"__builtin_ia32_vcvtps2ph512_mask">,
2709
      DefaultAttrsIntrinsic<[llvm_v16i16_ty], [llvm_v16f32_ty, llvm_i32_ty,
2710
                                               llvm_v16i16_ty, llvm_i16_ty],
2711
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2712
  def int_x86_avx512_mask_vcvtps2ph_256 : ClangBuiltin<"__builtin_ia32_vcvtps2ph256_mask">,
2713
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty,
2714
                                           llvm_v8i16_ty, llvm_i8_ty],
2715
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2716
  def int_x86_avx512_mask_vcvtps2ph_128 : ClangBuiltin<"__builtin_ia32_vcvtps2ph_mask">,
2717
      DefaultAttrsIntrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty,
2718
                                               llvm_v8i16_ty, llvm_i8_ty],
2719
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2720
}
2721
 
2722
//===----------------------------------------------------------------------===//
2723
// TBM
2724
 
2725
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2726
  def int_x86_tbm_bextri_u32 : ClangBuiltin<"__builtin_ia32_bextri_u32">,
2727
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
2728
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2729
  def int_x86_tbm_bextri_u64 : ClangBuiltin<"__builtin_ia32_bextri_u64">,
2730
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
2731
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2732
}
2733
 
2734
//===----------------------------------------------------------------------===//
2735
// RDRAND intrinsics - Return a random value and whether it is valid.
2736
// RDSEED intrinsics - Return a NIST SP800-90B & C compliant random value and
2737
// whether it is valid.
2738
 
2739
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2740
  // These are declared side-effecting so they don't get eliminated by CSE or
2741
  // LICM.
2742
  def int_x86_rdrand_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
2743
  def int_x86_rdrand_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
2744
  def int_x86_rdrand_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
2745
  def int_x86_rdseed_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
2746
  def int_x86_rdseed_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
2747
  def int_x86_rdseed_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
2748
}
2749
 
2750
//===----------------------------------------------------------------------===//
2751
// ADX
2752
 
2753
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2754
  def int_x86_addcarry_32:
2755
      DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i32_ty],
2756
                            [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
2757
                            [IntrNoMem]>;
2758
  def int_x86_addcarry_64:
2759
      DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i64_ty],
2760
                            [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty],
2761
                            [IntrNoMem]>;
2762
  def int_x86_subborrow_32:
2763
      DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i32_ty],
2764
                            [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
2765
                            [IntrNoMem]>;
2766
  def int_x86_subborrow_64:
2767
      DefaultAttrsIntrinsic<[llvm_i8_ty, llvm_i64_ty],
2768
                            [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty],
2769
                            [IntrNoMem]>;
2770
}
2771
 
2772
//===----------------------------------------------------------------------===//
2773
// RTM intrinsics. Transactional Memory support.
2774
 
2775
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2776
  def int_x86_xbegin : ClangBuiltin<"__builtin_ia32_xbegin">,
2777
              Intrinsic<[llvm_i32_ty], [], []>;
2778
  def int_x86_xend : ClangBuiltin<"__builtin_ia32_xend">,
2779
              Intrinsic<[], [], []>;
2780
  def int_x86_xabort : ClangBuiltin<"__builtin_ia32_xabort">,
2781
              Intrinsic<[], [llvm_i8_ty], [ImmArg<ArgIndex<0>>]>;
2782
  def int_x86_xtest : ClangBuiltin<"__builtin_ia32_xtest">,
2783
              Intrinsic<[llvm_i32_ty], [], []>;
2784
}
2785
 
2786
//===----------------------------------------------------------------------===//
2787
// AVX512
2788
 
2789
// Mask ops
2790
let TargetPrefix = "x86" in {
2791
  def int_x86_avx512_kadd_b :
2792
      DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8i1_ty, llvm_v8i1_ty],
2793
                            [IntrNoMem]>;
2794
  def int_x86_avx512_kadd_w :
2795
      DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16i1_ty, llvm_v16i1_ty],
2796
                            [IntrNoMem]>;
2797
  def int_x86_avx512_kadd_d :
2798
      DefaultAttrsIntrinsic<[llvm_v32i1_ty], [llvm_v32i1_ty, llvm_v32i1_ty],
2799
                            [IntrNoMem]>;
2800
  def int_x86_avx512_kadd_q :
2801
      DefaultAttrsIntrinsic<[llvm_v64i1_ty], [llvm_v64i1_ty, llvm_v64i1_ty],
2802
                            [IntrNoMem]>;
2803
 
2804
  def int_x86_avx512_ktestc_b :
2805
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8i1_ty, llvm_v8i1_ty],
2806
                            [IntrNoMem]>;
2807
  def int_x86_avx512_ktestc_w :
2808
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v16i1_ty, llvm_v16i1_ty],
2809
                            [IntrNoMem]>;
2810
  def int_x86_avx512_ktestc_d :
2811
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v32i1_ty, llvm_v32i1_ty],
2812
                            [IntrNoMem]>;
2813
  def int_x86_avx512_ktestc_q :
2814
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v64i1_ty, llvm_v64i1_ty],
2815
                            [IntrNoMem]>;
2816
 
2817
  def int_x86_avx512_ktestz_b :
2818
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v8i1_ty, llvm_v8i1_ty],
2819
                            [IntrNoMem]>;
2820
  def int_x86_avx512_ktestz_w :
2821
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v16i1_ty, llvm_v16i1_ty],
2822
                            [IntrNoMem]>;
2823
  def int_x86_avx512_ktestz_d :
2824
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v32i1_ty, llvm_v32i1_ty],
2825
                            [IntrNoMem]>;
2826
  def int_x86_avx512_ktestz_q :
2827
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v64i1_ty, llvm_v64i1_ty],
2828
                            [IntrNoMem]>;
2829
}
2830
 
2831
// Conversion ops
2832
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2833
  def int_x86_avx512_cvttss2si : ClangBuiltin<"__builtin_ia32_vcvttss2si32">,
2834
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2835
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2836
  def int_x86_avx512_cvttss2si64 : ClangBuiltin<"__builtin_ia32_vcvttss2si64">,
2837
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2838
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2839
  def int_x86_avx512_cvttss2usi : ClangBuiltin<"__builtin_ia32_vcvttss2usi32">,
2840
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2841
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2842
  def int_x86_avx512_cvttss2usi64 : ClangBuiltin<"__builtin_ia32_vcvttss2usi64">,
2843
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2844
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2845
  def int_x86_avx512_cvtusi2ss : ClangBuiltin<"__builtin_ia32_cvtusi2ss32">,
2846
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
2847
                            [llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
2848
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2849
  def int_x86_avx512_cvtusi642ss : ClangBuiltin<"__builtin_ia32_cvtusi2ss64">,
2850
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
2851
                            [llvm_v4f32_ty, llvm_i64_ty, llvm_i32_ty],
2852
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2853
  def int_x86_avx512_cvttsd2si : ClangBuiltin<"__builtin_ia32_vcvttsd2si32">,
2854
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2855
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2856
  def int_x86_avx512_cvttsd2si64 : ClangBuiltin<"__builtin_ia32_vcvttsd2si64">,
2857
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2858
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2859
  def int_x86_avx512_cvttsd2usi : ClangBuiltin<"__builtin_ia32_vcvttsd2usi32">,
2860
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2861
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2862
  def int_x86_avx512_cvttsd2usi64 : ClangBuiltin<"__builtin_ia32_vcvttsd2usi64">,
2863
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2864
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2865
  def int_x86_avx512_cvtusi642sd : ClangBuiltin<"__builtin_ia32_cvtusi2sd64">,
2866
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
2867
                            [llvm_v2f64_ty, llvm_i64_ty, llvm_i32_ty],
2868
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2869
  def int_x86_avx512_vcvtss2usi32 : ClangBuiltin<"__builtin_ia32_vcvtss2usi32">,
2870
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2871
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2872
  def int_x86_avx512_vcvtss2usi64 : ClangBuiltin<"__builtin_ia32_vcvtss2usi64">,
2873
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2874
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2875
  def int_x86_avx512_vcvtss2si32 : ClangBuiltin<"__builtin_ia32_vcvtss2si32">,
2876
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2877
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2878
  def int_x86_avx512_vcvtss2si64 : ClangBuiltin<"__builtin_ia32_vcvtss2si64">,
2879
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2880
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2881
  def int_x86_avx512_vcvtsd2usi32 : ClangBuiltin<"__builtin_ia32_vcvtsd2usi32">,
2882
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2883
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2884
  def int_x86_avx512_vcvtsd2usi64 : ClangBuiltin<"__builtin_ia32_vcvtsd2usi64">,
2885
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2886
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2887
  def int_x86_avx512_vcvtsd2si32 : ClangBuiltin<"__builtin_ia32_vcvtsd2si32">,
2888
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2889
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2890
  def int_x86_avx512_vcvtsd2si64 : ClangBuiltin<"__builtin_ia32_vcvtsd2si64">,
2891
      DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2892
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2893
  def int_x86_avx512_cvtsi2ss32 : ClangBuiltin<"__builtin_ia32_cvtsi2ss32">,
2894
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
2895
                            [llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
2896
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2897
  def int_x86_avx512_cvtsi2ss64 : ClangBuiltin<"__builtin_ia32_cvtsi2ss64">,
2898
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
2899
                            [llvm_v4f32_ty, llvm_i64_ty, llvm_i32_ty],
2900
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2901
  def int_x86_avx512_cvtsi2sd64 : ClangBuiltin<"__builtin_ia32_cvtsi2sd64">,
2902
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
2903
                            [llvm_v2f64_ty, llvm_i64_ty, llvm_i32_ty],
2904
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
2905
}
2906
 
2907
// Pack ops.
2908
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2909
  def int_x86_avx512_packsswb_512 : ClangBuiltin<"__builtin_ia32_packsswb512">,
2910
      DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
2911
                           [IntrNoMem]>;
2912
  def int_x86_avx512_packssdw_512 : ClangBuiltin<"__builtin_ia32_packssdw512">,
2913
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
2914
                            [IntrNoMem]>;
2915
  def int_x86_avx512_packuswb_512 : ClangBuiltin<"__builtin_ia32_packuswb512">,
2916
      DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
2917
                            [IntrNoMem]>;
2918
  def int_x86_avx512_packusdw_512 : ClangBuiltin<"__builtin_ia32_packusdw512">,
2919
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
2920
                            [IntrNoMem]>;
2921
}
2922
 
2923
// Vector convert
2924
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
2925
  def int_x86_avx512_sitofp_round :
2926
      DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
2927
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2928
 
2929
  def int_x86_avx512_uitofp_round :
2930
      DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
2931
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
2932
 
2933
  def int_x86_avx512_mask_cvtpd2dq_128 :
2934
        ClangBuiltin<"__builtin_ia32_cvtpd2dq128_mask">,
2935
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2936
          [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
2937
          [IntrNoMem]>;
2938
 
2939
  def int_x86_avx512_mask_cvtpd2dq_512 :
2940
        ClangBuiltin<"__builtin_ia32_cvtpd2dq512_mask">,
2941
          DefaultAttrsIntrinsic<[llvm_v8i32_ty],
2942
          [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
2943
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2944
 
2945
  def int_x86_avx512_mask_cvtpd2ps_512 :
2946
        ClangBuiltin<"__builtin_ia32_cvtpd2ps512_mask">,
2947
          DefaultAttrsIntrinsic<[llvm_v8f32_ty],
2948
          [llvm_v8f64_ty, llvm_v8f32_ty,  llvm_i8_ty,  llvm_i32_ty],
2949
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2950
 
2951
  def int_x86_avx512_mask_cvtsd2ss_round :
2952
        ClangBuiltin<"__builtin_ia32_cvtsd2ss_round_mask">,
2953
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
2954
          [llvm_v4f32_ty, llvm_v2f64_ty, llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
2955
          [IntrNoMem, ImmArg<ArgIndex<4>>]>;
2956
 
2957
  def int_x86_avx512_mask_cvtss2sd_round :
2958
        ClangBuiltin<"__builtin_ia32_cvtss2sd_round_mask">,
2959
          DefaultAttrsIntrinsic<[llvm_v2f64_ty],
2960
          [llvm_v2f64_ty, llvm_v4f32_ty, llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
2961
          [IntrNoMem, ImmArg<ArgIndex<4>>]>;
2962
 
2963
  def int_x86_avx512_mask_cvtpd2ps :
2964
        ClangBuiltin<"__builtin_ia32_cvtpd2ps_mask">,
2965
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
2966
          [llvm_v2f64_ty, llvm_v4f32_ty,  llvm_i8_ty],
2967
          [IntrNoMem]>;
2968
 
2969
  def int_x86_avx512_mask_cvtpd2qq_128 :
2970
        ClangBuiltin<"__builtin_ia32_cvtpd2qq128_mask">,
2971
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
2972
          [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
2973
          [IntrNoMem]>;
2974
 
2975
  def int_x86_avx512_mask_cvtpd2qq_256 :
2976
        ClangBuiltin<"__builtin_ia32_cvtpd2qq256_mask">,
2977
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
2978
          [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
2979
          [IntrNoMem]>;
2980
 
2981
  def int_x86_avx512_mask_cvtpd2qq_512 :
2982
        ClangBuiltin<"__builtin_ia32_cvtpd2qq512_mask">,
2983
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
2984
          [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
2985
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
2986
 
2987
  def int_x86_avx512_mask_cvtpd2udq_128 :
2988
        ClangBuiltin<"__builtin_ia32_cvtpd2udq128_mask">,
2989
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2990
          [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
2991
          [IntrNoMem]>;
2992
 
2993
  def int_x86_avx512_mask_cvtpd2udq_256 :
2994
        ClangBuiltin<"__builtin_ia32_cvtpd2udq256_mask">,
2995
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
2996
          [llvm_v4f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
2997
          [IntrNoMem]>;
2998
 
2999
  def int_x86_avx512_mask_cvtpd2udq_512 :
3000
        ClangBuiltin<"__builtin_ia32_cvtpd2udq512_mask">,
3001
          DefaultAttrsIntrinsic<[llvm_v8i32_ty],
3002
          [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
3003
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3004
 
3005
  def int_x86_avx512_mask_cvtpd2uqq_128 :
3006
        ClangBuiltin<"__builtin_ia32_cvtpd2uqq128_mask">,
3007
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3008
          [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
3009
          [IntrNoMem]>;
3010
 
3011
  def int_x86_avx512_mask_cvtpd2uqq_256 :
3012
        ClangBuiltin<"__builtin_ia32_cvtpd2uqq256_mask">,
3013
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3014
          [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
3015
          [IntrNoMem]>;
3016
 
3017
  def int_x86_avx512_mask_cvtpd2uqq_512 :
3018
        ClangBuiltin<"__builtin_ia32_cvtpd2uqq512_mask">,
3019
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
3020
          [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
3021
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3022
 
3023
  def int_x86_avx512_mask_cvtps2dq_128 :
3024
        ClangBuiltin<"__builtin_ia32_cvtps2dq128_mask">,
3025
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3026
          [llvm_v4f32_ty, llvm_v4i32_ty,  llvm_i8_ty],
3027
          [IntrNoMem]>;
3028
 
3029
  def int_x86_avx512_mask_cvtps2dq_256 :
3030
        ClangBuiltin<"__builtin_ia32_cvtps2dq256_mask">,
3031
          DefaultAttrsIntrinsic<[llvm_v8i32_ty],
3032
          [llvm_v8f32_ty, llvm_v8i32_ty,  llvm_i8_ty],
3033
          [IntrNoMem]>;
3034
 
3035
  def int_x86_avx512_mask_cvtps2dq_512 :
3036
        ClangBuiltin<"__builtin_ia32_cvtps2dq512_mask">,
3037
          DefaultAttrsIntrinsic<[llvm_v16i32_ty],
3038
          [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
3039
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3040
 
3041
  def int_x86_avx512_mask_cvtps2pd_512 :
3042
        ClangBuiltin<"__builtin_ia32_cvtps2pd512_mask">,
3043
          DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3044
          [llvm_v8f32_ty, llvm_v8f64_ty,  llvm_i8_ty,  llvm_i32_ty],
3045
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3046
 
3047
  def int_x86_avx512_mask_cvtps2qq_128 :
3048
        ClangBuiltin<"__builtin_ia32_cvtps2qq128_mask">,
3049
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3050
          [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
3051
          [IntrNoMem]>;
3052
 
3053
  def int_x86_avx512_mask_cvtps2qq_256 :
3054
        ClangBuiltin<"__builtin_ia32_cvtps2qq256_mask">,
3055
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3056
          [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
3057
          [IntrNoMem]>;
3058
 
3059
  def int_x86_avx512_mask_cvtps2qq_512 :
3060
        ClangBuiltin<"__builtin_ia32_cvtps2qq512_mask">,
3061
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
3062
          [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
3063
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3064
 
3065
  def int_x86_avx512_mask_cvtps2udq_128 :
3066
        ClangBuiltin<"__builtin_ia32_cvtps2udq128_mask">,
3067
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3068
          [llvm_v4f32_ty, llvm_v4i32_ty,  llvm_i8_ty],
3069
          [IntrNoMem]>;
3070
 
3071
  def int_x86_avx512_mask_cvtps2udq_256 :
3072
        ClangBuiltin<"__builtin_ia32_cvtps2udq256_mask">,
3073
          DefaultAttrsIntrinsic<[llvm_v8i32_ty],
3074
          [llvm_v8f32_ty, llvm_v8i32_ty,  llvm_i8_ty],
3075
          [IntrNoMem]>;
3076
 
3077
  def int_x86_avx512_mask_cvtps2udq_512 :
3078
        ClangBuiltin<"__builtin_ia32_cvtps2udq512_mask">,
3079
          DefaultAttrsIntrinsic<[llvm_v16i32_ty],
3080
          [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
3081
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3082
 
3083
  def int_x86_avx512_mask_cvtps2uqq_128 :
3084
        ClangBuiltin<"__builtin_ia32_cvtps2uqq128_mask">,
3085
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3086
          [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
3087
          [IntrNoMem]>;
3088
 
3089
  def int_x86_avx512_mask_cvtps2uqq_256 :
3090
        ClangBuiltin<"__builtin_ia32_cvtps2uqq256_mask">,
3091
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3092
          [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
3093
          [IntrNoMem]>;
3094
 
3095
  def int_x86_avx512_mask_cvtps2uqq_512 :
3096
        ClangBuiltin<"__builtin_ia32_cvtps2uqq512_mask">,
3097
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
3098
          [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
3099
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3100
 
3101
  def int_x86_avx512_mask_cvtqq2ps_128 :
3102
        ClangBuiltin<"__builtin_ia32_cvtqq2ps128_mask">,
3103
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3104
          [llvm_v2i64_ty, llvm_v4f32_ty,  llvm_i8_ty],
3105
          [IntrNoMem]>;
3106
 
3107
  def int_x86_avx512_mask_cvttpd2dq_128 :
3108
        ClangBuiltin<"__builtin_ia32_cvttpd2dq128_mask">,
3109
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3110
          [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
3111
          [IntrNoMem]>;
3112
 
3113
  def int_x86_avx512_mask_cvttpd2dq_512 :
3114
        ClangBuiltin<"__builtin_ia32_cvttpd2dq512_mask">,
3115
          DefaultAttrsIntrinsic<[llvm_v8i32_ty],
3116
          [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
3117
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3118
 
3119
  def int_x86_avx512_mask_cvttpd2qq_128 :
3120
        ClangBuiltin<"__builtin_ia32_cvttpd2qq128_mask">,
3121
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3122
          [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
3123
          [IntrNoMem]>;
3124
 
3125
  def int_x86_avx512_mask_cvttpd2qq_256 :
3126
        ClangBuiltin<"__builtin_ia32_cvttpd2qq256_mask">,
3127
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3128
          [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
3129
          [IntrNoMem]>;
3130
 
3131
  def int_x86_avx512_mask_cvttpd2qq_512 :
3132
        ClangBuiltin<"__builtin_ia32_cvttpd2qq512_mask">,
3133
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
3134
          [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
3135
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3136
 
3137
  def int_x86_avx512_mask_cvttpd2udq_128 :
3138
        ClangBuiltin<"__builtin_ia32_cvttpd2udq128_mask">,
3139
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3140
          [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
3141
          [IntrNoMem]>;
3142
 
3143
  def int_x86_avx512_mask_cvttpd2udq_256 :
3144
        ClangBuiltin<"__builtin_ia32_cvttpd2udq256_mask">,
3145
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3146
          [llvm_v4f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
3147
          [IntrNoMem]>;
3148
 
3149
  def int_x86_avx512_mask_cvttpd2udq_512 :
3150
        ClangBuiltin<"__builtin_ia32_cvttpd2udq512_mask">,
3151
          DefaultAttrsIntrinsic<[llvm_v8i32_ty],
3152
          [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
3153
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3154
 
3155
  def int_x86_avx512_mask_cvttpd2uqq_128 :
3156
        ClangBuiltin<"__builtin_ia32_cvttpd2uqq128_mask">,
3157
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3158
          [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
3159
          [IntrNoMem]>;
3160
 
3161
  def int_x86_avx512_mask_cvttpd2uqq_256 :
3162
        ClangBuiltin<"__builtin_ia32_cvttpd2uqq256_mask">,
3163
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3164
          [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
3165
          [IntrNoMem]>;
3166
 
3167
  def int_x86_avx512_mask_cvttpd2uqq_512 :
3168
        ClangBuiltin<"__builtin_ia32_cvttpd2uqq512_mask">,
3169
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
3170
          [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
3171
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3172
 
3173
  def int_x86_avx512_mask_cvttps2dq_512 :
3174
        ClangBuiltin<"__builtin_ia32_cvttps2dq512_mask">,
3175
          DefaultAttrsIntrinsic<[llvm_v16i32_ty],
3176
          [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
3177
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3178
 
3179
  def int_x86_avx512_mask_cvttps2qq_128 :
3180
        ClangBuiltin<"__builtin_ia32_cvttps2qq128_mask">,
3181
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3182
          [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
3183
          [IntrNoMem]>;
3184
 
3185
  def int_x86_avx512_mask_cvttps2qq_256 :
3186
        ClangBuiltin<"__builtin_ia32_cvttps2qq256_mask">,
3187
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3188
          [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
3189
          [IntrNoMem]>;
3190
 
3191
  def int_x86_avx512_mask_cvttps2qq_512 :
3192
        ClangBuiltin<"__builtin_ia32_cvttps2qq512_mask">,
3193
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
3194
          [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
3195
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3196
 
3197
  def int_x86_avx512_mask_cvttps2udq_128 :
3198
        ClangBuiltin<"__builtin_ia32_cvttps2udq128_mask">,
3199
          DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3200
          [llvm_v4f32_ty, llvm_v4i32_ty,  llvm_i8_ty],
3201
          [IntrNoMem]>;
3202
 
3203
  def int_x86_avx512_mask_cvttps2udq_256 :
3204
        ClangBuiltin<"__builtin_ia32_cvttps2udq256_mask">,
3205
          DefaultAttrsIntrinsic<[llvm_v8i32_ty],
3206
          [llvm_v8f32_ty, llvm_v8i32_ty,  llvm_i8_ty],
3207
          [IntrNoMem]>;
3208
 
3209
  def int_x86_avx512_mask_cvttps2udq_512 :
3210
        ClangBuiltin<"__builtin_ia32_cvttps2udq512_mask">,
3211
          DefaultAttrsIntrinsic<[llvm_v16i32_ty],
3212
          [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
3213
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3214
 
3215
  def int_x86_avx512_mask_cvttps2uqq_128 :
3216
        ClangBuiltin<"__builtin_ia32_cvttps2uqq128_mask">,
3217
          DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3218
          [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
3219
          [IntrNoMem]>;
3220
 
3221
  def int_x86_avx512_mask_cvttps2uqq_256 :
3222
        ClangBuiltin<"__builtin_ia32_cvttps2uqq256_mask">,
3223
          DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3224
          [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
3225
          [IntrNoMem]>;
3226
 
3227
  def int_x86_avx512_mask_cvttps2uqq_512 :
3228
        ClangBuiltin<"__builtin_ia32_cvttps2uqq512_mask">,
3229
          DefaultAttrsIntrinsic<[llvm_v8i64_ty],
3230
          [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
3231
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3232
 
3233
  def int_x86_avx512_mask_cvtuqq2ps_128 :
3234
        ClangBuiltin<"__builtin_ia32_cvtuqq2ps128_mask">,
3235
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3236
          [llvm_v2i64_ty, llvm_v4f32_ty,  llvm_i8_ty],
3237
          [IntrNoMem]>;
3238
 
3239
  def int_x86_avx512_mask_rndscale_pd_128 : ClangBuiltin<"__builtin_ia32_rndscalepd_128_mask">,
3240
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3241
                            [llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
3242
                             llvm_i8_ty],
3243
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3244
  def int_x86_avx512_mask_rndscale_pd_256 : ClangBuiltin<"__builtin_ia32_rndscalepd_256_mask">,
3245
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3246
                            [llvm_v4f64_ty, llvm_i32_ty, llvm_v4f64_ty,
3247
                             llvm_i8_ty],
3248
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3249
  def int_x86_avx512_mask_rndscale_pd_512 : ClangBuiltin<"__builtin_ia32_rndscalepd_mask">,
3250
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3251
                            [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
3252
                             llvm_i8_ty, llvm_i32_ty],
3253
                            [IntrNoMem, ImmArg<ArgIndex<1>>,
3254
                             ImmArg<ArgIndex<4>>]>;
3255
  def int_x86_avx512_mask_rndscale_ps_128 : ClangBuiltin<"__builtin_ia32_rndscaleps_128_mask">,
3256
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3257
                            [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
3258
                             llvm_i8_ty],
3259
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3260
  def int_x86_avx512_mask_rndscale_ps_256 : ClangBuiltin<"__builtin_ia32_rndscaleps_256_mask">,
3261
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3262
                            [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty,
3263
                             llvm_i8_ty],
3264
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3265
  def int_x86_avx512_mask_rndscale_ps_512 : ClangBuiltin<"__builtin_ia32_rndscaleps_mask">,
3266
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3267
                            [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
3268
                             llvm_i16_ty, llvm_i32_ty],
3269
                            [IntrNoMem, ImmArg<ArgIndex<1>>,
3270
                             ImmArg<ArgIndex<4>>]>;
3271
  def int_x86_avx512_mask_reduce_pd_128 : ClangBuiltin<"__builtin_ia32_reducepd128_mask">,
3272
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3273
                            [llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
3274
                             llvm_i8_ty],
3275
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3276
  def int_x86_avx512_mask_reduce_pd_256 : ClangBuiltin<"__builtin_ia32_reducepd256_mask">,
3277
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3278
                            [llvm_v4f64_ty, llvm_i32_ty, llvm_v4f64_ty,
3279
                             llvm_i8_ty],
3280
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3281
  def int_x86_avx512_mask_reduce_pd_512 : ClangBuiltin<"__builtin_ia32_reducepd512_mask">,
3282
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3283
                            [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
3284
                             llvm_i8_ty, llvm_i32_ty],
3285
                            [IntrNoMem, ImmArg<ArgIndex<1>>,
3286
                             ImmArg<ArgIndex<4>>]>;
3287
  def int_x86_avx512_mask_reduce_ps_128 : ClangBuiltin<"__builtin_ia32_reduceps128_mask">,
3288
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3289
                            [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
3290
                             llvm_i8_ty],
3291
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3292
  def int_x86_avx512_mask_reduce_ps_256 : ClangBuiltin<"__builtin_ia32_reduceps256_mask">,
3293
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3294
                            [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty,
3295
                             llvm_i8_ty],
3296
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3297
  def int_x86_avx512_mask_reduce_ps_512 : ClangBuiltin<"__builtin_ia32_reduceps512_mask">,
3298
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3299
                            [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
3300
                             llvm_i16_ty, llvm_i32_ty],
3301
                            [IntrNoMem, ImmArg<ArgIndex<1>>,
3302
                             ImmArg<ArgIndex<4>>]>;
3303
def int_x86_avx512_mask_range_pd_128 : ClangBuiltin<"__builtin_ia32_rangepd128_mask">,
3304
    DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3305
                          [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty,
3306
                           llvm_v2f64_ty,  llvm_i8_ty],
3307
                          [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3308
def int_x86_avx512_mask_range_pd_256 : ClangBuiltin<"__builtin_ia32_rangepd256_mask">,
3309
    DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3310
                          [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i32_ty,
3311
                           llvm_v4f64_ty,  llvm_i8_ty],
3312
                          [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3313
def int_x86_avx512_mask_range_pd_512 : ClangBuiltin<"__builtin_ia32_rangepd512_mask">,
3314
    DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3315
                          [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty,
3316
                           llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty],
3317
                          [IntrNoMem, ImmArg<ArgIndex<2>>,
3318
                           ImmArg<ArgIndex<5>>]>;
3319
def int_x86_avx512_mask_range_ps_128 : ClangBuiltin<"__builtin_ia32_rangeps128_mask">,
3320
    DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3321
                          [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty,
3322
                           llvm_v4f32_ty,  llvm_i8_ty],
3323
                          [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3324
def int_x86_avx512_mask_range_ps_256 : ClangBuiltin<"__builtin_ia32_rangeps256_mask">,
3325
    DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3326
                          [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i32_ty,
3327
                           llvm_v8f32_ty,  llvm_i8_ty],
3328
                          [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3329
def int_x86_avx512_mask_range_ps_512 : ClangBuiltin<"__builtin_ia32_rangeps512_mask">,
3330
    DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3331
                          [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty,
3332
                           llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty],
3333
                          [IntrNoMem, ImmArg<ArgIndex<2>>,
3334
                           ImmArg<ArgIndex<5>>]>;
3335
}
3336
 
3337
// Vector broadcast from mask
3338
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
3339
   def int_x86_avx512_broadcastmw_512 :
3340
       ClangBuiltin<"__builtin_ia32_broadcastmw512">,
3341
       DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_i16_ty], [IntrNoMem]>;
3342
   def int_x86_avx512_broadcastmw_256 :
3343
       ClangBuiltin<"__builtin_ia32_broadcastmw256">,
3344
       DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_i16_ty], [IntrNoMem]>;
3345
   def int_x86_avx512_broadcastmw_128 :
3346
       ClangBuiltin<"__builtin_ia32_broadcastmw128">,
3347
       DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_i16_ty], [IntrNoMem]>;
3348
   def int_x86_avx512_broadcastmb_512 :
3349
       ClangBuiltin<"__builtin_ia32_broadcastmb512">,
3350
       DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_i8_ty], [IntrNoMem]>;
3351
   def int_x86_avx512_broadcastmb_256 :
3352
       ClangBuiltin<"__builtin_ia32_broadcastmb256">,
3353
       DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_i8_ty], [IntrNoMem]>;
3354
   def int_x86_avx512_broadcastmb_128 :
3355
       ClangBuiltin<"__builtin_ia32_broadcastmb128">,
3356
       DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_i8_ty], [IntrNoMem]>;
3357
}
3358
 
3359
// Arithmetic ops
3360
let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
3361
 
3362
  def int_x86_avx512_add_ps_512 : ClangBuiltin<"__builtin_ia32_addps512">,
3363
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3364
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3365
  def int_x86_avx512_add_pd_512 : ClangBuiltin<"__builtin_ia32_addpd512">,
3366
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3367
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3368
  def int_x86_avx512_sub_ps_512 : ClangBuiltin<"__builtin_ia32_subps512">,
3369
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3370
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3371
  def int_x86_avx512_sub_pd_512 : ClangBuiltin<"__builtin_ia32_subpd512">,
3372
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3373
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3374
  def int_x86_avx512_mul_ps_512 : ClangBuiltin<"__builtin_ia32_mulps512">,
3375
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3376
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3377
  def int_x86_avx512_mul_pd_512 : ClangBuiltin<"__builtin_ia32_mulpd512">,
3378
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3379
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3380
  def int_x86_avx512_div_ps_512 : ClangBuiltin<"__builtin_ia32_divps512">,
3381
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3382
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3383
  def int_x86_avx512_div_pd_512 : ClangBuiltin<"__builtin_ia32_divpd512">,
3384
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3385
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3386
 
3387
  def int_x86_avx512_max_ps_512 : ClangBuiltin<"__builtin_ia32_maxps512">,
3388
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3389
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3390
  def int_x86_avx512_max_pd_512 : ClangBuiltin<"__builtin_ia32_maxpd512">,
3391
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3392
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3393
  def int_x86_avx512_min_ps_512 : ClangBuiltin<"__builtin_ia32_minps512">,
3394
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3395
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3396
  def int_x86_avx512_min_pd_512 : ClangBuiltin<"__builtin_ia32_minpd512">,
3397
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3398
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3399
 
3400
  def int_x86_avx512_mask_add_ss_round : ClangBuiltin<"__builtin_ia32_addss_round_mask">,
3401
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3402
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3403
                             llvm_i8_ty, llvm_i32_ty],
3404
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3405
  def int_x86_avx512_mask_div_ss_round : ClangBuiltin<"__builtin_ia32_divss_round_mask">,
3406
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3407
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3408
                             llvm_i8_ty, llvm_i32_ty],
3409
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3410
  def int_x86_avx512_mask_mul_ss_round : ClangBuiltin<"__builtin_ia32_mulss_round_mask">,
3411
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3412
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3413
                             llvm_i8_ty, llvm_i32_ty],
3414
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3415
  def int_x86_avx512_mask_sub_ss_round : ClangBuiltin<"__builtin_ia32_subss_round_mask">,
3416
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3417
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3418
                             llvm_i8_ty, llvm_i32_ty],
3419
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3420
  def int_x86_avx512_mask_max_ss_round : ClangBuiltin<"__builtin_ia32_maxss_round_mask">,
3421
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3422
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3423
                             llvm_i8_ty, llvm_i32_ty],
3424
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3425
  def int_x86_avx512_mask_min_ss_round : ClangBuiltin<"__builtin_ia32_minss_round_mask">,
3426
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3427
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3428
                             llvm_i8_ty, llvm_i32_ty],
3429
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3430
  def int_x86_avx512_mask_add_sd_round : ClangBuiltin<"__builtin_ia32_addsd_round_mask">,
3431
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3432
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3433
                             llvm_i8_ty, llvm_i32_ty],
3434
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3435
  def int_x86_avx512_mask_div_sd_round : ClangBuiltin<"__builtin_ia32_divsd_round_mask">,
3436
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3437
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3438
                             llvm_i8_ty, llvm_i32_ty],
3439
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3440
  def int_x86_avx512_mask_mul_sd_round : ClangBuiltin<"__builtin_ia32_mulsd_round_mask">,
3441
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3442
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3443
                             llvm_i8_ty, llvm_i32_ty],
3444
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3445
  def int_x86_avx512_mask_sub_sd_round : ClangBuiltin<"__builtin_ia32_subsd_round_mask">,
3446
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3447
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3448
                             llvm_i8_ty, llvm_i32_ty],
3449
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3450
  def int_x86_avx512_mask_max_sd_round : ClangBuiltin<"__builtin_ia32_maxsd_round_mask">,
3451
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3452
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3453
                             llvm_i8_ty, llvm_i32_ty],
3454
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3455
  def int_x86_avx512_mask_min_sd_round : ClangBuiltin<"__builtin_ia32_minsd_round_mask">,
3456
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3457
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3458
                             llvm_i8_ty, llvm_i32_ty],
3459
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3460
 
3461
  def int_x86_avx512_mask_rndscale_ss : ClangBuiltin<"__builtin_ia32_rndscaless_round_mask">,
3462
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3463
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3464
                             llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3465
                            [IntrNoMem, ImmArg<ArgIndex<4>>,
3466
                             ImmArg<ArgIndex<5>>]>;
3467
  def int_x86_avx512_mask_rndscale_sd : ClangBuiltin<"__builtin_ia32_rndscalesd_round_mask">,
3468
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3469
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3470
                             llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3471
                            [IntrNoMem, ImmArg<ArgIndex<4>>,
3472
                             ImmArg<ArgIndex<5>>]>;
3473
  def int_x86_avx512_mask_range_ss : ClangBuiltin<"__builtin_ia32_rangess128_round_mask">,
3474
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3475
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3476
                             llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3477
                            [IntrNoMem, ImmArg<ArgIndex<4>>,
3478
                             ImmArg<ArgIndex<5>>]>;
3479
  def int_x86_avx512_mask_range_sd : ClangBuiltin<"__builtin_ia32_rangesd128_round_mask">,
3480
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3481
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3482
                             llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3483
                            [IntrNoMem, ImmArg<ArgIndex<4>>,
3484
                             ImmArg<ArgIndex<5>>]>;
3485
  def int_x86_avx512_mask_reduce_ss : ClangBuiltin<"__builtin_ia32_reducess_mask">,
3486
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3487
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3488
                             llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3489
                            [IntrNoMem, ImmArg<ArgIndex<4>>,
3490
                             ImmArg<ArgIndex<5>>]>;
3491
  def int_x86_avx512_mask_reduce_sd : ClangBuiltin<"__builtin_ia32_reducesd_mask">,
3492
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3493
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3494
                             llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3495
                            [IntrNoMem, ImmArg<ArgIndex<4>>,
3496
                             ImmArg<ArgIndex<5>>]>;
3497
  def int_x86_avx512_mask_scalef_sd : ClangBuiltin<"__builtin_ia32_scalefsd_round_mask">,
3498
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3499
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3500
                             llvm_i8_ty, llvm_i32_ty],
3501
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3502
  def int_x86_avx512_mask_scalef_ss : ClangBuiltin<"__builtin_ia32_scalefss_round_mask">,
3503
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3504
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3505
                             llvm_i8_ty, llvm_i32_ty],
3506
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3507
  def int_x86_avx512_mask_scalef_pd_128 : ClangBuiltin<"__builtin_ia32_scalefpd128_mask">,
3508
      DefaultAttrsIntrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3509
                             llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
3510
  def int_x86_avx512_mask_scalef_pd_256 : ClangBuiltin<"__builtin_ia32_scalefpd256_mask">,
3511
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3512
                            [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,
3513
                             llvm_i8_ty],
3514
                            [IntrNoMem]>;
3515
  def int_x86_avx512_mask_scalef_pd_512 : ClangBuiltin<"__builtin_ia32_scalefpd512_mask">,
3516
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3517
                            [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,
3518
                             llvm_i8_ty, llvm_i32_ty],
3519
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3520
  def int_x86_avx512_mask_scalef_ps_128 : ClangBuiltin<"__builtin_ia32_scalefps128_mask">,
3521
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3522
                             llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
3523
  def int_x86_avx512_mask_scalef_ps_256 : ClangBuiltin<"__builtin_ia32_scalefps256_mask">,
3524
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
3525
                             llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
3526
  def int_x86_avx512_mask_scalef_ps_512 : ClangBuiltin<"__builtin_ia32_scalefps512_mask">,
3527
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3528
                            [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
3529
                             llvm_i16_ty, llvm_i32_ty],
3530
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3531
 
3532
  def int_x86_avx512_mask_sqrt_ss :
3533
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3534
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3535
                             llvm_i8_ty, llvm_i32_ty],
3536
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3537
  def int_x86_avx512_mask_sqrt_sd :
3538
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3539
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3540
                             llvm_i8_ty, llvm_i32_ty],
3541
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3542
 
3543
  def int_x86_avx512_sqrt_pd_512 :
3544
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i32_ty],
3545
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3546
  def int_x86_avx512_sqrt_ps_512 :
3547
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i32_ty],
3548
                            [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3549
  def int_x86_avx512_mask_fixupimm_pd_128 :
3550
         ClangBuiltin<"__builtin_ia32_fixupimmpd128_mask">,
3551
          DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3552
          [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
3553
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3554
  def int_x86_avx512_maskz_fixupimm_pd_128 :
3555
         ClangBuiltin<"__builtin_ia32_fixupimmpd128_maskz">,
3556
          DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3557
          [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
3558
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3559
  def int_x86_avx512_mask_fixupimm_pd_256 :
3560
         ClangBuiltin<"__builtin_ia32_fixupimmpd256_mask">,
3561
          DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3562
          [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
3563
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3564
  def int_x86_avx512_maskz_fixupimm_pd_256 :
3565
         ClangBuiltin<"__builtin_ia32_fixupimmpd256_maskz">,
3566
          DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3567
          [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
3568
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3569
  def int_x86_avx512_mask_fixupimm_pd_512 :
3570
         ClangBuiltin<"__builtin_ia32_fixupimmpd512_mask">,
3571
          DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3572
          [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
3573
          llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3574
  def int_x86_avx512_maskz_fixupimm_pd_512 :
3575
         ClangBuiltin<"__builtin_ia32_fixupimmpd512_maskz">,
3576
          DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3577
          [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
3578
          llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3579
  def int_x86_avx512_mask_fixupimm_ps_128 :
3580
         ClangBuiltin<"__builtin_ia32_fixupimmps128_mask">,
3581
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3582
          [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
3583
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3584
  def int_x86_avx512_maskz_fixupimm_ps_128 :
3585
         ClangBuiltin<"__builtin_ia32_fixupimmps128_maskz">,
3586
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3587
          [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
3588
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3589
  def int_x86_avx512_mask_fixupimm_ps_256 :
3590
         ClangBuiltin<"__builtin_ia32_fixupimmps256_mask">,
3591
          DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3592
          [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
3593
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3594
  def int_x86_avx512_maskz_fixupimm_ps_256 :
3595
         ClangBuiltin<"__builtin_ia32_fixupimmps256_maskz">,
3596
          DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3597
          [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
3598
          [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3599
  def int_x86_avx512_mask_fixupimm_ps_512 :
3600
         ClangBuiltin<"__builtin_ia32_fixupimmps512_mask">,
3601
          DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3602
          [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
3603
          llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3604
  def int_x86_avx512_maskz_fixupimm_ps_512 :
3605
         ClangBuiltin<"__builtin_ia32_fixupimmps512_maskz">,
3606
          DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3607
          [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
3608
          llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3609
  def int_x86_avx512_mask_fixupimm_sd :
3610
         ClangBuiltin<"__builtin_ia32_fixupimmsd_mask">,
3611
          DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3612
          [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
3613
          llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3614
  def int_x86_avx512_maskz_fixupimm_sd :
3615
         ClangBuiltin<"__builtin_ia32_fixupimmsd_maskz">,
3616
          DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3617
          [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
3618
          llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3619
  def int_x86_avx512_mask_fixupimm_ss :
3620
         ClangBuiltin<"__builtin_ia32_fixupimmss_mask">,
3621
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3622
          [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
3623
          llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3624
  def int_x86_avx512_maskz_fixupimm_ss :
3625
         ClangBuiltin<"__builtin_ia32_fixupimmss_maskz">,
3626
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3627
          [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
3628
          llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<5>>]>;
3629
  def int_x86_avx512_mask_getexp_pd_128 : ClangBuiltin<"__builtin_ia32_getexppd128_mask">,
3630
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3631
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
3632
                            [IntrNoMem]>;
3633
  def int_x86_avx512_mask_getexp_pd_256 : ClangBuiltin<"__builtin_ia32_getexppd256_mask">,
3634
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3635
                            [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
3636
                            [IntrNoMem]>;
3637
  def int_x86_avx512_mask_getexp_pd_512 : ClangBuiltin<"__builtin_ia32_getexppd512_mask">,
3638
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3639
                            [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
3640
                             llvm_i32_ty],
3641
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3642
  def int_x86_avx512_mask_getexp_ps_128 : ClangBuiltin<"__builtin_ia32_getexpps128_mask">,
3643
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3644
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
3645
                            [IntrNoMem]>;
3646
  def int_x86_avx512_mask_getexp_ps_256 : ClangBuiltin<"__builtin_ia32_getexpps256_mask">,
3647
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3648
                            [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
3649
                            [IntrNoMem]>;
3650
  def int_x86_avx512_mask_getexp_ps_512 : ClangBuiltin<"__builtin_ia32_getexpps512_mask">,
3651
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3652
                            [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
3653
                             llvm_i32_ty],
3654
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3655
 
3656
  def int_x86_avx512_mask_getexp_ss : ClangBuiltin<"__builtin_ia32_getexpss128_round_mask">,
3657
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3658
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3659
                             llvm_i8_ty, llvm_i32_ty],
3660
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3661
  def int_x86_avx512_mask_getexp_sd : ClangBuiltin<"__builtin_ia32_getexpsd128_round_mask">,
3662
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3663
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3664
                             llvm_i8_ty, llvm_i32_ty],
3665
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3666
 
3667
  def int_x86_avx512_mask_getmant_pd_128 :
3668
         ClangBuiltin<"__builtin_ia32_getmantpd128_mask">,
3669
          DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3670
          [llvm_v2f64_ty,llvm_i32_ty, llvm_v2f64_ty,  llvm_i8_ty],
3671
          [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3672
 
3673
  def int_x86_avx512_mask_getmant_pd_256 :
3674
         ClangBuiltin<"__builtin_ia32_getmantpd256_mask">,
3675
          DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3676
          [llvm_v4f64_ty,llvm_i32_ty, llvm_v4f64_ty,  llvm_i8_ty],
3677
          [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3678
 
3679
  def int_x86_avx512_mask_getmant_pd_512 :
3680
         ClangBuiltin<"__builtin_ia32_getmantpd512_mask">,
3681
          DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3682
          [llvm_v8f64_ty,llvm_i32_ty, llvm_v8f64_ty,  llvm_i8_ty,llvm_i32_ty ],
3683
          [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<4>>]>;
3684
 
3685
  def int_x86_avx512_mask_getmant_ps_128 :
3686
         ClangBuiltin<"__builtin_ia32_getmantps128_mask">,
3687
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3688
          [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,  llvm_i8_ty],
3689
          [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3690
 
3691
  def int_x86_avx512_mask_getmant_ps_256 :
3692
         ClangBuiltin<"__builtin_ia32_getmantps256_mask">,
3693
          DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3694
          [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty,  llvm_i8_ty],
3695
          [IntrNoMem, ImmArg<ArgIndex<1>>]>;
3696
 
3697
  def int_x86_avx512_mask_getmant_ps_512 :
3698
         ClangBuiltin<"__builtin_ia32_getmantps512_mask">,
3699
          DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3700
          [llvm_v16f32_ty,llvm_i32_ty, llvm_v16f32_ty,llvm_i16_ty,llvm_i32_ty],
3701
          [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<4>>]>;
3702
 
3703
  def int_x86_avx512_mask_getmant_ss :
3704
         ClangBuiltin<"__builtin_ia32_getmantss_round_mask">,
3705
          DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3706
          [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
3707
           llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<5>>]>;
3708
 
3709
  def int_x86_avx512_mask_getmant_sd :
3710
         ClangBuiltin<"__builtin_ia32_getmantsd_round_mask">,
3711
          DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3712
          [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
3713
           llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<5>>]>;
3714
 
3715
  def int_x86_avx512_rsqrt14_ss : ClangBuiltin<"__builtin_ia32_rsqrt14ss_mask">,
3716
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3717
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3718
                             llvm_i8_ty],
3719
                            [IntrNoMem]>;
3720
  def int_x86_avx512_rsqrt14_sd : ClangBuiltin<"__builtin_ia32_rsqrt14sd_mask">,
3721
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3722
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3723
                             llvm_i8_ty],
3724
                            [IntrNoMem]>;
3725
 
3726
  def int_x86_avx512_rsqrt14_pd_128 : ClangBuiltin<"__builtin_ia32_rsqrt14pd128_mask">,
3727
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3728
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
3729
                            [IntrNoMem]>;
3730
  def int_x86_avx512_rsqrt14_pd_256 : ClangBuiltin<"__builtin_ia32_rsqrt14pd256_mask">,
3731
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3732
                            [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
3733
                            [IntrNoMem]>;
3734
  def int_x86_avx512_rsqrt14_pd_512 : ClangBuiltin<"__builtin_ia32_rsqrt14pd512_mask">,
3735
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3736
                            [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty],
3737
                            [IntrNoMem]>;
3738
  def int_x86_avx512_rsqrt14_ps_128 : ClangBuiltin<"__builtin_ia32_rsqrt14ps128_mask">,
3739
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3740
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
3741
                            [IntrNoMem]>;
3742
  def int_x86_avx512_rsqrt14_ps_256 : ClangBuiltin<"__builtin_ia32_rsqrt14ps256_mask">,
3743
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3744
                            [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
3745
                            [IntrNoMem]>;
3746
  def int_x86_avx512_rsqrt14_ps_512 : ClangBuiltin<"__builtin_ia32_rsqrt14ps512_mask">,
3747
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3748
                            [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty],
3749
                            [IntrNoMem]>;
3750
  def int_x86_avx512_rcp14_ss : ClangBuiltin<"__builtin_ia32_rcp14ss_mask">,
3751
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3752
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3753
                             llvm_i8_ty],
3754
                            [IntrNoMem]>;
3755
  def int_x86_avx512_rcp14_sd : ClangBuiltin<"__builtin_ia32_rcp14sd_mask">,
3756
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3757
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3758
                             llvm_i8_ty],
3759
                            [IntrNoMem]>;
3760
 
3761
  def int_x86_avx512_rcp14_pd_128 : ClangBuiltin<"__builtin_ia32_rcp14pd128_mask">,
3762
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3763
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
3764
                            [IntrNoMem]>;
3765
  def int_x86_avx512_rcp14_pd_256 : ClangBuiltin<"__builtin_ia32_rcp14pd256_mask">,
3766
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3767
                            [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
3768
                            [IntrNoMem]>;
3769
  def int_x86_avx512_rcp14_pd_512 : ClangBuiltin<"__builtin_ia32_rcp14pd512_mask">,
3770
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3771
                            [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty],
3772
                            [IntrNoMem]>;
3773
  def int_x86_avx512_rcp14_ps_128 : ClangBuiltin<"__builtin_ia32_rcp14ps128_mask">,
3774
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3775
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
3776
                            [IntrNoMem]>;
3777
  def int_x86_avx512_rcp14_ps_256 : ClangBuiltin<"__builtin_ia32_rcp14ps256_mask">,
3778
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3779
                            [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
3780
                            [IntrNoMem]>;
3781
  def int_x86_avx512_rcp14_ps_512 : ClangBuiltin<"__builtin_ia32_rcp14ps512_mask">,
3782
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3783
                            [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty],
3784
                            [IntrNoMem]>;
3785
 
3786
  def int_x86_avx512_rcp28_ps : ClangBuiltin<"__builtin_ia32_rcp28ps_mask">,
3787
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3788
                            [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
3789
                             llvm_i32_ty],
3790
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3791
  def int_x86_avx512_rcp28_pd : ClangBuiltin<"__builtin_ia32_rcp28pd_mask">,
3792
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3793
                            [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
3794
                             llvm_i32_ty],
3795
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3796
  def int_x86_avx512_exp2_ps : ClangBuiltin<"__builtin_ia32_exp2ps_mask">,
3797
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3798
                            [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
3799
                             llvm_i32_ty],
3800
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3801
  def int_x86_avx512_exp2_pd : ClangBuiltin<"__builtin_ia32_exp2pd_mask">,
3802
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3803
                            [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
3804
                             llvm_i32_ty],
3805
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3806
 
3807
  def int_x86_avx512_rcp28_ss : ClangBuiltin<"__builtin_ia32_rcp28ss_round_mask">,
3808
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3809
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3810
                             llvm_i8_ty, llvm_i32_ty],
3811
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3812
  def int_x86_avx512_rcp28_sd : ClangBuiltin<"__builtin_ia32_rcp28sd_round_mask">,
3813
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3814
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3815
                             llvm_i8_ty, llvm_i32_ty],
3816
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3817
  def int_x86_avx512_rsqrt28_ps : ClangBuiltin<"__builtin_ia32_rsqrt28ps_mask">,
3818
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
3819
                            [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty,
3820
                             llvm_i32_ty],
3821
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3822
  def int_x86_avx512_rsqrt28_pd : ClangBuiltin<"__builtin_ia32_rsqrt28pd_mask">,
3823
      DefaultAttrsIntrinsic<[llvm_v8f64_ty],
3824
                            [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty,
3825
                             llvm_i32_ty],
3826
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
3827
  def int_x86_avx512_rsqrt28_ss : ClangBuiltin<"__builtin_ia32_rsqrt28ss_round_mask">,
3828
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3829
                            [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3830
                             llvm_i8_ty, llvm_i32_ty],
3831
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3832
  def int_x86_avx512_rsqrt28_sd : ClangBuiltin<"__builtin_ia32_rsqrt28sd_round_mask">,
3833
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3834
                            [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3835
                             llvm_i8_ty, llvm_i32_ty],
3836
                            [IntrNoMem, ImmArg<ArgIndex<4>>]>;
3837
  def int_x86_avx512_psad_bw_512 : ClangBuiltin<"__builtin_ia32_psadbw512">,
3838
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
3839
                            [IntrNoMem, Commutative]>;
3840
}
3841
// Integer arithmetic ops
3842
let TargetPrefix = "x86" in {
3843
  def int_x86_avx512_pmulhu_w_512 : ClangBuiltin<"__builtin_ia32_pmulhuw512">,
3844
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
3845
                            [IntrNoMem, Commutative]>;
3846
  def int_x86_avx512_pmulh_w_512 : ClangBuiltin<"__builtin_ia32_pmulhw512">,
3847
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
3848
                            [IntrNoMem, Commutative]>;
3849
  def int_x86_avx512_pavg_b_512 : ClangBuiltin<"__builtin_ia32_pavgb512">,
3850
      DefaultAttrsIntrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
3851
                            [IntrNoMem]>;
3852
  def int_x86_avx512_pavg_w_512 : ClangBuiltin<"__builtin_ia32_pavgw512">,
3853
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
3854
                            [IntrNoMem]>;
3855
  def int_x86_avx512_pmaddw_d_512 : ClangBuiltin<"__builtin_ia32_pmaddwd512">,
3856
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
3857
                            [IntrNoMem, Commutative]>;
3858
  def int_x86_avx512_pmaddubs_w_512 : ClangBuiltin<"__builtin_ia32_pmaddubsw512">,
3859
      DefaultAttrsIntrinsic<[llvm_v32i16_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
3860
                            [IntrNoMem]>;
3861
 
3862
  def int_x86_avx512_dbpsadbw_128 :
3863
      ClangBuiltin<"__builtin_ia32_dbpsadbw128">,
3864
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
3865
                            [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
3866
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3867
 
3868
  def int_x86_avx512_dbpsadbw_256 :
3869
      ClangBuiltin<"__builtin_ia32_dbpsadbw256">,
3870
      DefaultAttrsIntrinsic<[llvm_v16i16_ty],
3871
                            [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty],
3872
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3873
 
3874
  def int_x86_avx512_dbpsadbw_512 :
3875
      ClangBuiltin<"__builtin_ia32_dbpsadbw512">,
3876
      DefaultAttrsIntrinsic<[llvm_v32i16_ty],
3877
                            [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i32_ty],
3878
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
3879
}
3880
 
3881
// Gather and Scatter ops
3882
let TargetPrefix = "x86" in {
3883
  // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
3884
  // NOTE: These can't be ArgMemOnly because you can put the address completely
3885
  // in the index register.
3886
  def int_x86_avx512_gather_dpd_512  :
3887
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
3888
                             llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3889
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3890
  def int_x86_avx512_gather_dps_512  :
3891
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
3892
                             llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
3893
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3894
  def int_x86_avx512_gather_qpd_512  :
3895
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
3896
                             llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3897
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3898
  def int_x86_avx512_gather_qps_512  :
3899
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
3900
                             llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3901
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3902
 
3903
 
3904
  def int_x86_avx512_gather_dpq_512  :
3905
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
3906
                             llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3907
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3908
  def int_x86_avx512_gather_dpi_512  :
3909
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
3910
                             llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
3911
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3912
  def int_x86_avx512_gather_qpq_512  :
3913
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
3914
                             llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3915
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3916
  def int_x86_avx512_gather_qpi_512  :
3917
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
3918
                             llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3919
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3920
 
3921
  def int_x86_avx512_gather3div2_df :
3922
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3923
          [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3924
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3925
 
3926
  def int_x86_avx512_gather3div2_di :
3927
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3928
          [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3929
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3930
 
3931
  def int_x86_avx512_gather3div4_df :
3932
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3933
          [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3934
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3935
 
3936
  def int_x86_avx512_gather3div4_di :
3937
      DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3938
          [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3939
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3940
 
3941
  def int_x86_avx512_gather3div4_sf :
3942
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3943
          [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3944
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3945
 
3946
  def int_x86_avx512_gather3div4_si :
3947
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3948
          [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3949
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3950
 
3951
  def int_x86_avx512_gather3div8_sf :
3952
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3953
          [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3954
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3955
 
3956
  def int_x86_avx512_gather3div8_si :
3957
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3958
          [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3959
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3960
 
3961
  def int_x86_avx512_gather3siv2_df :
3962
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
3963
          [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3964
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3965
 
3966
  def int_x86_avx512_gather3siv2_di:
3967
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
3968
          [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3969
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3970
 
3971
  def int_x86_avx512_gather3siv4_df :
3972
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
3973
          [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3974
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3975
 
3976
  def int_x86_avx512_gather3siv4_di :
3977
      DefaultAttrsIntrinsic<[llvm_v4i64_ty],
3978
          [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3979
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3980
 
3981
  def int_x86_avx512_gather3siv4_sf :
3982
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
3983
          [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3984
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3985
 
3986
  def int_x86_avx512_gather3siv4_si :
3987
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
3988
          [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3989
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3990
 
3991
  def int_x86_avx512_gather3siv8_sf :
3992
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
3993
          [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3994
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
3995
 
3996
  def int_x86_avx512_gather3siv8_si :
3997
      DefaultAttrsIntrinsic<[llvm_v8i32_ty],
3998
          [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3999
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4000
 
4001
// scatter
4002
  // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
4003
  // NOTE: These can't be ArgMemOnly because you can put the address completely
4004
  // in the index register.
4005
  def int_x86_avx512_scatter_dpd_512  :
4006
          Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
4007
                        llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
4008
                    [ImmArg<ArgIndex<4>>]>;
4009
  def int_x86_avx512_scatter_dps_512  :
4010
          Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
4011
                       llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
4012
                    [ImmArg<ArgIndex<4>>]>;
4013
  def int_x86_avx512_scatter_qpd_512  :
4014
          Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
4015
                     llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
4016
                    [ImmArg<ArgIndex<4>>]>;
4017
  def int_x86_avx512_scatter_qps_512  :
4018
          Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
4019
                     llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
4020
                    [ImmArg<ArgIndex<4>>]>;
4021
 
4022
 
4023
  def int_x86_avx512_scatter_dpq_512  :
4024
          Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
4025
                         llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
4026
                    [ImmArg<ArgIndex<4>>]>;
4027
  def int_x86_avx512_scatter_dpi_512  :
4028
          Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
4029
                     llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
4030
                    [ImmArg<ArgIndex<4>>]>;
4031
  def int_x86_avx512_scatter_qpq_512  :
4032
          Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,llvm_v8i64_ty, llvm_v8i64_ty,
4033
                         llvm_i32_ty],
4034
                    [ImmArg<ArgIndex<4>>]>;
4035
  def int_x86_avx512_scatter_qpi_512  :
4036
          Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_v8i32_ty,
4037
                         llvm_i32_ty],
4038
                    [ImmArg<ArgIndex<4>>]>;
4039
 
4040
  def int_x86_avx512_scatterdiv2_df :
4041
        Intrinsic<[],
4042
        [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
4043
        [ImmArg<ArgIndex<4>>]>;
4044
 
4045
  def int_x86_avx512_scatterdiv2_di :
4046
          Intrinsic<[],
4047
          [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
4048
          [ImmArg<ArgIndex<4>>]>;
4049
 
4050
  def int_x86_avx512_scatterdiv4_df :
4051
          Intrinsic<[],
4052
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
4053
          [ImmArg<ArgIndex<4>>]>;
4054
 
4055
  def int_x86_avx512_scatterdiv4_di :
4056
          Intrinsic<[],
4057
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
4058
          [ImmArg<ArgIndex<4>>]>;
4059
 
4060
  def int_x86_avx512_scatterdiv4_sf :
4061
          Intrinsic<[],
4062
          [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
4063
          [ImmArg<ArgIndex<4>>]>;
4064
 
4065
  def int_x86_avx512_scatterdiv4_si :
4066
          Intrinsic<[],
4067
          [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
4068
          [ImmArg<ArgIndex<4>>]>;
4069
 
4070
  def int_x86_avx512_scatterdiv8_sf :
4071
          Intrinsic<[],
4072
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
4073
          [ImmArg<ArgIndex<4>>]>;
4074
 
4075
  def int_x86_avx512_scatterdiv8_si :
4076
          Intrinsic<[],
4077
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
4078
          [ImmArg<ArgIndex<4>>]>;
4079
 
4080
  def int_x86_avx512_scattersiv2_df :
4081
          Intrinsic<[],
4082
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
4083
          [ImmArg<ArgIndex<4>>]>;
4084
 
4085
  def int_x86_avx512_scattersiv2_di :
4086
          Intrinsic<[],
4087
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
4088
          [ImmArg<ArgIndex<4>>]>;
4089
 
4090
  def int_x86_avx512_scattersiv4_df :
4091
          Intrinsic<[],
4092
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
4093
          [ImmArg<ArgIndex<4>>]>;
4094
 
4095
  def int_x86_avx512_scattersiv4_di :
4096
          Intrinsic<[],
4097
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
4098
          [ImmArg<ArgIndex<4>>]>;
4099
 
4100
  def int_x86_avx512_scattersiv4_sf :
4101
          Intrinsic<[],
4102
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
4103
          [ImmArg<ArgIndex<4>>]>;
4104
 
4105
  def int_x86_avx512_scattersiv4_si :
4106
          Intrinsic<[],
4107
          [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
4108
          [ImmArg<ArgIndex<4>>]>;
4109
 
4110
  def int_x86_avx512_scattersiv8_sf :
4111
          Intrinsic<[],
4112
          [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
4113
          [ImmArg<ArgIndex<4>>]>;
4114
 
4115
  def int_x86_avx512_scattersiv8_si :
4116
          Intrinsic<[],
4117
          [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
4118
          [ImmArg<ArgIndex<4>>]>;
4119
 
4120
  // gather prefetch
4121
  // NOTE: These can't be ArgMemOnly because you can put the address completely
4122
  // in the index register.
4123
  def int_x86_avx512_gatherpf_dpd_512  : ClangBuiltin<"__builtin_ia32_gatherpfdpd">,
4124
          Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
4125
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4126
  def int_x86_avx512_gatherpf_dps_512  : ClangBuiltin<"__builtin_ia32_gatherpfdps">,
4127
          Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
4128
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4129
  def int_x86_avx512_gatherpf_qpd_512  : ClangBuiltin<"__builtin_ia32_gatherpfqpd">,
4130
          Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
4131
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4132
  def int_x86_avx512_gatherpf_qps_512  : ClangBuiltin<"__builtin_ia32_gatherpfqps">,
4133
          Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
4134
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4135
 
4136
  // scatter prefetch
4137
  // NOTE: These can't be ArgMemOnly because you can put the address completely
4138
  // in the index register.
4139
  def int_x86_avx512_scatterpf_dpd_512  : ClangBuiltin<"__builtin_ia32_scatterpfdpd">,
4140
          Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
4141
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4142
  def int_x86_avx512_scatterpf_dps_512  : ClangBuiltin<"__builtin_ia32_scatterpfdps">,
4143
          Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
4144
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4145
  def int_x86_avx512_scatterpf_qpd_512  : ClangBuiltin<"__builtin_ia32_scatterpfqpd">,
4146
          Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
4147
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4148
  def int_x86_avx512_scatterpf_qps_512  : ClangBuiltin<"__builtin_ia32_scatterpfqps">,
4149
          Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
4150
                     llvm_i32_ty, llvm_i32_ty], [ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>]>;
4151
}
4152
 
4153
// AVX512 gather/scatter intrinsics that use vXi1 masks.
4154
let TargetPrefix = "x86" in {
4155
  // NOTE: These can't be ArgMemOnly because you can put the address completely
4156
  // in the index register.
4157
  def int_x86_avx512_mask_gather_dpd_512  :
4158
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
4159
                             llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
4160
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4161
  def int_x86_avx512_mask_gather_dps_512  :
4162
      DefaultAttrsIntrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
4163
                             llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
4164
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4165
  def int_x86_avx512_mask_gather_qpd_512  :
4166
      DefaultAttrsIntrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
4167
                             llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
4168
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4169
  def int_x86_avx512_mask_gather_qps_512  :
4170
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
4171
                             llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
4172
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4173
 
4174
 
4175
  def int_x86_avx512_mask_gather_dpq_512  :
4176
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
4177
                             llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
4178
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4179
  def int_x86_avx512_mask_gather_dpi_512  :
4180
      DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
4181
                             llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
4182
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4183
  def int_x86_avx512_mask_gather_qpq_512  :
4184
      DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
4185
                             llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
4186
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4187
  def int_x86_avx512_mask_gather_qpi_512  :
4188
      DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
4189
                             llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
4190
                            [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4191
 
4192
  def int_x86_avx512_mask_gather3div2_df :
4193
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
4194
          [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
4195
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4196
 
4197
  def int_x86_avx512_mask_gather3div2_di :
4198
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
4199
          [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
4200
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4201
 
4202
  def int_x86_avx512_mask_gather3div4_df :
4203
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
4204
          [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
4205
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4206
 
4207
  def int_x86_avx512_mask_gather3div4_di :
4208
      DefaultAttrsIntrinsic<[llvm_v4i64_ty],
4209
          [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
4210
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4211
 
4212
  def int_x86_avx512_mask_gather3div4_sf :
4213
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
4214
          [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
4215
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4216
 
4217
  def int_x86_avx512_mask_gather3div4_si :
4218
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4219
          [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
4220
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4221
 
4222
  def int_x86_avx512_mask_gather3div8_sf :
4223
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
4224
          [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
4225
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4226
 
4227
  def int_x86_avx512_mask_gather3div8_si :
4228
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4229
          [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
4230
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4231
 
4232
  def int_x86_avx512_mask_gather3siv2_df :
4233
      DefaultAttrsIntrinsic<[llvm_v2f64_ty],
4234
          [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
4235
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4236
 
4237
  def int_x86_avx512_mask_gather3siv2_di :
4238
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
4239
          [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
4240
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4241
 
4242
  def int_x86_avx512_mask_gather3siv4_df :
4243
      DefaultAttrsIntrinsic<[llvm_v4f64_ty],
4244
          [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
4245
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4246
 
4247
  def int_x86_avx512_mask_gather3siv4_di :
4248
      DefaultAttrsIntrinsic<[llvm_v4i64_ty],
4249
          [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
4250
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4251
 
4252
  def int_x86_avx512_mask_gather3siv4_sf :
4253
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
4254
          [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
4255
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4256
 
4257
  def int_x86_avx512_mask_gather3siv4_si :
4258
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4259
          [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
4260
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4261
 
4262
  def int_x86_avx512_mask_gather3siv8_sf :
4263
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
4264
          [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
4265
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4266
 
4267
  def int_x86_avx512_mask_gather3siv8_si :
4268
      DefaultAttrsIntrinsic<[llvm_v8i32_ty],
4269
          [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
4270
          [IntrReadMem, ImmArg<ArgIndex<4>>]>;
4271
 
4272
  def int_x86_avx512_mask_scatter_dpd_512  :
4273
          Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
4274
                        llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
4275
                    [ImmArg<ArgIndex<4>>]>;
4276
  def int_x86_avx512_mask_scatter_dps_512  :
4277
          Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
4278
                       llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
4279
                    [ImmArg<ArgIndex<4>>]>;
4280
  def int_x86_avx512_mask_scatter_qpd_512  :
4281
          Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
4282
                     llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
4283
                    [ImmArg<ArgIndex<4>>]>;
4284
  def int_x86_avx512_mask_scatter_qps_512  :
4285
          Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
4286
                     llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
4287
                    [ImmArg<ArgIndex<4>>]>;
4288
 
4289
 
4290
  // NOTE: These can't be ArgMemOnly because you can put the address completely
4291
  // in the index register.
4292
  def int_x86_avx512_mask_scatter_dpq_512  :
4293
          Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
4294
                         llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
4295
                    [ImmArg<ArgIndex<4>>]>;
4296
  def int_x86_avx512_mask_scatter_dpi_512  :
4297
          Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
4298
                     llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
4299
                    [ImmArg<ArgIndex<4>>]>;
4300
  def int_x86_avx512_mask_scatter_qpq_512  :
4301
          Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,llvm_v8i64_ty, llvm_v8i64_ty,
4302
                         llvm_i32_ty],
4303
                    [ImmArg<ArgIndex<4>>]>;
4304
  def int_x86_avx512_mask_scatter_qpi_512  :
4305
          Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i64_ty, llvm_v8i32_ty,
4306
                         llvm_i32_ty],
4307
                    [ImmArg<ArgIndex<4>>]>;
4308
 
4309
  def int_x86_avx512_mask_scatterdiv2_df :
4310
        Intrinsic<[],
4311
        [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
4312
        [ImmArg<ArgIndex<4>>]>;
4313
 
4314
  def int_x86_avx512_mask_scatterdiv2_di :
4315
          Intrinsic<[],
4316
          [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
4317
          [ImmArg<ArgIndex<4>>]>;
4318
 
4319
  def int_x86_avx512_mask_scatterdiv4_df :
4320
          Intrinsic<[],
4321
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
4322
          [ImmArg<ArgIndex<4>>]>;
4323
 
4324
  def int_x86_avx512_mask_scatterdiv4_di :
4325
          Intrinsic<[],
4326
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
4327
          [ImmArg<ArgIndex<4>>]>;
4328
 
4329
  def int_x86_avx512_mask_scatterdiv4_sf :
4330
          Intrinsic<[],
4331
          [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
4332
          [ImmArg<ArgIndex<4>>]>;
4333
 
4334
  def int_x86_avx512_mask_scatterdiv4_si :
4335
          Intrinsic<[],
4336
          [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
4337
          [ImmArg<ArgIndex<4>>]>;
4338
 
4339
  def int_x86_avx512_mask_scatterdiv8_sf :
4340
          Intrinsic<[],
4341
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
4342
          [ImmArg<ArgIndex<4>>]>;
4343
 
4344
  def int_x86_avx512_mask_scatterdiv8_si :
4345
          Intrinsic<[],
4346
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
4347
          [ImmArg<ArgIndex<4>>]>;
4348
 
4349
  def int_x86_avx512_mask_scattersiv2_df :
4350
          Intrinsic<[],
4351
          [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
4352
          [ImmArg<ArgIndex<4>>]>;
4353
 
4354
  def int_x86_avx512_mask_scattersiv2_di :
4355
          Intrinsic<[],
4356
          [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
4357
          [ImmArg<ArgIndex<4>>]>;
4358
 
4359
  def int_x86_avx512_mask_scattersiv4_df :
4360
          Intrinsic<[],
4361
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
4362
          [ImmArg<ArgIndex<4>>]>;
4363
 
4364
  def int_x86_avx512_mask_scattersiv4_di :
4365
          Intrinsic<[],
4366
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
4367
          [ImmArg<ArgIndex<4>>]>;
4368
 
4369
  def int_x86_avx512_mask_scattersiv4_sf :
4370
          Intrinsic<[],
4371
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
4372
          [ImmArg<ArgIndex<4>>]>;
4373
 
4374
  def int_x86_avx512_mask_scattersiv4_si :
4375
          Intrinsic<[],
4376
          [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
4377
          [ImmArg<ArgIndex<4>>]>;
4378
 
4379
  def int_x86_avx512_mask_scattersiv8_sf :
4380
          Intrinsic<[],
4381
          [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
4382
          [ImmArg<ArgIndex<4>>]>;
4383
 
4384
  def int_x86_avx512_mask_scattersiv8_si :
4385
          Intrinsic<[],
4386
          [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
4387
          [ImmArg<ArgIndex<4>>]>;
4388
}
4389
 
4390
// AVX-512 conflict detection instruction
4391
// Instructions that count the number of leading zero bits
4392
let TargetPrefix = "x86" in {
4393
  def int_x86_avx512_conflict_d_128 :
4394
          ClangBuiltin<"__builtin_ia32_vpconflictsi_128">,
4395
          DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
4396
  def int_x86_avx512_conflict_d_256 :
4397
          ClangBuiltin<"__builtin_ia32_vpconflictsi_256">,
4398
          DefaultAttrsIntrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty], [IntrNoMem]>;
4399
  def int_x86_avx512_conflict_d_512 :
4400
          ClangBuiltin<"__builtin_ia32_vpconflictsi_512">,
4401
          DefaultAttrsIntrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty],
4402
                                [IntrNoMem]>;
4403
 
4404
  def int_x86_avx512_conflict_q_128 :
4405
          ClangBuiltin<"__builtin_ia32_vpconflictdi_128">,
4406
          DefaultAttrsIntrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
4407
  def int_x86_avx512_conflict_q_256 :
4408
          ClangBuiltin<"__builtin_ia32_vpconflictdi_256">,
4409
          DefaultAttrsIntrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty], [IntrNoMem]>;
4410
  def int_x86_avx512_conflict_q_512 :
4411
          ClangBuiltin<"__builtin_ia32_vpconflictdi_512">,
4412
          DefaultAttrsIntrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty], [IntrNoMem]>;
4413
}
4414
 
4415
// Compares
4416
let TargetPrefix = "x86" in {
4417
  // 512-bit
4418
  def int_x86_avx512_vcomi_sd : ClangBuiltin<"__builtin_ia32_vcomisd">,
4419
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
4420
                             llvm_v2f64_ty, llvm_i32_ty, llvm_i32_ty],
4421
                            [IntrNoMem, ImmArg<ArgIndex<2>>,
4422
                             ImmArg<ArgIndex<3>>]>;
4423
  def int_x86_avx512_vcomi_ss : ClangBuiltin<"__builtin_ia32_vcomiss">,
4424
      DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
4425
                             llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
4426
                            [IntrNoMem, ImmArg<ArgIndex<2>>,
4427
                             ImmArg<ArgIndex<3>>]>;
4428
}
4429
 
4430
// Compress, Expand
4431
let TargetPrefix = "x86" in {
4432
  def int_x86_avx512_mask_compress :
4433
      DefaultAttrsIntrinsic<[llvm_anyvector_ty],
4434
                            [LLVMMatchType<0>, LLVMMatchType<0>,
4435
                             LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
4436
                            [IntrNoMem]>;
4437
  def int_x86_avx512_mask_expand :
4438
      DefaultAttrsIntrinsic<[llvm_anyvector_ty],
4439
                            [LLVMMatchType<0>, LLVMMatchType<0>,
4440
                             LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
4441
                            [IntrNoMem]>;
4442
}
4443
 
4444
// truncate
4445
let TargetPrefix = "x86" in {
4446
  def int_x86_avx512_mask_pmov_qb_128 :
4447
      ClangBuiltin<"__builtin_ia32_pmovqb128_mask">,
4448
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4449
                            [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4450
                            [IntrNoMem]>;
4451
  def int_x86_avx512_mask_pmov_qb_mem_128 :
4452
      ClangBuiltin<"__builtin_ia32_pmovqb128mem_mask">,
4453
      DefaultAttrsIntrinsic<[],
4454
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4455
                            [IntrArgMemOnly]>;
4456
  def int_x86_avx512_mask_pmovs_qb_128 :
4457
      ClangBuiltin<"__builtin_ia32_pmovsqb128_mask">,
4458
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4459
                            [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4460
                            [IntrNoMem]>;
4461
  def int_x86_avx512_mask_pmovs_qb_mem_128 :
4462
      ClangBuiltin<"__builtin_ia32_pmovsqb128mem_mask">,
4463
      DefaultAttrsIntrinsic<[],
4464
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4465
                            [IntrArgMemOnly]>;
4466
  def int_x86_avx512_mask_pmovus_qb_128 :
4467
      ClangBuiltin<"__builtin_ia32_pmovusqb128_mask">,
4468
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4469
                            [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4470
                            [IntrNoMem]>;
4471
  def int_x86_avx512_mask_pmovus_qb_mem_128 :
4472
      ClangBuiltin<"__builtin_ia32_pmovusqb128mem_mask">,
4473
      DefaultAttrsIntrinsic<[],
4474
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4475
                            [IntrArgMemOnly]>;
4476
  def int_x86_avx512_mask_pmov_qb_256 :
4477
      ClangBuiltin<"__builtin_ia32_pmovqb256_mask">,
4478
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4479
                            [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4480
                            [IntrNoMem]>;
4481
  def int_x86_avx512_mask_pmov_qb_mem_256 :
4482
      ClangBuiltin<"__builtin_ia32_pmovqb256mem_mask">,
4483
      DefaultAttrsIntrinsic<[],
4484
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4485
                            [IntrArgMemOnly]>;
4486
  def int_x86_avx512_mask_pmovs_qb_256 :
4487
      ClangBuiltin<"__builtin_ia32_pmovsqb256_mask">,
4488
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4489
                            [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4490
                            [IntrNoMem]>;
4491
  def int_x86_avx512_mask_pmovs_qb_mem_256 :
4492
      ClangBuiltin<"__builtin_ia32_pmovsqb256mem_mask">,
4493
      DefaultAttrsIntrinsic<[],
4494
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4495
                            [IntrArgMemOnly]>;
4496
  def int_x86_avx512_mask_pmovus_qb_256 :
4497
      ClangBuiltin<"__builtin_ia32_pmovusqb256_mask">,
4498
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4499
                            [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4500
                            [IntrNoMem]>;
4501
  def int_x86_avx512_mask_pmovus_qb_mem_256 :
4502
      ClangBuiltin<"__builtin_ia32_pmovusqb256mem_mask">,
4503
      DefaultAttrsIntrinsic<[],
4504
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4505
                            [IntrArgMemOnly]>;
4506
  def int_x86_avx512_mask_pmov_qb_512 :
4507
      ClangBuiltin<"__builtin_ia32_pmovqb512_mask">,
4508
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4509
                            [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4510
                            [IntrNoMem]>;
4511
  def int_x86_avx512_mask_pmov_qb_mem_512 :
4512
      ClangBuiltin<"__builtin_ia32_pmovqb512mem_mask">,
4513
      DefaultAttrsIntrinsic<[],
4514
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4515
                            [IntrArgMemOnly]>;
4516
  def int_x86_avx512_mask_pmovs_qb_512 :
4517
      ClangBuiltin<"__builtin_ia32_pmovsqb512_mask">,
4518
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4519
                            [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4520
                            [IntrNoMem]>;
4521
  def int_x86_avx512_mask_pmovs_qb_mem_512 :
4522
      ClangBuiltin<"__builtin_ia32_pmovsqb512mem_mask">,
4523
      DefaultAttrsIntrinsic<[],
4524
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4525
                            [IntrArgMemOnly]>;
4526
  def int_x86_avx512_mask_pmovus_qb_512 :
4527
      ClangBuiltin<"__builtin_ia32_pmovusqb512_mask">,
4528
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4529
                            [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4530
                            [IntrNoMem]>;
4531
  def int_x86_avx512_mask_pmovus_qb_mem_512 :
4532
      ClangBuiltin<"__builtin_ia32_pmovusqb512mem_mask">,
4533
      DefaultAttrsIntrinsic<[],
4534
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4535
                            [IntrArgMemOnly]>;
4536
  def int_x86_avx512_mask_pmov_qw_128 :
4537
      ClangBuiltin<"__builtin_ia32_pmovqw128_mask">,
4538
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4539
                            [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4540
                            [IntrNoMem]>;
4541
  def int_x86_avx512_mask_pmov_qw_mem_128 :
4542
      ClangBuiltin<"__builtin_ia32_pmovqw128mem_mask">,
4543
      DefaultAttrsIntrinsic<[],
4544
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4545
                            [IntrArgMemOnly]>;
4546
  def int_x86_avx512_mask_pmovs_qw_128 :
4547
      ClangBuiltin<"__builtin_ia32_pmovsqw128_mask">,
4548
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4549
                            [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4550
                            [IntrNoMem]>;
4551
  def int_x86_avx512_mask_pmovs_qw_mem_128 :
4552
      ClangBuiltin<"__builtin_ia32_pmovsqw128mem_mask">,
4553
      DefaultAttrsIntrinsic<[],
4554
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4555
                            [IntrArgMemOnly]>;
4556
  def int_x86_avx512_mask_pmovus_qw_128 :
4557
      ClangBuiltin<"__builtin_ia32_pmovusqw128_mask">,
4558
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4559
                            [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4560
                            [IntrNoMem]>;
4561
  def int_x86_avx512_mask_pmovus_qw_mem_128 :
4562
      ClangBuiltin<"__builtin_ia32_pmovusqw128mem_mask">,
4563
      DefaultAttrsIntrinsic<[],
4564
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4565
                            [IntrArgMemOnly]>;
4566
  def int_x86_avx512_mask_pmov_qw_256 :
4567
      ClangBuiltin<"__builtin_ia32_pmovqw256_mask">,
4568
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4569
                            [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4570
                            [IntrNoMem]>;
4571
  def int_x86_avx512_mask_pmov_qw_mem_256 :
4572
      ClangBuiltin<"__builtin_ia32_pmovqw256mem_mask">,
4573
      DefaultAttrsIntrinsic<[],
4574
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4575
                            [IntrArgMemOnly]>;
4576
  def int_x86_avx512_mask_pmovs_qw_256 :
4577
      ClangBuiltin<"__builtin_ia32_pmovsqw256_mask">,
4578
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4579
                            [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4580
                            [IntrNoMem]>;
4581
  def int_x86_avx512_mask_pmovs_qw_mem_256 :
4582
      ClangBuiltin<"__builtin_ia32_pmovsqw256mem_mask">,
4583
      DefaultAttrsIntrinsic<[],
4584
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4585
                            [IntrArgMemOnly]>;
4586
  def int_x86_avx512_mask_pmovus_qw_256 :
4587
      ClangBuiltin<"__builtin_ia32_pmovusqw256_mask">,
4588
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4589
                            [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4590
                            [IntrNoMem]>;
4591
  def int_x86_avx512_mask_pmovus_qw_mem_256 :
4592
      ClangBuiltin<"__builtin_ia32_pmovusqw256mem_mask">,
4593
      DefaultAttrsIntrinsic<[],
4594
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4595
                            [IntrArgMemOnly]>;
4596
  def int_x86_avx512_mask_pmov_qw_512 :
4597
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4598
                            [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4599
                            [IntrNoMem]>;
4600
  def int_x86_avx512_mask_pmov_qw_mem_512 :
4601
      ClangBuiltin<"__builtin_ia32_pmovqw512mem_mask">,
4602
      DefaultAttrsIntrinsic<[],
4603
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4604
                            [IntrArgMemOnly]>;
4605
  def int_x86_avx512_mask_pmovs_qw_512 :
4606
      ClangBuiltin<"__builtin_ia32_pmovsqw512_mask">,
4607
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4608
                            [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4609
                            [IntrNoMem]>;
4610
  def int_x86_avx512_mask_pmovs_qw_mem_512 :
4611
      ClangBuiltin<"__builtin_ia32_pmovsqw512mem_mask">,
4612
      DefaultAttrsIntrinsic<[],
4613
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4614
                            [IntrArgMemOnly]>;
4615
  def int_x86_avx512_mask_pmovus_qw_512 :
4616
      ClangBuiltin<"__builtin_ia32_pmovusqw512_mask">,
4617
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4618
                            [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4619
                            [IntrNoMem]>;
4620
  def int_x86_avx512_mask_pmovus_qw_mem_512 :
4621
      ClangBuiltin<"__builtin_ia32_pmovusqw512mem_mask">,
4622
      DefaultAttrsIntrinsic<[],
4623
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4624
                            [IntrArgMemOnly]>;
4625
  def int_x86_avx512_mask_pmov_qd_128 :
4626
      ClangBuiltin<"__builtin_ia32_pmovqd128_mask">,
4627
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4628
                            [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4629
                            [IntrNoMem]>;
4630
  def int_x86_avx512_mask_pmov_qd_mem_128 :
4631
      ClangBuiltin<"__builtin_ia32_pmovqd128mem_mask">,
4632
      DefaultAttrsIntrinsic<[],
4633
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4634
                            [IntrArgMemOnly]>;
4635
  def int_x86_avx512_mask_pmovs_qd_128 :
4636
      ClangBuiltin<"__builtin_ia32_pmovsqd128_mask">,
4637
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4638
                            [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4639
                            [IntrNoMem]>;
4640
  def int_x86_avx512_mask_pmovs_qd_mem_128 :
4641
      ClangBuiltin<"__builtin_ia32_pmovsqd128mem_mask">,
4642
      DefaultAttrsIntrinsic<[],
4643
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4644
                            [IntrArgMemOnly]>;
4645
  def int_x86_avx512_mask_pmovus_qd_128 :
4646
      ClangBuiltin<"__builtin_ia32_pmovusqd128_mask">,
4647
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4648
                            [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4649
                            [IntrNoMem]>;
4650
  def int_x86_avx512_mask_pmovus_qd_mem_128 :
4651
      ClangBuiltin<"__builtin_ia32_pmovusqd128mem_mask">,
4652
      DefaultAttrsIntrinsic<[],
4653
                            [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4654
                            [IntrArgMemOnly]>;
4655
  def int_x86_avx512_mask_pmov_qd_mem_256 :
4656
      ClangBuiltin<"__builtin_ia32_pmovqd256mem_mask">,
4657
      DefaultAttrsIntrinsic<[],
4658
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4659
                            [IntrArgMemOnly]>;
4660
  def int_x86_avx512_mask_pmovs_qd_256 :
4661
      ClangBuiltin<"__builtin_ia32_pmovsqd256_mask">,
4662
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4663
                            [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4664
                            [IntrNoMem]>;
4665
  def int_x86_avx512_mask_pmovs_qd_mem_256 :
4666
      ClangBuiltin<"__builtin_ia32_pmovsqd256mem_mask">,
4667
      DefaultAttrsIntrinsic<[],
4668
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4669
                            [IntrArgMemOnly]>;
4670
  def int_x86_avx512_mask_pmovus_qd_256 :
4671
      ClangBuiltin<"__builtin_ia32_pmovusqd256_mask">,
4672
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4673
                            [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4674
                            [IntrNoMem]>;
4675
  def int_x86_avx512_mask_pmovus_qd_mem_256 :
4676
      ClangBuiltin<"__builtin_ia32_pmovusqd256mem_mask">,
4677
      DefaultAttrsIntrinsic<[],
4678
                            [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4679
                            [IntrArgMemOnly]>;
4680
  def int_x86_avx512_mask_pmov_qd_mem_512 :
4681
      ClangBuiltin<"__builtin_ia32_pmovqd512mem_mask">,
4682
      DefaultAttrsIntrinsic<[],
4683
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4684
                            [IntrArgMemOnly]>;
4685
  def int_x86_avx512_mask_pmovs_qd_512 :
4686
      ClangBuiltin<"__builtin_ia32_pmovsqd512_mask">,
4687
      DefaultAttrsIntrinsic<[llvm_v8i32_ty],
4688
                            [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
4689
                            [IntrNoMem]>;
4690
  def int_x86_avx512_mask_pmovs_qd_mem_512 :
4691
      ClangBuiltin<"__builtin_ia32_pmovsqd512mem_mask">,
4692
      DefaultAttrsIntrinsic<[],
4693
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4694
                            [IntrArgMemOnly]>;
4695
  def int_x86_avx512_mask_pmovus_qd_512 :
4696
      ClangBuiltin<"__builtin_ia32_pmovusqd512_mask">,
4697
      DefaultAttrsIntrinsic<[llvm_v8i32_ty],
4698
                            [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
4699
                            [IntrNoMem]>;
4700
  def int_x86_avx512_mask_pmovus_qd_mem_512 :
4701
      ClangBuiltin<"__builtin_ia32_pmovusqd512mem_mask">,
4702
      DefaultAttrsIntrinsic<[],
4703
                            [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4704
                            [IntrArgMemOnly]>;
4705
  def int_x86_avx512_mask_pmov_db_128 :
4706
      ClangBuiltin<"__builtin_ia32_pmovdb128_mask">,
4707
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4708
                            [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4709
                            [IntrNoMem]>;
4710
  def int_x86_avx512_mask_pmov_db_mem_128 :
4711
      ClangBuiltin<"__builtin_ia32_pmovdb128mem_mask">,
4712
      DefaultAttrsIntrinsic<[],
4713
                            [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4714
                            [IntrArgMemOnly]>;
4715
  def int_x86_avx512_mask_pmovs_db_128 :
4716
      ClangBuiltin<"__builtin_ia32_pmovsdb128_mask">,
4717
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4718
                            [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4719
                            [IntrNoMem]>;
4720
  def int_x86_avx512_mask_pmovs_db_mem_128 :
4721
      ClangBuiltin<"__builtin_ia32_pmovsdb128mem_mask">,
4722
      DefaultAttrsIntrinsic<[],
4723
                            [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4724
                            [IntrArgMemOnly]>;
4725
  def int_x86_avx512_mask_pmovus_db_128 :
4726
      ClangBuiltin<"__builtin_ia32_pmovusdb128_mask">,
4727
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4728
                            [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4729
                            [IntrNoMem]>;
4730
  def int_x86_avx512_mask_pmovus_db_mem_128 :
4731
      ClangBuiltin<"__builtin_ia32_pmovusdb128mem_mask">,
4732
      DefaultAttrsIntrinsic<[],
4733
                            [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4734
                            [IntrArgMemOnly]>;
4735
  def int_x86_avx512_mask_pmov_db_256 :
4736
      ClangBuiltin<"__builtin_ia32_pmovdb256_mask">,
4737
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4738
                            [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4739
                            [IntrNoMem]>;
4740
  def int_x86_avx512_mask_pmov_db_mem_256 :
4741
      ClangBuiltin<"__builtin_ia32_pmovdb256mem_mask">,
4742
      DefaultAttrsIntrinsic<[],
4743
                            [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4744
                            [IntrArgMemOnly]>;
4745
  def int_x86_avx512_mask_pmovs_db_256 :
4746
      ClangBuiltin<"__builtin_ia32_pmovsdb256_mask">,
4747
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4748
                            [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4749
                            [IntrNoMem]>;
4750
  def int_x86_avx512_mask_pmovs_db_mem_256 :
4751
      ClangBuiltin<"__builtin_ia32_pmovsdb256mem_mask">,
4752
      DefaultAttrsIntrinsic<[],
4753
                            [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4754
                            [IntrArgMemOnly]>;
4755
  def int_x86_avx512_mask_pmovus_db_256 :
4756
      ClangBuiltin<"__builtin_ia32_pmovusdb256_mask">,
4757
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4758
                            [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4759
                            [IntrNoMem]>;
4760
  def int_x86_avx512_mask_pmovus_db_mem_256 :
4761
      ClangBuiltin<"__builtin_ia32_pmovusdb256mem_mask">,
4762
      DefaultAttrsIntrinsic<[],
4763
                            [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4764
                            [IntrArgMemOnly]>;
4765
  def int_x86_avx512_mask_pmov_db_512 :
4766
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4767
                            [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
4768
                            [IntrNoMem]>;
4769
  def int_x86_avx512_mask_pmov_db_mem_512 :
4770
      ClangBuiltin<"__builtin_ia32_pmovdb512mem_mask">,
4771
      DefaultAttrsIntrinsic<[],
4772
                            [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4773
                            [IntrArgMemOnly]>;
4774
  def int_x86_avx512_mask_pmovs_db_512 :
4775
      ClangBuiltin<"__builtin_ia32_pmovsdb512_mask">,
4776
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4777
                            [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
4778
                            [IntrNoMem]>;
4779
  def int_x86_avx512_mask_pmovs_db_mem_512 :
4780
      ClangBuiltin<"__builtin_ia32_pmovsdb512mem_mask">,
4781
      DefaultAttrsIntrinsic<[],
4782
                            [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4783
                            [IntrArgMemOnly]>;
4784
  def int_x86_avx512_mask_pmovus_db_512 :
4785
      ClangBuiltin<"__builtin_ia32_pmovusdb512_mask">,
4786
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4787
                            [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
4788
                            [IntrNoMem]>;
4789
  def int_x86_avx512_mask_pmovus_db_mem_512 :
4790
      ClangBuiltin<"__builtin_ia32_pmovusdb512mem_mask">,
4791
      DefaultAttrsIntrinsic<[],
4792
                            [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4793
                            [IntrArgMemOnly]>;
4794
  def int_x86_avx512_mask_pmov_dw_128 :
4795
      ClangBuiltin<"__builtin_ia32_pmovdw128_mask">,
4796
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4797
                            [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4798
                            [IntrNoMem]>;
4799
  def int_x86_avx512_mask_pmov_dw_mem_128 :
4800
      ClangBuiltin<"__builtin_ia32_pmovdw128mem_mask">,
4801
      DefaultAttrsIntrinsic<[],
4802
                            [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4803
                            [IntrArgMemOnly]>;
4804
  def int_x86_avx512_mask_pmovs_dw_128 :
4805
      ClangBuiltin<"__builtin_ia32_pmovsdw128_mask">,
4806
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4807
                            [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4808
                            [IntrNoMem]>;
4809
  def int_x86_avx512_mask_pmovs_dw_mem_128 :
4810
      ClangBuiltin<"__builtin_ia32_pmovsdw128mem_mask">,
4811
      DefaultAttrsIntrinsic<[],
4812
                            [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4813
                            [IntrArgMemOnly]>;
4814
  def int_x86_avx512_mask_pmovus_dw_128 :
4815
      ClangBuiltin<"__builtin_ia32_pmovusdw128_mask">,
4816
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4817
                            [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4818
                            [IntrNoMem]>;
4819
  def int_x86_avx512_mask_pmovus_dw_mem_128 :
4820
      ClangBuiltin<"__builtin_ia32_pmovusdw128mem_mask">,
4821
      DefaultAttrsIntrinsic<[],
4822
                            [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4823
                            [IntrArgMemOnly]>;
4824
  def int_x86_avx512_mask_pmov_dw_256 :
4825
      ClangBuiltin<"__builtin_ia32_pmovdw256_mask">,
4826
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4827
                            [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4828
                            [IntrNoMem]>;
4829
  def int_x86_avx512_mask_pmov_dw_mem_256 :
4830
      ClangBuiltin<"__builtin_ia32_pmovdw256mem_mask">,
4831
      DefaultAttrsIntrinsic<[],
4832
                            [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4833
                            [IntrArgMemOnly]>;
4834
  def int_x86_avx512_mask_pmovs_dw_256 :
4835
      ClangBuiltin<"__builtin_ia32_pmovsdw256_mask">,
4836
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4837
                            [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4838
                            [IntrNoMem]>;
4839
  def int_x86_avx512_mask_pmovs_dw_mem_256 :
4840
      ClangBuiltin<"__builtin_ia32_pmovsdw256mem_mask">,
4841
      DefaultAttrsIntrinsic<[],
4842
                            [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4843
                            [IntrArgMemOnly]>;
4844
  def int_x86_avx512_mask_pmovus_dw_256 :
4845
      ClangBuiltin<"__builtin_ia32_pmovusdw256_mask">,
4846
      DefaultAttrsIntrinsic<[llvm_v8i16_ty],
4847
                            [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4848
                            [IntrNoMem]>;
4849
  def int_x86_avx512_mask_pmovus_dw_mem_256 :
4850
      ClangBuiltin<"__builtin_ia32_pmovusdw256mem_mask">,
4851
      DefaultAttrsIntrinsic<[],
4852
                            [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4853
                            [IntrArgMemOnly]>;
4854
  def int_x86_avx512_mask_pmov_dw_512 :
4855
      DefaultAttrsIntrinsic<[llvm_v16i16_ty],
4856
                            [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
4857
                            [IntrNoMem]>;
4858
  def int_x86_avx512_mask_pmov_dw_mem_512 :
4859
      ClangBuiltin<"__builtin_ia32_pmovdw512mem_mask">,
4860
      DefaultAttrsIntrinsic<[],
4861
                            [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4862
                            [IntrArgMemOnly]>;
4863
  def int_x86_avx512_mask_pmovs_dw_512 :
4864
      ClangBuiltin<"__builtin_ia32_pmovsdw512_mask">,
4865
      DefaultAttrsIntrinsic<[llvm_v16i16_ty],
4866
                            [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
4867
                            [IntrNoMem]>;
4868
  def int_x86_avx512_mask_pmovs_dw_mem_512 :
4869
      ClangBuiltin<"__builtin_ia32_pmovsdw512mem_mask">,
4870
      DefaultAttrsIntrinsic<[],
4871
                            [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4872
                            [IntrArgMemOnly]>;
4873
  def int_x86_avx512_mask_pmovus_dw_512 :
4874
      ClangBuiltin<"__builtin_ia32_pmovusdw512_mask">,
4875
      DefaultAttrsIntrinsic<[llvm_v16i16_ty],
4876
                            [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
4877
                            [IntrNoMem]>;
4878
  def int_x86_avx512_mask_pmovus_dw_mem_512 :
4879
      ClangBuiltin<"__builtin_ia32_pmovusdw512mem_mask">,
4880
      DefaultAttrsIntrinsic<[],
4881
                            [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4882
                            [IntrArgMemOnly]>;
4883
  def int_x86_avx512_mask_pmov_wb_128 :
4884
      ClangBuiltin<"__builtin_ia32_pmovwb128_mask">,
4885
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4886
                            [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
4887
                            [IntrNoMem]>;
4888
  def int_x86_avx512_mask_pmov_wb_mem_128 :
4889
      ClangBuiltin<"__builtin_ia32_pmovwb128mem_mask">,
4890
      DefaultAttrsIntrinsic<[],
4891
                            [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
4892
                            [IntrArgMemOnly]>;
4893
  def int_x86_avx512_mask_pmovs_wb_128 :
4894
      ClangBuiltin<"__builtin_ia32_pmovswb128_mask">,
4895
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4896
                            [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
4897
                            [IntrNoMem]>;
4898
  def int_x86_avx512_mask_pmovs_wb_mem_128 :
4899
      ClangBuiltin<"__builtin_ia32_pmovswb128mem_mask">,
4900
      DefaultAttrsIntrinsic<[],
4901
                            [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
4902
                            [IntrArgMemOnly]>;
4903
  def int_x86_avx512_mask_pmovus_wb_128 :
4904
      ClangBuiltin<"__builtin_ia32_pmovuswb128_mask">,
4905
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4906
                            [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
4907
                            [IntrNoMem]>;
4908
  def int_x86_avx512_mask_pmovus_wb_mem_128 :
4909
      ClangBuiltin<"__builtin_ia32_pmovuswb128mem_mask">,
4910
      DefaultAttrsIntrinsic<[],
4911
                            [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
4912
                            [IntrArgMemOnly]>;
4913
  def int_x86_avx512_mask_pmov_wb_mem_256 :
4914
      ClangBuiltin<"__builtin_ia32_pmovwb256mem_mask">,
4915
      DefaultAttrsIntrinsic<[],
4916
                            [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
4917
                            [IntrArgMemOnly]>;
4918
  def int_x86_avx512_mask_pmovs_wb_256 :
4919
      ClangBuiltin<"__builtin_ia32_pmovswb256_mask">,
4920
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4921
                            [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
4922
                            [IntrNoMem]>;
4923
  def int_x86_avx512_mask_pmovs_wb_mem_256 :
4924
      ClangBuiltin<"__builtin_ia32_pmovswb256mem_mask">,
4925
      DefaultAttrsIntrinsic<[],
4926
                          [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
4927
                          [IntrArgMemOnly]>;
4928
  def int_x86_avx512_mask_pmovus_wb_256 :
4929
      ClangBuiltin<"__builtin_ia32_pmovuswb256_mask">,
4930
      DefaultAttrsIntrinsic<[llvm_v16i8_ty],
4931
                            [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
4932
                            [IntrNoMem]>;
4933
  def int_x86_avx512_mask_pmovus_wb_mem_256 :
4934
      ClangBuiltin<"__builtin_ia32_pmovuswb256mem_mask">,
4935
      DefaultAttrsIntrinsic<[],
4936
                          [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
4937
                          [IntrArgMemOnly]>;
4938
  def int_x86_avx512_mask_pmov_wb_mem_512 :
4939
      ClangBuiltin<"__builtin_ia32_pmovwb512mem_mask">,
4940
      DefaultAttrsIntrinsic<[],
4941
                            [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
4942
                            [IntrArgMemOnly]>;
4943
  def int_x86_avx512_mask_pmovs_wb_512 :
4944
      ClangBuiltin<"__builtin_ia32_pmovswb512_mask">,
4945
      DefaultAttrsIntrinsic<[llvm_v32i8_ty],
4946
                            [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
4947
                            [IntrNoMem]>;
4948
  def int_x86_avx512_mask_pmovs_wb_mem_512 :
4949
      ClangBuiltin<"__builtin_ia32_pmovswb512mem_mask">,
4950
      DefaultAttrsIntrinsic<[],
4951
                            [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
4952
                            [IntrArgMemOnly]>;
4953
  def int_x86_avx512_mask_pmovus_wb_512 :
4954
      ClangBuiltin<"__builtin_ia32_pmovuswb512_mask">,
4955
      DefaultAttrsIntrinsic<[llvm_v32i8_ty],
4956
                            [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
4957
                            [IntrNoMem]>;
4958
  def int_x86_avx512_mask_pmovus_wb_mem_512 :
4959
      ClangBuiltin<"__builtin_ia32_pmovuswb512mem_mask">,
4960
      DefaultAttrsIntrinsic<[],
4961
                            [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
4962
                            [IntrArgMemOnly]>;
4963
}
4964
 
4965
// Bitwise ternary logic
4966
let TargetPrefix = "x86" in {
4967
  def int_x86_avx512_pternlog_d_128 :
4968
      ClangBuiltin<"__builtin_ia32_pternlogd128">,
4969
      DefaultAttrsIntrinsic<[llvm_v4i32_ty],
4970
                            [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty,
4971
                             llvm_i32_ty],
4972
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
4973
 
4974
  def int_x86_avx512_pternlog_d_256 :
4975
      ClangBuiltin<"__builtin_ia32_pternlogd256">,
4976
      DefaultAttrsIntrinsic<[llvm_v8i32_ty],
4977
                            [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty,
4978
                             llvm_i32_ty],
4979
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
4980
 
4981
  def int_x86_avx512_pternlog_d_512 :
4982
      ClangBuiltin<"__builtin_ia32_pternlogd512">,
4983
      DefaultAttrsIntrinsic<[llvm_v16i32_ty],
4984
                            [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty,
4985
                             llvm_i32_ty], [IntrNoMem, ImmArg<ArgIndex<3>>]>;
4986
 
4987
  def int_x86_avx512_pternlog_q_128 :
4988
      ClangBuiltin<"__builtin_ia32_pternlogq128">,
4989
      DefaultAttrsIntrinsic<[llvm_v2i64_ty],
4990
                            [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
4991
                             llvm_i32_ty],
4992
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
4993
 
4994
  def int_x86_avx512_pternlog_q_256 :
4995
      ClangBuiltin<"__builtin_ia32_pternlogq256">,
4996
      DefaultAttrsIntrinsic<[llvm_v4i64_ty],
4997
                            [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty,
4998
                             llvm_i32_ty],
4999
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
5000
 
5001
  def int_x86_avx512_pternlog_q_512 :
5002
      ClangBuiltin<"__builtin_ia32_pternlogq512">,
5003
      DefaultAttrsIntrinsic<[llvm_v8i64_ty],
5004
                            [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty,
5005
                             llvm_i32_ty],
5006
                            [IntrNoMem, ImmArg<ArgIndex<3>>]>;
5007
}
5008
 
5009
// vp2intersect
5010
let TargetPrefix = "x86" in {
5011
  def int_x86_avx512_vp2intersect_q_512 :
5012
      DefaultAttrsIntrinsic<[llvm_v8i1_ty, llvm_v8i1_ty],
5013
                            [llvm_v8i64_ty, llvm_v8i64_ty],
5014
                            [IntrNoMem]>;
5015
  def int_x86_avx512_vp2intersect_q_256 :
5016
      DefaultAttrsIntrinsic<[llvm_v4i1_ty, llvm_v4i1_ty],
5017
                            [llvm_v4i64_ty, llvm_v4i64_ty],
5018
                            [IntrNoMem]>;
5019
  def int_x86_avx512_vp2intersect_q_128 :
5020
      DefaultAttrsIntrinsic<[llvm_v2i1_ty, llvm_v2i1_ty],
5021
                            [llvm_v2i64_ty, llvm_v2i64_ty],
5022
                            [IntrNoMem]>;
5023
  def int_x86_avx512_vp2intersect_d_512 :
5024
      DefaultAttrsIntrinsic<[llvm_v16i1_ty, llvm_v16i1_ty],
5025
                            [llvm_v16i32_ty, llvm_v16i32_ty],
5026
                            [IntrNoMem]>;
5027
  def int_x86_avx512_vp2intersect_d_256 :
5028
      DefaultAttrsIntrinsic<[llvm_v8i1_ty, llvm_v8i1_ty],
5029
                            [llvm_v8i32_ty, llvm_v8i32_ty],
5030
                            [IntrNoMem]>;
5031
  def int_x86_avx512_vp2intersect_d_128 :
5032
      DefaultAttrsIntrinsic<[llvm_v4i1_ty, llvm_v4i1_ty],
5033
                            [llvm_v4i32_ty, llvm_v4i32_ty],
5034
                            [IntrNoMem]>;
5035
}
5036
 
5037
// Misc.
5038
let TargetPrefix = "x86" in {
5039
  // NOTE: These comparison intrinsics are not used by clang as long as the
5040
  //       distinction in signaling behaviour is not implemented.
5041
  def int_x86_avx512_mask_cmp_ps_512 :
5042
      DefaultAttrsIntrinsic<[llvm_v16i1_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
5043
                             llvm_i32_ty, llvm_v16i1_ty, llvm_i32_ty],
5044
                            [IntrNoMem, ImmArg<ArgIndex<2>>,
5045
                             ImmArg<ArgIndex<4>>]>;
5046
  def int_x86_avx512_mask_cmp_pd_512 :
5047
      DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
5048
                             llvm_i32_ty, llvm_v8i1_ty, llvm_i32_ty],
5049
                            [IntrNoMem, ImmArg<ArgIndex<2>>,
5050
                             ImmArg<ArgIndex<4>>]>;
5051
  def int_x86_avx512_mask_cmp_ps_256 :
5052
      DefaultAttrsIntrinsic<[llvm_v8i1_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
5053
                             llvm_i32_ty, llvm_v8i1_ty],
5054
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
5055
  def int_x86_avx512_mask_cmp_pd_256 :
5056
      DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
5057
                             llvm_i32_ty, llvm_v4i1_ty],
5058
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
5059
  def int_x86_avx512_mask_cmp_ps_128 :
5060
      DefaultAttrsIntrinsic<[llvm_v4i1_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
5061
                             llvm_i32_ty, llvm_v4i1_ty],
5062
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
5063
  def int_x86_avx512_mask_cmp_pd_128 :
5064
      DefaultAttrsIntrinsic<[llvm_v2i1_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
5065
                             llvm_i32_ty, llvm_v2i1_ty],
5066
                            [IntrNoMem, ImmArg<ArgIndex<2>>]>;
5067
 
5068
  def int_x86_avx512_mask_cmp_ss :
5069
      ClangBuiltin<"__builtin_ia32_cmpss_mask">,
5070
      DefaultAttrsIntrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
5071
                             llvm_i32_ty, llvm_i8_ty, llvm_i32_ty],
5072
                            [IntrNoMem, ImmArg<ArgIndex<2>>,
5073
                             ImmArg<ArgIndex<4>>]>;
5074
  def int_x86_avx512_mask_cmp_sd :
5075
      ClangBuiltin<"__builtin_ia32_cmpsd_mask">,
5076
      DefaultAttrsIntrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
5077
                             llvm_i32_ty, llvm_i8_ty, llvm_i32_ty],
5078
                            [IntrNoMem, ImmArg<ArgIndex<2>>,
5079
                             ImmArg<ArgIndex<4>>]>;
5080
}
5081
 
5082
//===----------------------------------------------------------------------===//
5083
// SHA intrinsics
5084
let TargetPrefix = "x86" in {
5085
  def int_x86_sha1rnds4 : ClangBuiltin<"__builtin_ia32_sha1rnds4">,
5086
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
5087
                             llvm_i8_ty], [IntrNoMem, ImmArg<ArgIndex<2>>]>;
5088
  def int_x86_sha1nexte : ClangBuiltin<"__builtin_ia32_sha1nexte">,
5089
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
5090
                            [IntrNoMem]>;
5091
  def int_x86_sha1msg1 : ClangBuiltin<"__builtin_ia32_sha1msg1">,
5092
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
5093
                            [IntrNoMem]>;
5094
  def int_x86_sha1msg2 : ClangBuiltin<"__builtin_ia32_sha1msg2">,
5095
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
5096
                            [IntrNoMem]>;
5097
  def int_x86_sha256rnds2 : ClangBuiltin<"__builtin_ia32_sha256rnds2">,
5098
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
5099
                             llvm_v4i32_ty], [IntrNoMem]>;
5100
  def int_x86_sha256msg1 : ClangBuiltin<"__builtin_ia32_sha256msg1">,
5101
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
5102
                            [IntrNoMem]>;
5103
  def int_x86_sha256msg2 : ClangBuiltin<"__builtin_ia32_sha256msg2">,
5104
      DefaultAttrsIntrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
5105
                            [IntrNoMem]>;
5106
}
5107
 
5108
//===----------------------------------------------------------------------===//
5109
// Thread synchronization ops with timer.
5110
let TargetPrefix = "x86" in {
5111
  def int_x86_monitorx
5112
      : ClangBuiltin<"__builtin_ia32_monitorx">,
5113
        Intrinsic<[], [ llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty ], []>;
5114
  def int_x86_mwaitx
5115
      : ClangBuiltin<"__builtin_ia32_mwaitx">,
5116
        Intrinsic<[], [ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty ], []>;
5117
}
5118
 
5119
//===----------------------------------------------------------------------===//
5120
// Cache-line zero
5121
let TargetPrefix = "x86" in {
5122
  def int_x86_clzero : ClangBuiltin<"__builtin_ia32_clzero">,
5123
      Intrinsic<[], [llvm_ptr_ty], []>;
5124
}
5125
 
5126
//===----------------------------------------------------------------------===//
5127
// Cache write back intrinsics
5128
 
5129
let TargetPrefix = "x86" in {
5130
  // Write back and invalidate
5131
  def int_x86_wbinvd : ClangBuiltin<"__builtin_ia32_wbinvd">,
5132
      Intrinsic<[], [], []>;
5133
 
5134
  // Write back no-invalidate
5135
  def int_x86_wbnoinvd : ClangBuiltin<"__builtin_ia32_wbnoinvd">,
5136
      Intrinsic<[], [], []>;
5137
}
5138
 
5139
//===----------------------------------------------------------------------===//
5140
// Cache-line demote
5141
 
5142
let TargetPrefix = "x86" in {
5143
  def int_x86_cldemote : ClangBuiltin<"__builtin_ia32_cldemote">,
5144
      Intrinsic<[], [llvm_ptr_ty], []>;
5145
}
5146
 
5147
//===----------------------------------------------------------------------===//
5148
// Wait and pause enhancements
5149
let TargetPrefix = "x86" in {
5150
  def int_x86_umonitor : ClangBuiltin<"__builtin_ia32_umonitor">,
5151
              Intrinsic<[], [llvm_ptr_ty], []>;
5152
  def int_x86_umwait : ClangBuiltin<"__builtin_ia32_umwait">,
5153
              Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
5154
  def int_x86_tpause : ClangBuiltin<"__builtin_ia32_tpause">,
5155
              Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
5156
}
5157
 
5158
//===----------------------------------------------------------------------===//
5159
// Direct Move Instructions
5160
 
5161
let TargetPrefix = "x86" in {
5162
  def int_x86_directstore32 : ClangBuiltin<"__builtin_ia32_directstore_u32">,
5163
      Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], []>;
5164
  def int_x86_directstore64 : ClangBuiltin<"__builtin_ia32_directstore_u64">,
5165
      Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], []>;
5166
  def int_x86_movdir64b : ClangBuiltin<"__builtin_ia32_movdir64b">,
5167
      Intrinsic<[], [llvm_ptr_ty, llvm_ptr_ty], []>;
5168
}
5169
 
5170
//===----------------------------------------------------------------------===//
5171
// PTWrite - Write data to processor trace pocket
5172
 
5173
let TargetPrefix = "x86" in {
5174
  def int_x86_ptwrite32 : ClangBuiltin<"__builtin_ia32_ptwrite32">,
5175
              Intrinsic<[], [llvm_i32_ty], []>;
5176
  def int_x86_ptwrite64 : ClangBuiltin<"__builtin_ia32_ptwrite64">,
5177
              Intrinsic<[], [llvm_i64_ty], []>;
5178
}
5179
 
5180
//===----------------------------------------------------------------------===//
5181
// INVPCID - Invalidate Process-Context Identifier
5182
 
5183
let TargetPrefix = "x86" in {
5184
  def int_x86_invpcid : ClangBuiltin<"__builtin_ia32_invpcid">,
5185
              Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
5186
}
5187
 
5188
let TargetPrefix = "x86" in {
5189
  def int_x86_avx512bf16_cvtne2ps2bf16_128:
5190
      ClangBuiltin<"__builtin_ia32_cvtne2ps2bf16_128">,
5191
      DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
5192
                            [IntrNoMem]>;
5193
  def int_x86_avx512bf16_cvtne2ps2bf16_256:
5194
      ClangBuiltin<"__builtin_ia32_cvtne2ps2bf16_256">,
5195
      DefaultAttrsIntrinsic<[llvm_v16bf16_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
5196
                            [IntrNoMem]>;
5197
  def int_x86_avx512bf16_cvtne2ps2bf16_512:
5198
      ClangBuiltin<"__builtin_ia32_cvtne2ps2bf16_512">,
5199
      DefaultAttrsIntrinsic<[llvm_v32bf16_ty], [llvm_v16f32_ty, llvm_v16f32_ty],
5200
                            [IntrNoMem]>;
5201
  // Intrinsic must be masked due to it producing less than 128 bits of results.
5202
  def int_x86_avx512bf16_mask_cvtneps2bf16_128:
5203
      DefaultAttrsIntrinsic<[llvm_v8bf16_ty],
5204
                            [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v4i1_ty],
5205
                            [IntrNoMem]>;
5206
  def int_x86_avx512bf16_cvtneps2bf16_256:
5207
      ClangBuiltin<"__builtin_ia32_cvtneps2bf16_256">,
5208
      DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v8f32_ty], [IntrNoMem]>;
5209
  def int_x86_avx512bf16_cvtneps2bf16_512:
5210
      ClangBuiltin<"__builtin_ia32_cvtneps2bf16_512">,
5211
      DefaultAttrsIntrinsic<[llvm_v16bf16_ty], [llvm_v16f32_ty], [IntrNoMem]>;
5212
  def int_x86_avx512bf16_dpbf16ps_128:
5213
      ClangBuiltin<"__builtin_ia32_dpbf16ps_128">,
5214
      DefaultAttrsIntrinsic<[llvm_v4f32_ty],
5215
                            [llvm_v4f32_ty, llvm_v8bf16_ty, llvm_v8bf16_ty],
5216
                            [IntrNoMem]>;
5217
  def int_x86_avx512bf16_dpbf16ps_256:
5218
      ClangBuiltin<"__builtin_ia32_dpbf16ps_256">,
5219
      DefaultAttrsIntrinsic<[llvm_v8f32_ty],
5220
                            [llvm_v8f32_ty, llvm_v16bf16_ty, llvm_v16bf16_ty],
5221
                            [IntrNoMem]>;
5222
  def int_x86_avx512bf16_dpbf16ps_512:
5223
      ClangBuiltin<"__builtin_ia32_dpbf16ps_512">,
5224
      DefaultAttrsIntrinsic<[llvm_v16f32_ty],
5225
                            [llvm_v16f32_ty, llvm_v32bf16_ty, llvm_v32bf16_ty],
5226
                            [IntrNoMem]>;
5227
}
5228
 
5229
//===----------------------------------------------------------------------===//
5230
// ENQCMD - Enqueue Stores Instructions
5231
 
5232
let TargetPrefix = "x86" in {
5233
  def int_x86_enqcmd : ClangBuiltin<"__builtin_ia32_enqcmd">,
5234
              Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_ptr_ty], []>;
5235
  def int_x86_enqcmds : ClangBuiltin<"__builtin_ia32_enqcmds">,
5236
              Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_ptr_ty], []>;
5237
}
5238
 
5239
//===----------------------------------------------------------------------===//
5240
// SERIALIZE - Serialize instruction fetch and execution
5241
 
5242
let TargetPrefix = "x86" in {
5243
  def int_x86_serialize : ClangBuiltin<"__builtin_ia32_serialize">,
5244
              Intrinsic<[], [], []>;
5245
}
5246
 
5247
//===----------------------------------------------------------------------===//
5248
// TSXLDTRK - TSX Suspend Load Address Tracking
5249
 
5250
let TargetPrefix = "x86" in {
5251
  def int_x86_xsusldtrk : ClangBuiltin<"__builtin_ia32_xsusldtrk">,
5252
              Intrinsic<[], [], []>;
5253
  def int_x86_xresldtrk : ClangBuiltin<"__builtin_ia32_xresldtrk">,
5254
              Intrinsic<[], [], []>;
5255
}
5256
 
5257
//===----------------------------------------------------------------------===//
5258
// Key Locker
5259
let TargetPrefix = "x86" in {
5260
  def int_x86_loadiwkey : ClangBuiltin<"__builtin_ia32_loadiwkey">,
5261
      Intrinsic<[], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
5262
                []>;
5263
  def int_x86_encodekey128 :
5264
      Intrinsic<[llvm_i32_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5265
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
5266
                [llvm_i32_ty, llvm_v2i64_ty], []>;
5267
  def int_x86_encodekey256 :
5268
      Intrinsic<[llvm_i32_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5269
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
5270
                [llvm_i32_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
5271
  def int_x86_aesenc128kl :
5272
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
5273
  def int_x86_aesdec128kl :
5274
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
5275
  def int_x86_aesenc256kl :
5276
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
5277
  def int_x86_aesdec256kl :
5278
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty], []>;
5279
  def int_x86_aesencwide128kl :
5280
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5281
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5282
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
5283
                [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5284
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5285
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
5286
  def int_x86_aesdecwide128kl :
5287
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5288
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5289
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
5290
                [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5291
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5292
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
5293
  def int_x86_aesencwide256kl :
5294
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5295
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5296
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
5297
                [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5298
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5299
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
5300
  def int_x86_aesdecwide256kl :
5301
      Intrinsic<[llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5302
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5303
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
5304
                [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5305
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty,
5306
                 llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], []>;
5307
}
5308
 
5309
//===----------------------------------------------------------------------===//
5310
// AMX - Intel AMX extensions
5311
 
5312
let TargetPrefix = "x86" in {
5313
  def int_x86_ldtilecfg : ClangBuiltin<"__builtin_ia32_tile_loadconfig">,
5314
              Intrinsic<[], [llvm_ptr_ty], []>;
5315
  def int_x86_sttilecfg : ClangBuiltin<"__builtin_ia32_tile_storeconfig">,
5316
              Intrinsic<[], [llvm_ptr_ty], []>;
5317
  def int_x86_tilerelease : ClangBuiltin<"__builtin_ia32_tilerelease">,
5318
              Intrinsic<[], [], []>;
5319
  def int_x86_tilezero : ClangBuiltin<"__builtin_ia32_tilezero">,
5320
              Intrinsic<[], [llvm_i8_ty], [ImmArg<ArgIndex<0>>]>;
5321
  def int_x86_tileloadd64 : ClangBuiltin<"__builtin_ia32_tileloadd64">,
5322
              Intrinsic<[], [llvm_i8_ty, llvm_ptr_ty, llvm_i64_ty],
5323
                        [ImmArg<ArgIndex<0>>]>;
5324
  def int_x86_tileloaddt164 : ClangBuiltin<"__builtin_ia32_tileloaddt164">,
5325
              Intrinsic<[], [llvm_i8_ty, llvm_ptr_ty, llvm_i64_ty],
5326
                        [ImmArg<ArgIndex<0>>]>;
5327
  def int_x86_tilestored64 : ClangBuiltin<"__builtin_ia32_tilestored64">,
5328
              Intrinsic<[], [llvm_i8_ty, llvm_ptr_ty, llvm_i64_ty],
5329
                        [ImmArg<ArgIndex<0>>]>;
5330
  def int_x86_tdpbssd : ClangBuiltin<"__builtin_ia32_tdpbssd">,
5331
              Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
5332
                        [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
5333
                         ImmArg<ArgIndex<2>>]>;
5334
  def int_x86_tdpbsud : ClangBuiltin<"__builtin_ia32_tdpbsud">,
5335
              Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
5336
                        [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
5337
                         ImmArg<ArgIndex<2>>]>;
5338
  def int_x86_tdpbusd : ClangBuiltin<"__builtin_ia32_tdpbusd">,
5339
              Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
5340
                        [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
5341
                         ImmArg<ArgIndex<2>>]>;
5342
  def int_x86_tdpbuud : ClangBuiltin<"__builtin_ia32_tdpbuud">,
5343
              Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
5344
                        [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
5345
                         ImmArg<ArgIndex<2>>]>;
5346
  def int_x86_tdpbf16ps : ClangBuiltin<"__builtin_ia32_tdpbf16ps">,
5347
              Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
5348
                        [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
5349
                         ImmArg<ArgIndex<2>>]>;
5350
  // AMX-FP16 - Intel FP16 AMX extensions
5351
  def int_x86_tdpfp16ps : ClangBuiltin<"__builtin_ia32_tdpfp16ps">,
5352
              Intrinsic<[], [llvm_i8_ty, llvm_i8_ty, llvm_i8_ty],
5353
                        [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>,
5354
                         ImmArg<ArgIndex<2>>]>;
5355
  // AMX - internal intrinsics
5356
  def int_x86_ldtilecfg_internal :
5357
              ClangBuiltin<"__builtin_ia32_tile_loadconfig_internal">,
5358
              Intrinsic<[], [llvm_ptr_ty], []>;
5359
  def int_x86_tileloadd64_internal :
5360
              ClangBuiltin<"__builtin_ia32_tileloadd64_internal">,
5361
              Intrinsic<[llvm_x86amx_ty],
5362
                        [llvm_i16_ty, llvm_i16_ty, llvm_ptr_ty, llvm_i64_ty],
5363
                        []>;
5364
  def int_x86_tileloaddt164_internal :
5365
              ClangBuiltin<"__builtin_ia32_tileloaddt164_internal">,
5366
              Intrinsic<[llvm_x86amx_ty],
5367
                        [llvm_i16_ty, llvm_i16_ty, llvm_ptr_ty, llvm_i64_ty],
5368
                        []>;
5369
  def int_x86_tdpbssd_internal :
5370
              ClangBuiltin<"__builtin_ia32_tdpbssd_internal">,
5371
              Intrinsic<[llvm_x86amx_ty],
5372
                        [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
5373
                         llvm_x86amx_ty, llvm_x86amx_ty,
5374
                         llvm_x86amx_ty], []>;
5375
  def int_x86_tdpbsud_internal :
5376
              ClangBuiltin<"__builtin_ia32_tdpbsud_internal">,
5377
              Intrinsic<[llvm_x86amx_ty],
5378
                        [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
5379
                         llvm_x86amx_ty, llvm_x86amx_ty,
5380
                         llvm_x86amx_ty], []>;
5381
  def int_x86_tdpbusd_internal :
5382
              ClangBuiltin<"__builtin_ia32_tdpbusd_internal">,
5383
              Intrinsic<[llvm_x86amx_ty],
5384
                        [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
5385
                         llvm_x86amx_ty, llvm_x86amx_ty,
5386
                         llvm_x86amx_ty], []>;
5387
  def int_x86_tdpbuud_internal :
5388
              ClangBuiltin<"__builtin_ia32_tdpbuud_internal">,
5389
              Intrinsic<[llvm_x86amx_ty],
5390
                        [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
5391
                         llvm_x86amx_ty, llvm_x86amx_ty,
5392
                         llvm_x86amx_ty], []>;
5393
  def int_x86_tilestored64_internal :
5394
              ClangBuiltin<"__builtin_ia32_tilestored64_internal">,
5395
              Intrinsic<[], [llvm_i16_ty, llvm_i16_ty, llvm_ptr_ty,
5396
                             llvm_i64_ty, llvm_x86amx_ty], []>;
5397
  def int_x86_tilezero_internal :
5398
              ClangBuiltin<"__builtin_ia32_tilezero_internal">,
5399
              Intrinsic<[llvm_x86amx_ty], [llvm_i16_ty, llvm_i16_ty],
5400
                        []>;
5401
  def int_x86_tdpbf16ps_internal :
5402
              ClangBuiltin<"__builtin_ia32_tdpbf16ps_internal">,
5403
              Intrinsic<[llvm_x86amx_ty],
5404
                        [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
5405
                         llvm_x86amx_ty, llvm_x86amx_ty,
5406
                         llvm_x86amx_ty], []>;
5407
  def int_x86_tdpfp16ps_internal :
5408
              ClangBuiltin<"__builtin_ia32_tdpfp16ps_internal">,
5409
              Intrinsic<[llvm_x86amx_ty],
5410
                        [llvm_i16_ty, llvm_i16_ty, llvm_i16_ty,
5411
                         llvm_x86amx_ty, llvm_x86amx_ty,
5412
                         llvm_x86amx_ty], []>;
5413
  def int_x86_cast_vector_to_tile:
5414
      DefaultAttrsIntrinsic<[llvm_x86amx_ty], [llvm_anyvector_ty], [IntrNoMem]>;
5415
  def int_x86_cast_tile_to_vector:
5416
      DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_x86amx_ty], [IntrNoMem]>;
5417
}
5418
 
5419
//===----------------------------------------------------------------------===//
5420
let TargetPrefix = "x86" in {
5421
// CMPCCXADD
5422
def int_x86_cmpccxadd32
5423
    : ClangBuiltin<"__builtin_ia32_cmpccxadd32">,
5424
      Intrinsic<[llvm_i32_ty],
5425
                [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
5426
                [IntrArgMemOnly, ImmArg<ArgIndex<3>>]>;
5427
 
5428
def int_x86_cmpccxadd64
5429
    : ClangBuiltin<"__builtin_ia32_cmpccxadd64">,
5430
      Intrinsic<[llvm_i64_ty],
5431
                [llvm_ptr_ty, llvm_i64_ty, llvm_i64_ty, llvm_i32_ty],
5432
                [IntrArgMemOnly, ImmArg<ArgIndex<3>>]>;
5433
 
5434
// AVX-NE-CONVERT
5435
def int_x86_vbcstnebf162ps128
5436
    : ClangBuiltin<"__builtin_ia32_vbcstnebf162ps128">,
5437
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
5438
                            [IntrReadMem, IntrArgMemOnly]>;
5439
def int_x86_vbcstnebf162ps256
5440
    : ClangBuiltin<"__builtin_ia32_vbcstnebf162ps256">,
5441
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
5442
                            [IntrReadMem, IntrArgMemOnly]>;
5443
def int_x86_vbcstnesh2ps128
5444
    : ClangBuiltin<"__builtin_ia32_vbcstnesh2ps128">,
5445
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
5446
                            [IntrReadMem, IntrArgMemOnly]>;
5447
def int_x86_vbcstnesh2ps256
5448
    : ClangBuiltin<"__builtin_ia32_vbcstnesh2ps256">,
5449
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
5450
                            [IntrReadMem, IntrArgMemOnly]>;
5451
def int_x86_vcvtneebf162ps128
5452
    : ClangBuiltin<"__builtin_ia32_vcvtneebf162ps128">,
5453
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
5454
                            [IntrReadMem, IntrArgMemOnly]>;
5455
def int_x86_vcvtneebf162ps256
5456
    : ClangBuiltin<"__builtin_ia32_vcvtneebf162ps256">,
5457
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
5458
                            [IntrReadMem, IntrArgMemOnly]>;
5459
def int_x86_vcvtneeph2ps128
5460
    : ClangBuiltin<"__builtin_ia32_vcvtneeph2ps128">,
5461
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
5462
                            [IntrReadMem, IntrArgMemOnly]>;
5463
def int_x86_vcvtneeph2ps256
5464
    : ClangBuiltin<"__builtin_ia32_vcvtneeph2ps256">,
5465
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
5466
                            [IntrReadMem, IntrArgMemOnly]>;
5467
def int_x86_vcvtneobf162ps128
5468
    : ClangBuiltin<"__builtin_ia32_vcvtneobf162ps128">,
5469
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
5470
                            [IntrReadMem, IntrArgMemOnly]>;
5471
def int_x86_vcvtneobf162ps256
5472
    : ClangBuiltin<"__builtin_ia32_vcvtneobf162ps256">,
5473
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
5474
                            [IntrReadMem, IntrArgMemOnly]>;
5475
def int_x86_vcvtneoph2ps128
5476
    : ClangBuiltin<"__builtin_ia32_vcvtneoph2ps128">,
5477
      DefaultAttrsIntrinsic<[llvm_v4f32_ty], [llvm_ptr_ty],
5478
                            [IntrReadMem, IntrArgMemOnly]>;
5479
def int_x86_vcvtneoph2ps256
5480
    : ClangBuiltin<"__builtin_ia32_vcvtneoph2ps256">,
5481
      DefaultAttrsIntrinsic<[llvm_v8f32_ty], [llvm_ptr_ty],
5482
                            [IntrReadMem, IntrArgMemOnly]>;
5483
def int_x86_vcvtneps2bf16128
5484
    : ClangBuiltin<"__builtin_ia32_vcvtneps2bf16128">,
5485
      DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v4f32_ty], [IntrNoMem]>;
5486
def int_x86_vcvtneps2bf16256
5487
    : ClangBuiltin<"__builtin_ia32_vcvtneps2bf16256">,
5488
      DefaultAttrsIntrinsic<[llvm_v8bf16_ty], [llvm_v8f32_ty], [IntrNoMem]>;
5489
}
5490
//===----------------------------------------------------------------------===//
5491
// RAO-INT intrinsics
5492
let TargetPrefix = "x86" in {
5493
  def int_x86_aadd32
5494
      : ClangBuiltin<"__builtin_ia32_aadd32">,
5495
        Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
5496
  def int_x86_aadd64
5497
      : ClangBuiltin<"__builtin_ia32_aadd64">,
5498
        Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
5499
  def int_x86_aand32
5500
      : ClangBuiltin<"__builtin_ia32_aand32">,
5501
        Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
5502
  def int_x86_aand64
5503
      : ClangBuiltin<"__builtin_ia32_aand64">,
5504
        Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
5505
  def int_x86_aor32
5506
      : ClangBuiltin<"__builtin_ia32_aor32">,
5507
        Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
5508
  def int_x86_aor64
5509
      : ClangBuiltin<"__builtin_ia32_aor64">,
5510
        Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
5511
  def int_x86_axor32
5512
      : ClangBuiltin<"__builtin_ia32_axor32">,
5513
        Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrArgMemOnly]>;
5514
  def int_x86_axor64
5515
      : ClangBuiltin<"__builtin_ia32_axor64">,
5516
        Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], [IntrArgMemOnly]>;
5517
}
5518
 
5519
//===----------------------------------------------------------------------===//
5520
// UINTR - User Level Interrupt
5521
 
5522
let TargetPrefix = "x86" in {
5523
  def int_x86_clui : ClangBuiltin<"__builtin_ia32_clui">,
5524
              Intrinsic<[], [], []>;
5525
  def int_x86_stui : ClangBuiltin<"__builtin_ia32_stui">,
5526
              Intrinsic<[], [], []>;
5527
  def int_x86_testui : ClangBuiltin<"__builtin_ia32_testui">,
5528
              Intrinsic<[llvm_i8_ty], [], []>;
5529
  def int_x86_senduipi : ClangBuiltin<"__builtin_ia32_senduipi">,
5530
              Intrinsic<[], [llvm_i64_ty], []>;
5531
}
5532
 
5533
//===----------------------------------------------------------------------===//
5534
// avx512_fp16: vaddph
5535
let TargetPrefix = "x86" in {
5536
  def int_x86_avx512fp16_add_ph_512
5537
      : ClangBuiltin<"__builtin_ia32_addph512">,
5538
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
5539
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
5540
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5541
  def int_x86_avx512fp16_sub_ph_512
5542
      : ClangBuiltin<"__builtin_ia32_subph512">,
5543
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
5544
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
5545
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5546
  def int_x86_avx512fp16_mul_ph_512
5547
      : ClangBuiltin<"__builtin_ia32_mulph512">,
5548
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
5549
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
5550
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5551
  def int_x86_avx512fp16_div_ph_512
5552
      : ClangBuiltin<"__builtin_ia32_divph512">,
5553
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
5554
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
5555
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5556
  def int_x86_avx512fp16_max_ph_128
5557
      : ClangBuiltin<"__builtin_ia32_maxph128">,
5558
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5559
                              [ llvm_v8f16_ty, llvm_v8f16_ty ], [ IntrNoMem ]>;
5560
  def int_x86_avx512fp16_max_ph_256
5561
      : ClangBuiltin<"__builtin_ia32_maxph256">,
5562
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
5563
                              [ llvm_v16f16_ty, llvm_v16f16_ty ],
5564
                              [ IntrNoMem ]>;
5565
  def int_x86_avx512fp16_max_ph_512
5566
      : ClangBuiltin<"__builtin_ia32_maxph512">,
5567
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
5568
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
5569
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5570
  def int_x86_avx512fp16_min_ph_128
5571
      : ClangBuiltin<"__builtin_ia32_minph128">,
5572
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5573
                              [ llvm_v8f16_ty, llvm_v8f16_ty ], [ IntrNoMem ]>;
5574
  def int_x86_avx512fp16_min_ph_256
5575
      : ClangBuiltin<"__builtin_ia32_minph256">,
5576
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
5577
                              [ llvm_v16f16_ty, llvm_v16f16_ty ],
5578
                              [ IntrNoMem ]>;
5579
  def int_x86_avx512fp16_min_ph_512
5580
      : ClangBuiltin<"__builtin_ia32_minph512">,
5581
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
5582
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
5583
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5584
 
5585
  def int_x86_avx512fp16_mask_cmp_ph_512
5586
      : DefaultAttrsIntrinsic<[ llvm_v32i1_ty ],
5587
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty,
5588
                                llvm_v32i1_ty, llvm_i32_ty ],
5589
                              [ IntrNoMem, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<4>> ]>;
5590
  def int_x86_avx512fp16_mask_cmp_ph_256
5591
      : DefaultAttrsIntrinsic<[ llvm_v16i1_ty ],
5592
                              [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i32_ty,
5593
                                llvm_v16i1_ty ],
5594
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5595
  def int_x86_avx512fp16_mask_cmp_ph_128
5596
      : DefaultAttrsIntrinsic<[ llvm_v8i1_ty ],
5597
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
5598
                                llvm_v8i1_ty ],
5599
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5600
 
5601
  def int_x86_avx512fp16_mask_add_sh_round
5602
      : ClangBuiltin<"__builtin_ia32_addsh_round_mask">,
5603
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5604
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
5605
                                llvm_i8_ty, llvm_i32_ty ],
5606
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5607
  def int_x86_avx512fp16_mask_sub_sh_round
5608
      : ClangBuiltin<"__builtin_ia32_subsh_round_mask">,
5609
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5610
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
5611
                                llvm_i8_ty, llvm_i32_ty ],
5612
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5613
  def int_x86_avx512fp16_mask_mul_sh_round
5614
      : ClangBuiltin<"__builtin_ia32_mulsh_round_mask">,
5615
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5616
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
5617
                                llvm_i8_ty, llvm_i32_ty ],
5618
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5619
  def int_x86_avx512fp16_mask_div_sh_round
5620
      : ClangBuiltin<"__builtin_ia32_divsh_round_mask">,
5621
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5622
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
5623
                                llvm_i8_ty, llvm_i32_ty ],
5624
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5625
  def int_x86_avx512fp16_mask_min_sh_round
5626
      : ClangBuiltin<"__builtin_ia32_minsh_round_mask">,
5627
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5628
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
5629
                                llvm_i8_ty, llvm_i32_ty ],
5630
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5631
  def int_x86_avx512fp16_mask_max_sh_round
5632
      : ClangBuiltin<"__builtin_ia32_maxsh_round_mask">,
5633
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5634
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
5635
                                llvm_i8_ty, llvm_i32_ty ],
5636
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5637
  def int_x86_avx512fp16_mask_cmp_sh
5638
      : ClangBuiltin<"__builtin_ia32_cmpsh_mask">,
5639
        DefaultAttrsIntrinsic<[ llvm_i8_ty ],
5640
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
5641
                                llvm_i8_ty, llvm_i32_ty ],
5642
                              [ IntrNoMem, ImmArg<ArgIndex<2>>,
5643
                                ImmArg<ArgIndex<4>> ]>;
5644
  def int_x86_avx512fp16_vcomi_sh
5645
      : ClangBuiltin<"__builtin_ia32_vcomish">,
5646
        DefaultAttrsIntrinsic<[ llvm_i32_ty ],
5647
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
5648
                                llvm_i32_ty ],
5649
                              [ IntrNoMem, ImmArg<ArgIndex<2>>,
5650
                                ImmArg<ArgIndex<3>> ]>;
5651
 
5652
  def int_x86_avx512fp16_mask_vcvtph2psx_128
5653
      : ClangBuiltin<"__builtin_ia32_vcvtph2psx128_mask">,
5654
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
5655
                              [ llvm_v8f16_ty, llvm_v4f32_ty, llvm_i8_ty ],
5656
                              [ IntrNoMem ]>;
5657
  def int_x86_avx512fp16_mask_vcvtph2psx_256
5658
      : ClangBuiltin<"__builtin_ia32_vcvtph2psx256_mask">,
5659
        DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
5660
                              [ llvm_v8f16_ty, llvm_v8f32_ty, llvm_i8_ty ],
5661
                              [ IntrNoMem ]>;
5662
  def int_x86_avx512fp16_mask_vcvtph2psx_512
5663
      : ClangBuiltin<"__builtin_ia32_vcvtph2psx512_mask">,
5664
        DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
5665
                              [ llvm_v16f16_ty, llvm_v16f32_ty, llvm_i16_ty,
5666
                                llvm_i32_ty ],
5667
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5668
  def int_x86_avx512fp16_mask_vcvtps2phx_128
5669
      : ClangBuiltin<"__builtin_ia32_vcvtps2phx128_mask">,
5670
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5671
                              [ llvm_v4f32_ty, llvm_v8f16_ty, llvm_i8_ty ],
5672
                              [ IntrNoMem ]>;
5673
  def int_x86_avx512fp16_mask_vcvtps2phx_256
5674
      : ClangBuiltin<"__builtin_ia32_vcvtps2phx256_mask">,
5675
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5676
                              [ llvm_v8f32_ty, llvm_v8f16_ty, llvm_i8_ty ],
5677
                              [ IntrNoMem ]>;
5678
  def int_x86_avx512fp16_mask_vcvtps2phx_512
5679
      : ClangBuiltin<"__builtin_ia32_vcvtps2phx512_mask">,
5680
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
5681
                              [ llvm_v16f32_ty, llvm_v16f16_ty, llvm_i16_ty,
5682
                                llvm_i32_ty ],
5683
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5684
  def int_x86_avx512fp16_mask_vcvtpd2ph_128
5685
      : ClangBuiltin<"__builtin_ia32_vcvtpd2ph128_mask">,
5686
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5687
                              [ llvm_v2f64_ty, llvm_v8f16_ty, llvm_i8_ty ],
5688
                              [ IntrNoMem ]>;
5689
  def int_x86_avx512fp16_mask_vcvtpd2ph_256
5690
      : ClangBuiltin<"__builtin_ia32_vcvtpd2ph256_mask">,
5691
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5692
                              [ llvm_v4f64_ty, llvm_v8f16_ty, llvm_i8_ty ],
5693
                              [ IntrNoMem ]>;
5694
  def int_x86_avx512fp16_mask_vcvtpd2ph_512
5695
      : ClangBuiltin<"__builtin_ia32_vcvtpd2ph512_mask">,
5696
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5697
                              [ llvm_v8f64_ty, llvm_v8f16_ty, llvm_i8_ty,
5698
                                llvm_i32_ty ],
5699
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5700
  def int_x86_avx512fp16_mask_vcvtph2pd_128
5701
      : ClangBuiltin<"__builtin_ia32_vcvtph2pd128_mask">,
5702
        DefaultAttrsIntrinsic<[ llvm_v2f64_ty ],
5703
                              [ llvm_v8f16_ty, llvm_v2f64_ty, llvm_i8_ty ],
5704
                              [ IntrNoMem ]>;
5705
  def int_x86_avx512fp16_mask_vcvtph2pd_256
5706
      : ClangBuiltin<"__builtin_ia32_vcvtph2pd256_mask">,
5707
        DefaultAttrsIntrinsic<[ llvm_v4f64_ty ],
5708
                              [ llvm_v8f16_ty, llvm_v4f64_ty, llvm_i8_ty ],
5709
                              [ IntrNoMem ]>;
5710
  def int_x86_avx512fp16_mask_vcvtph2pd_512
5711
      : ClangBuiltin<"__builtin_ia32_vcvtph2pd512_mask">,
5712
        DefaultAttrsIntrinsic<[ llvm_v8f64_ty ],
5713
                              [ llvm_v8f16_ty, llvm_v8f64_ty, llvm_i8_ty,
5714
                                llvm_i32_ty ],
5715
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5716
  def int_x86_avx512fp16_mask_vcvtsh2ss_round
5717
      : ClangBuiltin<"__builtin_ia32_vcvtsh2ss_round_mask">,
5718
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
5719
                              [ llvm_v4f32_ty, llvm_v8f16_ty, llvm_v4f32_ty,
5720
                                llvm_i8_ty, llvm_i32_ty ],
5721
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5722
  def int_x86_avx512fp16_mask_vcvtss2sh_round
5723
      : ClangBuiltin<"__builtin_ia32_vcvtss2sh_round_mask">,
5724
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5725
                              [ llvm_v8f16_ty, llvm_v4f32_ty, llvm_v8f16_ty,
5726
                                llvm_i8_ty, llvm_i32_ty ],
5727
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5728
  def int_x86_avx512fp16_mask_vcvtsd2sh_round
5729
      : ClangBuiltin<"__builtin_ia32_vcvtsd2sh_round_mask">,
5730
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5731
                              [ llvm_v8f16_ty, llvm_v2f64_ty, llvm_v8f16_ty,
5732
                                llvm_i8_ty, llvm_i32_ty ],
5733
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5734
  def int_x86_avx512fp16_mask_vcvtsh2sd_round
5735
      : ClangBuiltin<"__builtin_ia32_vcvtsh2sd_round_mask">,
5736
        DefaultAttrsIntrinsic<[ llvm_v2f64_ty ],
5737
                              [ llvm_v2f64_ty, llvm_v8f16_ty, llvm_v2f64_ty,
5738
                                llvm_i8_ty, llvm_i32_ty ],
5739
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
5740
 
5741
  def int_x86_avx512fp16_mask_vcvtph2w_128
5742
      : ClangBuiltin<"__builtin_ia32_vcvtph2w128_mask">,
5743
        DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
5744
                              [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
5745
                              [ IntrNoMem ]>;
5746
  def int_x86_avx512fp16_mask_vcvtph2w_256
5747
      : ClangBuiltin<"__builtin_ia32_vcvtph2w256_mask">,
5748
        DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
5749
                              [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
5750
                              [ IntrNoMem ]>;
5751
  def int_x86_avx512fp16_mask_vcvtph2w_512
5752
      : ClangBuiltin<"__builtin_ia32_vcvtph2w512_mask">,
5753
        DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
5754
                              [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
5755
                                llvm_i32_ty ],
5756
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5757
  def int_x86_avx512fp16_mask_vcvttph2w_128
5758
      : ClangBuiltin<"__builtin_ia32_vcvttph2w128_mask">,
5759
        DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
5760
                              [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
5761
                              [ IntrNoMem ]>;
5762
  def int_x86_avx512fp16_mask_vcvttph2w_256
5763
      : ClangBuiltin<"__builtin_ia32_vcvttph2w256_mask">,
5764
        DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
5765
                              [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
5766
                              [ IntrNoMem ]>;
5767
  def int_x86_avx512fp16_mask_vcvttph2w_512
5768
      : ClangBuiltin<"__builtin_ia32_vcvttph2w512_mask">,
5769
        DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
5770
                              [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
5771
                                llvm_i32_ty ],
5772
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5773
  def int_x86_avx512fp16_mask_vcvtph2uw_128
5774
      : ClangBuiltin<"__builtin_ia32_vcvtph2uw128_mask">,
5775
        DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
5776
                              [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
5777
                              [ IntrNoMem ]>;
5778
  def int_x86_avx512fp16_mask_vcvtph2uw_256
5779
      : ClangBuiltin<"__builtin_ia32_vcvtph2uw256_mask">,
5780
        DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
5781
                              [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
5782
                              [ IntrNoMem ]>;
5783
  def int_x86_avx512fp16_mask_vcvtph2uw_512
5784
      : ClangBuiltin<"__builtin_ia32_vcvtph2uw512_mask">,
5785
        DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
5786
                              [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
5787
                                llvm_i32_ty ],
5788
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5789
  def int_x86_avx512fp16_mask_vcvttph2uw_128
5790
      : ClangBuiltin<"__builtin_ia32_vcvttph2uw128_mask">,
5791
        DefaultAttrsIntrinsic<[ llvm_v8i16_ty ],
5792
                              [ llvm_v8f16_ty, llvm_v8i16_ty, llvm_i8_ty ],
5793
                              [ IntrNoMem ]>;
5794
  def int_x86_avx512fp16_mask_vcvttph2uw_256
5795
      : ClangBuiltin<"__builtin_ia32_vcvttph2uw256_mask">,
5796
        DefaultAttrsIntrinsic<[ llvm_v16i16_ty ],
5797
                              [ llvm_v16f16_ty, llvm_v16i16_ty, llvm_i16_ty ],
5798
                              [ IntrNoMem ]>;
5799
  def int_x86_avx512fp16_mask_vcvttph2uw_512
5800
      : ClangBuiltin<"__builtin_ia32_vcvttph2uw512_mask">,
5801
        DefaultAttrsIntrinsic<[ llvm_v32i16_ty ],
5802
                              [ llvm_v32f16_ty, llvm_v32i16_ty, llvm_i32_ty,
5803
                                llvm_i32_ty ],
5804
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5805
 
5806
  def int_x86_avx512fp16_mask_vcvtph2dq_128
5807
      : ClangBuiltin<"__builtin_ia32_vcvtph2dq128_mask">,
5808
        DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
5809
                              [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
5810
                              [ IntrNoMem ]>;
5811
  def int_x86_avx512fp16_mask_vcvtph2dq_256
5812
      : ClangBuiltin<"__builtin_ia32_vcvtph2dq256_mask">,
5813
        DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
5814
                              [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
5815
                              [ IntrNoMem ]>;
5816
  def int_x86_avx512fp16_mask_vcvtph2dq_512
5817
      : ClangBuiltin<"__builtin_ia32_vcvtph2dq512_mask">,
5818
        DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
5819
                              [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
5820
                                llvm_i32_ty ],
5821
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5822
  def int_x86_avx512fp16_mask_vcvtph2udq_128
5823
      : ClangBuiltin<"__builtin_ia32_vcvtph2udq128_mask">,
5824
        DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
5825
                              [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
5826
                              [ IntrNoMem ]>;
5827
  def int_x86_avx512fp16_mask_vcvtph2udq_256
5828
      : ClangBuiltin<"__builtin_ia32_vcvtph2udq256_mask">,
5829
        DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
5830
                              [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
5831
                              [ IntrNoMem ]>;
5832
  def int_x86_avx512fp16_mask_vcvtph2udq_512
5833
      : ClangBuiltin<"__builtin_ia32_vcvtph2udq512_mask">,
5834
        DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
5835
                              [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
5836
                                llvm_i32_ty ],
5837
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5838
  def int_x86_avx512fp16_mask_vcvtdq2ph_128
5839
      : ClangBuiltin<"__builtin_ia32_vcvtdq2ph128_mask">,
5840
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5841
                              [ llvm_v4i32_ty, llvm_v8f16_ty, llvm_i8_ty ],
5842
                              [ IntrNoMem ]>;
5843
  def int_x86_avx512fp16_mask_vcvtudq2ph_128
5844
      : ClangBuiltin<"__builtin_ia32_vcvtudq2ph128_mask">,
5845
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5846
                              [ llvm_v4i32_ty, llvm_v8f16_ty, llvm_i8_ty ],
5847
                              [ IntrNoMem ]>;
5848
  def int_x86_avx512fp16_mask_vcvttph2dq_128
5849
      : ClangBuiltin<"__builtin_ia32_vcvttph2dq128_mask">,
5850
        DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
5851
                              [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
5852
                              [ IntrNoMem ]>;
5853
  def int_x86_avx512fp16_mask_vcvttph2dq_256
5854
      : ClangBuiltin<"__builtin_ia32_vcvttph2dq256_mask">,
5855
        DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
5856
                              [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
5857
                              [ IntrNoMem ]>;
5858
  def int_x86_avx512fp16_mask_vcvttph2dq_512
5859
      : ClangBuiltin<"__builtin_ia32_vcvttph2dq512_mask">,
5860
        DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
5861
                              [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
5862
                                llvm_i32_ty ],
5863
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5864
  def int_x86_avx512fp16_mask_vcvttph2udq_128
5865
      : ClangBuiltin<"__builtin_ia32_vcvttph2udq128_mask">,
5866
        DefaultAttrsIntrinsic<[ llvm_v4i32_ty ],
5867
                              [ llvm_v8f16_ty, llvm_v4i32_ty, llvm_i8_ty ],
5868
                              [ IntrNoMem ]>;
5869
  def int_x86_avx512fp16_mask_vcvttph2udq_256
5870
      : ClangBuiltin<"__builtin_ia32_vcvttph2udq256_mask">,
5871
        DefaultAttrsIntrinsic<[ llvm_v8i32_ty ],
5872
                              [ llvm_v8f16_ty, llvm_v8i32_ty, llvm_i8_ty ],
5873
                              [ IntrNoMem ]>;
5874
  def int_x86_avx512fp16_mask_vcvttph2udq_512
5875
      : ClangBuiltin<"__builtin_ia32_vcvttph2udq512_mask">,
5876
        DefaultAttrsIntrinsic<[ llvm_v16i32_ty ],
5877
                              [ llvm_v16f16_ty, llvm_v16i32_ty, llvm_i16_ty,
5878
                                llvm_i32_ty ],
5879
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5880
 
5881
  def int_x86_avx512fp16_mask_vcvtqq2ph_128
5882
      : ClangBuiltin<"__builtin_ia32_vcvtqq2ph128_mask">,
5883
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5884
                              [ llvm_v2i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
5885
                              [ IntrNoMem ]>;
5886
  def int_x86_avx512fp16_mask_vcvtqq2ph_256
5887
      : ClangBuiltin<"__builtin_ia32_vcvtqq2ph256_mask">,
5888
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5889
                              [ llvm_v4i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
5890
                              [ IntrNoMem ]>;
5891
  def int_x86_avx512fp16_mask_vcvtph2qq_128
5892
      : ClangBuiltin<"__builtin_ia32_vcvtph2qq128_mask">,
5893
        DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
5894
                              [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
5895
                              [ IntrNoMem ]>;
5896
  def int_x86_avx512fp16_mask_vcvtph2qq_256
5897
      : ClangBuiltin<"__builtin_ia32_vcvtph2qq256_mask">,
5898
        DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
5899
                              [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
5900
                              [ IntrNoMem ]>;
5901
  def int_x86_avx512fp16_mask_vcvtph2qq_512
5902
      : ClangBuiltin<"__builtin_ia32_vcvtph2qq512_mask">,
5903
        DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
5904
                              [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
5905
                                llvm_i32_ty ],
5906
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5907
  def int_x86_avx512fp16_mask_vcvtuqq2ph_128
5908
      : ClangBuiltin<"__builtin_ia32_vcvtuqq2ph128_mask">,
5909
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5910
                              [ llvm_v2i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
5911
                              [ IntrNoMem ]>;
5912
  def int_x86_avx512fp16_mask_vcvtuqq2ph_256
5913
      : ClangBuiltin<"__builtin_ia32_vcvtuqq2ph256_mask">,
5914
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5915
                              [ llvm_v4i64_ty, llvm_v8f16_ty, llvm_i8_ty ],
5916
                              [ IntrNoMem ]>;
5917
  def int_x86_avx512fp16_mask_vcvtph2uqq_128
5918
      : ClangBuiltin<"__builtin_ia32_vcvtph2uqq128_mask">,
5919
        DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
5920
                              [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
5921
                              [ IntrNoMem ]>;
5922
  def int_x86_avx512fp16_mask_vcvtph2uqq_256
5923
      : ClangBuiltin<"__builtin_ia32_vcvtph2uqq256_mask">,
5924
        DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
5925
                              [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
5926
                              [ IntrNoMem ]>;
5927
  def int_x86_avx512fp16_mask_vcvtph2uqq_512
5928
      : ClangBuiltin<"__builtin_ia32_vcvtph2uqq512_mask">,
5929
        DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
5930
                              [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
5931
                                llvm_i32_ty ],
5932
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5933
  def int_x86_avx512fp16_mask_vcvttph2qq_128
5934
      : ClangBuiltin<"__builtin_ia32_vcvttph2qq128_mask">,
5935
        DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
5936
                              [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
5937
                              [ IntrNoMem ]>;
5938
  def int_x86_avx512fp16_mask_vcvttph2qq_256
5939
      : ClangBuiltin<"__builtin_ia32_vcvttph2qq256_mask">,
5940
        DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
5941
                              [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
5942
                              [ IntrNoMem ]>;
5943
  def int_x86_avx512fp16_mask_vcvttph2qq_512
5944
      : ClangBuiltin<"__builtin_ia32_vcvttph2qq512_mask">,
5945
        DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
5946
                              [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
5947
                                llvm_i32_ty ],
5948
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5949
  def int_x86_avx512fp16_mask_vcvttph2uqq_128
5950
      : ClangBuiltin<"__builtin_ia32_vcvttph2uqq128_mask">,
5951
        DefaultAttrsIntrinsic<[ llvm_v2i64_ty ],
5952
                              [ llvm_v8f16_ty, llvm_v2i64_ty, llvm_i8_ty ],
5953
                              [ IntrNoMem ]>;
5954
  def int_x86_avx512fp16_mask_vcvttph2uqq_256
5955
      : ClangBuiltin<"__builtin_ia32_vcvttph2uqq256_mask">,
5956
        DefaultAttrsIntrinsic<[ llvm_v4i64_ty ],
5957
                              [ llvm_v8f16_ty, llvm_v4i64_ty, llvm_i8_ty ],
5958
                              [ IntrNoMem ]>;
5959
  def int_x86_avx512fp16_mask_vcvttph2uqq_512
5960
      : ClangBuiltin<"__builtin_ia32_vcvttph2uqq512_mask">,
5961
        DefaultAttrsIntrinsic<[ llvm_v8i64_ty ],
5962
                              [ llvm_v8f16_ty, llvm_v8i64_ty, llvm_i8_ty,
5963
                                llvm_i32_ty ],
5964
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
5965
 
5966
  def int_x86_avx512fp16_vcvtsh2si32
5967
      : ClangBuiltin<"__builtin_ia32_vcvtsh2si32">,
5968
        DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
5969
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
5970
  def int_x86_avx512fp16_vcvtsh2usi32
5971
      : ClangBuiltin<"__builtin_ia32_vcvtsh2usi32">,
5972
        DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
5973
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
5974
  def int_x86_avx512fp16_vcvtsh2si64
5975
      : ClangBuiltin<"__builtin_ia32_vcvtsh2si64">,
5976
        DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
5977
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
5978
  def int_x86_avx512fp16_vcvtsh2usi64
5979
      : ClangBuiltin<"__builtin_ia32_vcvtsh2usi64">,
5980
        DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
5981
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
5982
  def int_x86_avx512fp16_vcvtusi2sh
5983
      : ClangBuiltin<"__builtin_ia32_vcvtusi2sh">,
5984
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5985
                              [ llvm_v8f16_ty, llvm_i32_ty, llvm_i32_ty ],
5986
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5987
  def int_x86_avx512fp16_vcvtusi642sh
5988
      : ClangBuiltin<"__builtin_ia32_vcvtusi642sh">,
5989
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5990
                              [ llvm_v8f16_ty, llvm_i64_ty, llvm_i32_ty ],
5991
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5992
  def int_x86_avx512fp16_vcvtsi2sh
5993
      : ClangBuiltin<"__builtin_ia32_vcvtsi2sh">,
5994
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
5995
                              [ llvm_v8f16_ty, llvm_i32_ty, llvm_i32_ty ],
5996
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
5997
  def int_x86_avx512fp16_vcvtsi642sh
5998
      : ClangBuiltin<"__builtin_ia32_vcvtsi642sh">,
5999
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6000
                              [ llvm_v8f16_ty, llvm_i64_ty, llvm_i32_ty ],
6001
                              [ IntrNoMem, ImmArg<ArgIndex<2>> ]>;
6002
  def int_x86_avx512fp16_vcvttsh2si32
6003
      : ClangBuiltin<"__builtin_ia32_vcvttsh2si32">,
6004
        DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
6005
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6006
  def int_x86_avx512fp16_vcvttsh2si64
6007
      : ClangBuiltin<"__builtin_ia32_vcvttsh2si64">,
6008
        DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
6009
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6010
  def int_x86_avx512fp16_vcvttsh2usi32
6011
      : ClangBuiltin<"__builtin_ia32_vcvttsh2usi32">,
6012
        DefaultAttrsIntrinsic<[ llvm_i32_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
6013
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6014
  def int_x86_avx512fp16_vcvttsh2usi64
6015
      : ClangBuiltin<"__builtin_ia32_vcvttsh2usi64">,
6016
        DefaultAttrsIntrinsic<[ llvm_i64_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
6017
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6018
 
6019
  def int_x86_avx512fp16_sqrt_ph_512
6020
      : DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6021
                              [ llvm_v32f16_ty, llvm_i32_ty ],
6022
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6023
  def int_x86_avx512fp16_mask_sqrt_sh
6024
      : DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6025
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6026
                                llvm_i8_ty, llvm_i32_ty ],
6027
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6028
  def int_x86_avx512fp16_mask_rsqrt_ph_128
6029
      : ClangBuiltin<"__builtin_ia32_rsqrtph128_mask">,
6030
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6031
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i8_ty ],
6032
                              [ IntrNoMem ]>;
6033
  def int_x86_avx512fp16_mask_rsqrt_ph_256
6034
      : ClangBuiltin<"__builtin_ia32_rsqrtph256_mask">,
6035
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6036
                              [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i16_ty ],
6037
                              [ IntrNoMem ]>;
6038
  def int_x86_avx512fp16_mask_rsqrt_ph_512
6039
      : ClangBuiltin<"__builtin_ia32_rsqrtph512_mask">,
6040
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6041
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
6042
                              [ IntrNoMem ]>;
6043
  def int_x86_avx512fp16_mask_rsqrt_sh
6044
      : ClangBuiltin<"__builtin_ia32_rsqrtsh_mask">,
6045
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6046
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6047
                                llvm_i8_ty ],
6048
                              [ IntrNoMem ]>;
6049
  def int_x86_avx512fp16_mask_rcp_ph_128
6050
      : ClangBuiltin<"__builtin_ia32_rcpph128_mask">,
6051
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6052
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i8_ty ],
6053
                              [ IntrNoMem ]>;
6054
  def int_x86_avx512fp16_mask_rcp_ph_256
6055
      : ClangBuiltin<"__builtin_ia32_rcpph256_mask">,
6056
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6057
                              [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i16_ty ],
6058
                              [ IntrNoMem ]>;
6059
  def int_x86_avx512fp16_mask_rcp_ph_512
6060
      : ClangBuiltin<"__builtin_ia32_rcpph512_mask">,
6061
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6062
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty ],
6063
                              [ IntrNoMem ]>;
6064
  def int_x86_avx512fp16_mask_rcp_sh
6065
      : ClangBuiltin<"__builtin_ia32_rcpsh_mask">,
6066
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6067
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6068
                                llvm_i8_ty ],
6069
                              [ IntrNoMem ]>;
6070
  def int_x86_avx512fp16_mask_reduce_ph_128
6071
      : ClangBuiltin<"__builtin_ia32_reduceph128_mask">,
6072
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6073
                              [ llvm_v8f16_ty, llvm_i32_ty, llvm_v8f16_ty,
6074
                                llvm_i8_ty ],
6075
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6076
  def int_x86_avx512fp16_mask_reduce_ph_256
6077
      : ClangBuiltin<"__builtin_ia32_reduceph256_mask">,
6078
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6079
                              [ llvm_v16f16_ty, llvm_i32_ty, llvm_v16f16_ty,
6080
                                llvm_i16_ty ],
6081
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6082
  def int_x86_avx512fp16_mask_reduce_ph_512
6083
      : ClangBuiltin<"__builtin_ia32_reduceph512_mask">,
6084
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6085
                              [ llvm_v32f16_ty, llvm_i32_ty, llvm_v32f16_ty,
6086
                                llvm_i32_ty, llvm_i32_ty ],
6087
                              [ IntrNoMem, ImmArg<ArgIndex<1>>,
6088
                                ImmArg<ArgIndex<4>> ]>;
6089
  def int_x86_avx512fp16_mask_reduce_sh
6090
      : ClangBuiltin<"__builtin_ia32_reducesh_mask">,
6091
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6092
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6093
                                llvm_i8_ty, llvm_i32_ty, llvm_i32_ty ],
6094
                              [ IntrNoMem, ImmArg<ArgIndex<4>>,
6095
                                ImmArg<ArgIndex<5>> ]>;
6096
  def int_x86_avx512fp16_fpclass_ph_128
6097
      : DefaultAttrsIntrinsic<[ llvm_v8i1_ty ], [ llvm_v8f16_ty, llvm_i32_ty ],
6098
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6099
  def int_x86_avx512fp16_fpclass_ph_256
6100
      : DefaultAttrsIntrinsic<[ llvm_v16i1_ty ],
6101
                              [ llvm_v16f16_ty, llvm_i32_ty ],
6102
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6103
  def int_x86_avx512fp16_fpclass_ph_512
6104
      : DefaultAttrsIntrinsic<[ llvm_v32i1_ty ],
6105
                              [ llvm_v32f16_ty, llvm_i32_ty ],
6106
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6107
  def int_x86_avx512fp16_mask_fpclass_sh
6108
      : ClangBuiltin<"__builtin_ia32_fpclasssh_mask">,
6109
        DefaultAttrsIntrinsic<[ llvm_i8_ty ],
6110
                              [ llvm_v8f16_ty, llvm_i32_ty, llvm_i8_ty ],
6111
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6112
  def int_x86_avx512fp16_mask_getexp_ph_128
6113
      : ClangBuiltin<"__builtin_ia32_getexpph128_mask">,
6114
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6115
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i8_ty ],
6116
                              [ IntrNoMem ]>;
6117
  def int_x86_avx512fp16_mask_getexp_ph_256
6118
      : ClangBuiltin<"__builtin_ia32_getexpph256_mask">,
6119
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6120
                              [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_i16_ty ],
6121
                              [ IntrNoMem ]>;
6122
  def int_x86_avx512fp16_mask_getexp_ph_512
6123
      : ClangBuiltin<"__builtin_ia32_getexpph512_mask">,
6124
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6125
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_i32_ty,
6126
                                llvm_i32_ty ],
6127
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
6128
  def int_x86_avx512fp16_mask_getexp_sh
6129
      : ClangBuiltin<"__builtin_ia32_getexpsh128_round_mask">,
6130
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6131
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6132
                                llvm_i8_ty, llvm_i32_ty ],
6133
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6134
  def int_x86_avx512fp16_mask_getmant_ph_128
6135
      : ClangBuiltin<"__builtin_ia32_getmantph128_mask">,
6136
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6137
                              [ llvm_v8f16_ty, llvm_i32_ty, llvm_v8f16_ty,
6138
                                llvm_i8_ty ],
6139
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6140
  def int_x86_avx512fp16_mask_getmant_ph_256
6141
      : ClangBuiltin<"__builtin_ia32_getmantph256_mask">,
6142
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6143
                              [ llvm_v16f16_ty, llvm_i32_ty, llvm_v16f16_ty,
6144
                                llvm_i16_ty ],
6145
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6146
  def int_x86_avx512fp16_mask_getmant_ph_512
6147
      : ClangBuiltin<"__builtin_ia32_getmantph512_mask">,
6148
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6149
                              [ llvm_v32f16_ty, llvm_i32_ty, llvm_v32f16_ty,
6150
                                llvm_i32_ty, llvm_i32_ty ],
6151
                              [ IntrNoMem, ImmArg<ArgIndex<1>>,
6152
                                ImmArg<ArgIndex<4>> ]>;
6153
  def int_x86_avx512fp16_mask_getmant_sh
6154
      : ClangBuiltin<"__builtin_ia32_getmantsh_round_mask">,
6155
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6156
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_i32_ty,
6157
                                llvm_v8f16_ty, llvm_i8_ty, llvm_i32_ty ],
6158
                              [ IntrNoMem, ImmArg<ArgIndex<2>>,
6159
                                ImmArg<ArgIndex<5>> ]>;
6160
  def int_x86_avx512fp16_mask_rndscale_ph_128
6161
      : ClangBuiltin<"__builtin_ia32_rndscaleph_128_mask">,
6162
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6163
                              [ llvm_v8f16_ty, llvm_i32_ty, llvm_v8f16_ty,
6164
                                llvm_i8_ty ],
6165
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6166
  def int_x86_avx512fp16_mask_rndscale_ph_256
6167
      : ClangBuiltin<"__builtin_ia32_rndscaleph_256_mask">,
6168
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6169
                              [ llvm_v16f16_ty, llvm_i32_ty, llvm_v16f16_ty,
6170
                                llvm_i16_ty ],
6171
                              [ IntrNoMem, ImmArg<ArgIndex<1>> ]>;
6172
  def int_x86_avx512fp16_mask_rndscale_ph_512
6173
      : ClangBuiltin<"__builtin_ia32_rndscaleph_mask">,
6174
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6175
                              [ llvm_v32f16_ty, llvm_i32_ty, llvm_v32f16_ty,
6176
                                llvm_i32_ty, llvm_i32_ty ],
6177
                              [ IntrNoMem, ImmArg<ArgIndex<1>>,
6178
                                ImmArg<ArgIndex<4>> ]>;
6179
  def int_x86_avx512fp16_mask_rndscale_sh
6180
      : ClangBuiltin<"__builtin_ia32_rndscalesh_round_mask">,
6181
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6182
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6183
                                llvm_i8_ty, llvm_i32_ty, llvm_i32_ty ],
6184
                              [ IntrNoMem, ImmArg<ArgIndex<4>>,
6185
                                ImmArg<ArgIndex<5>> ]>;
6186
  def int_x86_avx512fp16_mask_scalef_ph_128
6187
      : ClangBuiltin<"__builtin_ia32_scalefph128_mask">,
6188
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6189
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6190
                                llvm_i8_ty ],
6191
                              [ IntrNoMem ]>;
6192
  def int_x86_avx512fp16_mask_scalef_ph_256
6193
      : ClangBuiltin<"__builtin_ia32_scalefph256_mask">,
6194
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6195
                              [ llvm_v16f16_ty, llvm_v16f16_ty, llvm_v16f16_ty,
6196
                                llvm_i16_ty ],
6197
                              [ IntrNoMem ]>;
6198
  def int_x86_avx512fp16_mask_scalef_ph_512
6199
      : ClangBuiltin<"__builtin_ia32_scalefph512_mask">,
6200
        DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6201
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_v32f16_ty,
6202
                                llvm_i32_ty, llvm_i32_ty ],
6203
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6204
  def int_x86_avx512fp16_mask_scalef_sh
6205
      : ClangBuiltin<"__builtin_ia32_scalefsh_round_mask">,
6206
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6207
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty,
6208
                                llvm_i8_ty, llvm_i32_ty ],
6209
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6210
 
6211
  def int_x86_avx512fp16_vfmadd_ph_512
6212
      : DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6213
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_v32f16_ty,
6214
                                llvm_i32_ty ],
6215
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
6216
  def int_x86_avx512fp16_vfmaddsub_ph_128
6217
      : ClangBuiltin<"__builtin_ia32_vfmaddsubph">,
6218
        DefaultAttrsIntrinsic<[ llvm_v8f16_ty ],
6219
                              [ llvm_v8f16_ty, llvm_v8f16_ty, llvm_v8f16_ty ],
6220
                              [ IntrNoMem ]>;
6221
  def int_x86_avx512fp16_vfmaddsub_ph_256
6222
      : ClangBuiltin<"__builtin_ia32_vfmaddsubph256">,
6223
        DefaultAttrsIntrinsic<[ llvm_v16f16_ty ],
6224
                              [ llvm_v16f16_ty, llvm_v16f16_ty,
6225
                                llvm_v16f16_ty ],
6226
                              [ IntrNoMem ]>;
6227
  def int_x86_avx512fp16_vfmaddsub_ph_512
6228
      : DefaultAttrsIntrinsic<[ llvm_v32f16_ty ],
6229
                              [ llvm_v32f16_ty, llvm_v32f16_ty, llvm_v32f16_ty,
6230
                                llvm_i32_ty ],
6231
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
6232
  def int_x86_avx512fp16_vfmadd_f16
6233
      : DefaultAttrsIntrinsic<[ llvm_half_ty ],
6234
                              [ llvm_half_ty, llvm_half_ty, llvm_half_ty,
6235
                                llvm_i32_ty ],
6236
                              [ IntrNoMem, ImmArg<ArgIndex<3>> ]>;
6237
 
6238
  def int_x86_avx512fp16_mask_vfcmadd_cph_128
6239
      : ClangBuiltin<"__builtin_ia32_vfcmaddcph128_mask">,
6240
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6241
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6242
                                llvm_i8_ty ],
6243
                              [ IntrNoMem ]>;
6244
  def int_x86_avx512fp16_maskz_vfcmadd_cph_128
6245
      : ClangBuiltin<"__builtin_ia32_vfcmaddcph128_maskz">,
6246
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6247
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6248
                                llvm_i8_ty ],
6249
                              [ IntrNoMem ]>;
6250
  def int_x86_avx512fp16_mask_vfcmadd_cph_256
6251
      : ClangBuiltin<"__builtin_ia32_vfcmaddcph256_mask">,
6252
        DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
6253
                              [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
6254
                                llvm_i8_ty ],
6255
                              [ IntrNoMem ]>;
6256
  def int_x86_avx512fp16_maskz_vfcmadd_cph_256
6257
      : ClangBuiltin<"__builtin_ia32_vfcmaddcph256_maskz">,
6258
        DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
6259
                              [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
6260
                                llvm_i8_ty ],
6261
                              [ IntrNoMem ]>;
6262
  def int_x86_avx512fp16_mask_vfcmadd_cph_512
6263
      : ClangBuiltin<"__builtin_ia32_vfcmaddcph512_mask3">,
6264
        DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
6265
                              [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
6266
                                llvm_i16_ty, llvm_i32_ty ],
6267
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6268
  def int_x86_avx512fp16_maskz_vfcmadd_cph_512
6269
      : ClangBuiltin<"__builtin_ia32_vfcmaddcph512_maskz">,
6270
        DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
6271
                              [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
6272
                                llvm_i16_ty, llvm_i32_ty ],
6273
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6274
  def int_x86_avx512fp16_mask_vfmadd_cph_128
6275
      : ClangBuiltin<"__builtin_ia32_vfmaddcph128_mask">,
6276
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6277
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6278
                                llvm_i8_ty ],
6279
                              [ IntrNoMem ]>;
6280
  def int_x86_avx512fp16_maskz_vfmadd_cph_128
6281
      : ClangBuiltin<"__builtin_ia32_vfmaddcph128_maskz">,
6282
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6283
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6284
                                llvm_i8_ty ],
6285
                              [ IntrNoMem ]>;
6286
  def int_x86_avx512fp16_mask_vfmadd_cph_256
6287
      : ClangBuiltin<"__builtin_ia32_vfmaddcph256_mask">,
6288
        DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
6289
                              [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
6290
                                llvm_i8_ty ],
6291
                              [ IntrNoMem ]>;
6292
  def int_x86_avx512fp16_maskz_vfmadd_cph_256
6293
      : ClangBuiltin<"__builtin_ia32_vfmaddcph256_maskz">,
6294
        DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
6295
                              [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
6296
                                llvm_i8_ty ],
6297
                              [ IntrNoMem ]>;
6298
  def int_x86_avx512fp16_mask_vfmadd_cph_512
6299
      : ClangBuiltin<"__builtin_ia32_vfmaddcph512_mask3">,
6300
        DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
6301
                              [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
6302
                                llvm_i16_ty, llvm_i32_ty ],
6303
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6304
  def int_x86_avx512fp16_maskz_vfmadd_cph_512
6305
      : ClangBuiltin<"__builtin_ia32_vfmaddcph512_maskz">,
6306
        DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
6307
                              [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
6308
                                llvm_i16_ty, llvm_i32_ty ],
6309
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6310
  def int_x86_avx512fp16_mask_vfmadd_csh
6311
      : ClangBuiltin<"__builtin_ia32_vfmaddcsh_mask">,
6312
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6313
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6314
                                llvm_i8_ty, llvm_i32_ty ],
6315
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6316
  def int_x86_avx512fp16_maskz_vfmadd_csh
6317
      : ClangBuiltin<"__builtin_ia32_vfmaddcsh_maskz">,
6318
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6319
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6320
                                llvm_i8_ty, llvm_i32_ty ],
6321
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6322
  def int_x86_avx512fp16_mask_vfcmadd_csh
6323
      : ClangBuiltin<"__builtin_ia32_vfcmaddcsh_mask">,
6324
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6325
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6326
                                llvm_i8_ty, llvm_i32_ty ],
6327
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6328
  def int_x86_avx512fp16_maskz_vfcmadd_csh
6329
      : ClangBuiltin<"__builtin_ia32_vfcmaddcsh_maskz">,
6330
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6331
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6332
                                llvm_i8_ty, llvm_i32_ty ],
6333
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6334
  def int_x86_avx512fp16_mask_vfmul_cph_128
6335
      : ClangBuiltin<"__builtin_ia32_vfmulcph128_mask">,
6336
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6337
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6338
                                llvm_i8_ty ],
6339
                              [ IntrNoMem ]>;
6340
  def int_x86_avx512fp16_mask_vfcmul_cph_128
6341
      : ClangBuiltin<"__builtin_ia32_vfcmulcph128_mask">,
6342
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6343
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6344
                                llvm_i8_ty ],
6345
                              [ IntrNoMem ]>;
6346
  def int_x86_avx512fp16_mask_vfmul_cph_256
6347
      : ClangBuiltin<"__builtin_ia32_vfmulcph256_mask">,
6348
        DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
6349
                              [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
6350
                                llvm_i8_ty ],
6351
                              [ IntrNoMem ]>;
6352
  def int_x86_avx512fp16_mask_vfcmul_cph_256
6353
      : ClangBuiltin<"__builtin_ia32_vfcmulcph256_mask">,
6354
        DefaultAttrsIntrinsic<[ llvm_v8f32_ty ],
6355
                              [ llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,
6356
                                llvm_i8_ty ],
6357
                              [ IntrNoMem ]>;
6358
  def int_x86_avx512fp16_mask_vfmul_cph_512
6359
      : ClangBuiltin<"__builtin_ia32_vfmulcph512_mask">,
6360
        DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
6361
                              [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
6362
                                llvm_i16_ty, llvm_i32_ty ],
6363
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6364
  def int_x86_avx512fp16_mask_vfcmul_cph_512
6365
      : ClangBuiltin<"__builtin_ia32_vfcmulcph512_mask">,
6366
        DefaultAttrsIntrinsic<[ llvm_v16f32_ty ],
6367
                              [ llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,
6368
                                llvm_i16_ty, llvm_i32_ty ],
6369
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6370
  def int_x86_avx512fp16_mask_vfmul_csh
6371
      : ClangBuiltin<"__builtin_ia32_vfmulcsh_mask">,
6372
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6373
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6374
                                llvm_i8_ty, llvm_i32_ty ],
6375
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6376
  def int_x86_avx512fp16_mask_vfcmul_csh
6377
      : ClangBuiltin<"__builtin_ia32_vfcmulcsh_mask">,
6378
        DefaultAttrsIntrinsic<[ llvm_v4f32_ty ],
6379
                              [ llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
6380
                                llvm_i8_ty, llvm_i32_ty ],
6381
                              [ IntrNoMem, ImmArg<ArgIndex<4>> ]>;
6382
}