1 //===- IntrinsicsX86.td - Defines X86 intrinsics -----------*- tablegen -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines all of the X86-specific intrinsics.
11 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
15 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
16 def int_x86_int : Intrinsic<[], [llvm_i8_ty], [ImmArg<0>]>;
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]>;
24 // Marks the EH registration node created in LLVM IR prior to code generation.
25 def int_x86_seh_ehregnode : Intrinsic<[], [llvm_ptr_ty], []>;
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], []>;
31 //===----------------------------------------------------------------------===//
33 let TargetPrefix = "x86" in {
34 def int_x86_flags_read_u32 : GCCBuiltin<"__builtin_ia32_readeflags_u32">,
35 Intrinsic<[llvm_i32_ty], [], []>;
36 def int_x86_flags_read_u64 : GCCBuiltin<"__builtin_ia32_readeflags_u64">,
37 Intrinsic<[llvm_i64_ty], [], []>;
38 def int_x86_flags_write_u32 : GCCBuiltin<"__builtin_ia32_writeeflags_u32">,
39 Intrinsic<[], [llvm_i32_ty], []>;
40 def int_x86_flags_write_u64 : GCCBuiltin<"__builtin_ia32_writeeflags_u64">,
41 Intrinsic<[], [llvm_i64_ty], []>;
44 //===----------------------------------------------------------------------===//
45 // Read Time Stamp Counter.
46 let TargetPrefix = "x86" in {
47 def int_x86_rdtsc : GCCBuiltin<"__builtin_ia32_rdtsc">,
48 Intrinsic<[llvm_i64_ty], [], []>;
50 Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
53 // Read Performance-Monitoring Counter.
54 let TargetPrefix = "x86" in {
55 def int_x86_rdpmc : GCCBuiltin<"__builtin_ia32_rdpmc">,
56 Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
60 let TargetPrefix = "x86" in {
61 def int_x86_rdpid : GCCBuiltin<"__builtin_ia32_rdpid">,
62 Intrinsic<[llvm_i32_ty], [], []>;
65 //===----------------------------------------------------------------------===//
67 let TargetPrefix = "x86" in {
68 def int_x86_incsspd : GCCBuiltin<"__builtin_ia32_incsspd">,
69 Intrinsic<[], [llvm_i32_ty], []>;
70 def int_x86_incsspq : GCCBuiltin<"__builtin_ia32_incsspq">,
71 Intrinsic<[], [llvm_i64_ty], []>;
72 def int_x86_rdsspd : GCCBuiltin<"__builtin_ia32_rdsspd">,
73 Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>;
74 def int_x86_rdsspq : GCCBuiltin<"__builtin_ia32_rdsspq">,
75 Intrinsic<[llvm_i64_ty], [llvm_i64_ty], []>;
76 def int_x86_saveprevssp : GCCBuiltin<"__builtin_ia32_saveprevssp">,
77 Intrinsic<[], [], []>;
78 def int_x86_rstorssp : GCCBuiltin<"__builtin_ia32_rstorssp">,
79 Intrinsic<[], [llvm_ptr_ty], []>;
80 def int_x86_wrssd : GCCBuiltin<"__builtin_ia32_wrssd">,
81 Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
82 def int_x86_wrssq : GCCBuiltin<"__builtin_ia32_wrssq">,
83 Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], []>;
84 def int_x86_wrussd : GCCBuiltin<"__builtin_ia32_wrussd">,
85 Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
86 def int_x86_wrussq : GCCBuiltin<"__builtin_ia32_wrussq">,
87 Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], []>;
88 def int_x86_setssbsy : GCCBuiltin<"__builtin_ia32_setssbsy">,
89 Intrinsic<[], [], []>;
90 def int_x86_clrssbsy : GCCBuiltin<"__builtin_ia32_clrssbsy">,
91 Intrinsic<[], [llvm_ptr_ty], []>;
94 //===----------------------------------------------------------------------===//
97 let TargetPrefix = "x86" in {
98 def int_x86_3dnow_pavgusb : GCCBuiltin<"__builtin_ia32_pavgusb">,
99 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
101 def int_x86_3dnow_pf2id : GCCBuiltin<"__builtin_ia32_pf2id">,
102 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
103 def int_x86_3dnow_pfacc : GCCBuiltin<"__builtin_ia32_pfacc">,
104 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
106 def int_x86_3dnow_pfadd : GCCBuiltin<"__builtin_ia32_pfadd">,
107 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
109 def int_x86_3dnow_pfcmpeq : GCCBuiltin<"__builtin_ia32_pfcmpeq">,
110 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
112 def int_x86_3dnow_pfcmpge : GCCBuiltin<"__builtin_ia32_pfcmpge">,
113 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
115 def int_x86_3dnow_pfcmpgt : GCCBuiltin<"__builtin_ia32_pfcmpgt">,
116 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
118 def int_x86_3dnow_pfmax : GCCBuiltin<"__builtin_ia32_pfmax">,
119 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
121 def int_x86_3dnow_pfmin : GCCBuiltin<"__builtin_ia32_pfmin">,
122 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
124 def int_x86_3dnow_pfmul : GCCBuiltin<"__builtin_ia32_pfmul">,
125 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
127 def int_x86_3dnow_pfrcp : GCCBuiltin<"__builtin_ia32_pfrcp">,
128 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
129 def int_x86_3dnow_pfrcpit1 : GCCBuiltin<"__builtin_ia32_pfrcpit1">,
130 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
132 def int_x86_3dnow_pfrcpit2 : GCCBuiltin<"__builtin_ia32_pfrcpit2">,
133 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
135 def int_x86_3dnow_pfrsqrt : GCCBuiltin<"__builtin_ia32_pfrsqrt">,
136 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
137 def int_x86_3dnow_pfrsqit1 : GCCBuiltin<"__builtin_ia32_pfrsqit1">,
138 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
140 def int_x86_3dnow_pfsub : GCCBuiltin<"__builtin_ia32_pfsub">,
141 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
143 def int_x86_3dnow_pfsubr : GCCBuiltin<"__builtin_ia32_pfsubr">,
144 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
146 def int_x86_3dnow_pi2fd : GCCBuiltin<"__builtin_ia32_pi2fd">,
147 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
148 def int_x86_3dnow_pmulhrw : GCCBuiltin<"__builtin_ia32_pmulhrw">,
149 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
153 //===----------------------------------------------------------------------===//
156 let TargetPrefix = "x86" in {
157 def int_x86_3dnowa_pf2iw : GCCBuiltin<"__builtin_ia32_pf2iw">,
158 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
159 def int_x86_3dnowa_pfnacc : GCCBuiltin<"__builtin_ia32_pfnacc">,
160 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
162 def int_x86_3dnowa_pfpnacc : GCCBuiltin<"__builtin_ia32_pfpnacc">,
163 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
165 def int_x86_3dnowa_pi2fw : GCCBuiltin<"__builtin_ia32_pi2fw">,
166 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
167 def int_x86_3dnowa_pswapd :
168 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
171 //===----------------------------------------------------------------------===//
175 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
176 def int_x86_sse_rcp_ss : GCCBuiltin<"__builtin_ia32_rcpss">,
177 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
179 def int_x86_sse_rcp_ps : GCCBuiltin<"__builtin_ia32_rcpps">,
180 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
182 def int_x86_sse_rsqrt_ss : GCCBuiltin<"__builtin_ia32_rsqrtss">,
183 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
185 def int_x86_sse_rsqrt_ps : GCCBuiltin<"__builtin_ia32_rsqrtps">,
186 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
188 def int_x86_sse_min_ss : GCCBuiltin<"__builtin_ia32_minss">,
189 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
190 llvm_v4f32_ty], [IntrNoMem]>;
191 def int_x86_sse_min_ps : GCCBuiltin<"__builtin_ia32_minps">,
192 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
193 llvm_v4f32_ty], [IntrNoMem]>;
194 def int_x86_sse_max_ss : GCCBuiltin<"__builtin_ia32_maxss">,
195 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
196 llvm_v4f32_ty], [IntrNoMem]>;
197 def int_x86_sse_max_ps : GCCBuiltin<"__builtin_ia32_maxps">,
198 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
199 llvm_v4f32_ty], [IntrNoMem]>;
203 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
204 def int_x86_sse_cmp_ss : GCCBuiltin<"__builtin_ia32_cmpss">,
205 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
206 llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem, ImmArg<2>]>;
207 // NOTE: This comparison intrinsic is not used by clang as long as the
208 // distinction in signaling behaviour is not implemented.
209 def int_x86_sse_cmp_ps :
210 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
211 llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem, ImmArg<2>]>;
212 def int_x86_sse_comieq_ss : GCCBuiltin<"__builtin_ia32_comieq">,
213 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
214 llvm_v4f32_ty], [IntrNoMem]>;
215 def int_x86_sse_comilt_ss : GCCBuiltin<"__builtin_ia32_comilt">,
216 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
217 llvm_v4f32_ty], [IntrNoMem]>;
218 def int_x86_sse_comile_ss : GCCBuiltin<"__builtin_ia32_comile">,
219 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
220 llvm_v4f32_ty], [IntrNoMem]>;
221 def int_x86_sse_comigt_ss : GCCBuiltin<"__builtin_ia32_comigt">,
222 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
223 llvm_v4f32_ty], [IntrNoMem]>;
224 def int_x86_sse_comige_ss : GCCBuiltin<"__builtin_ia32_comige">,
225 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
226 llvm_v4f32_ty], [IntrNoMem]>;
227 def int_x86_sse_comineq_ss : GCCBuiltin<"__builtin_ia32_comineq">,
228 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
229 llvm_v4f32_ty], [IntrNoMem]>;
230 def int_x86_sse_ucomieq_ss : GCCBuiltin<"__builtin_ia32_ucomieq">,
231 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
232 llvm_v4f32_ty], [IntrNoMem]>;
233 def int_x86_sse_ucomilt_ss : GCCBuiltin<"__builtin_ia32_ucomilt">,
234 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
235 llvm_v4f32_ty], [IntrNoMem]>;
236 def int_x86_sse_ucomile_ss : GCCBuiltin<"__builtin_ia32_ucomile">,
237 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
238 llvm_v4f32_ty], [IntrNoMem]>;
239 def int_x86_sse_ucomigt_ss : GCCBuiltin<"__builtin_ia32_ucomigt">,
240 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
241 llvm_v4f32_ty], [IntrNoMem]>;
242 def int_x86_sse_ucomige_ss : GCCBuiltin<"__builtin_ia32_ucomige">,
243 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
244 llvm_v4f32_ty], [IntrNoMem]>;
245 def int_x86_sse_ucomineq_ss : GCCBuiltin<"__builtin_ia32_ucomineq">,
246 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
247 llvm_v4f32_ty], [IntrNoMem]>;
252 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
253 def int_x86_sse_cvtss2si : GCCBuiltin<"__builtin_ia32_cvtss2si">,
254 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
255 def int_x86_sse_cvtss2si64 : GCCBuiltin<"__builtin_ia32_cvtss2si64">,
256 Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
257 def int_x86_sse_cvttss2si : GCCBuiltin<"__builtin_ia32_cvttss2si">,
258 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
259 def int_x86_sse_cvttss2si64 : GCCBuiltin<"__builtin_ia32_cvttss2si64">,
260 Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
262 def int_x86_sse_cvtps2pi : GCCBuiltin<"__builtin_ia32_cvtps2pi">,
263 Intrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
264 def int_x86_sse_cvttps2pi: GCCBuiltin<"__builtin_ia32_cvttps2pi">,
265 Intrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
266 def int_x86_sse_cvtpi2ps : GCCBuiltin<"__builtin_ia32_cvtpi2ps">,
267 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
268 llvm_x86mmx_ty], [IntrNoMem]>;
271 // Cacheability support ops
272 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
273 def int_x86_sse_sfence : GCCBuiltin<"__builtin_ia32_sfence">,
274 Intrinsic<[], [], []>;
278 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
279 def int_x86_sse_stmxcsr :
280 Intrinsic<[], [llvm_ptr_ty],
281 [IntrWriteMem, IntrArgMemOnly,
282 // This prevents reordering with ldmxcsr
283 IntrHasSideEffects]>;
284 def int_x86_sse_ldmxcsr :
285 Intrinsic<[], [llvm_ptr_ty],
286 [IntrReadMem, IntrArgMemOnly, IntrHasSideEffects,
287 // FIXME: LDMXCSR does not actualy write to memory,
288 // but Fast and DAG Isel both use writing to memory
289 // as a proxy for having side effects.
294 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
295 def int_x86_sse_movmsk_ps : GCCBuiltin<"__builtin_ia32_movmskps">,
296 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
299 //===----------------------------------------------------------------------===//
303 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
304 def int_x86_sse2_min_sd : GCCBuiltin<"__builtin_ia32_minsd">,
305 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
306 llvm_v2f64_ty], [IntrNoMem]>;
307 def int_x86_sse2_min_pd : GCCBuiltin<"__builtin_ia32_minpd">,
308 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
309 llvm_v2f64_ty], [IntrNoMem]>;
310 def int_x86_sse2_max_sd : GCCBuiltin<"__builtin_ia32_maxsd">,
311 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
312 llvm_v2f64_ty], [IntrNoMem]>;
313 def int_x86_sse2_max_pd : GCCBuiltin<"__builtin_ia32_maxpd">,
314 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
315 llvm_v2f64_ty], [IntrNoMem]>;
319 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
320 def int_x86_sse2_cmp_sd : GCCBuiltin<"__builtin_ia32_cmpsd">,
321 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
322 llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem, ImmArg<2>]>;
323 // NOTE: This comparison intrinsic is not used by clang as long as the
324 // distinction in signaling behaviour is not implemented.
325 def int_x86_sse2_cmp_pd :
326 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
327 llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem, ImmArg<2>]>;
328 def int_x86_sse2_comieq_sd : GCCBuiltin<"__builtin_ia32_comisdeq">,
329 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
330 llvm_v2f64_ty], [IntrNoMem]>;
331 def int_x86_sse2_comilt_sd : GCCBuiltin<"__builtin_ia32_comisdlt">,
332 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
333 llvm_v2f64_ty], [IntrNoMem]>;
334 def int_x86_sse2_comile_sd : GCCBuiltin<"__builtin_ia32_comisdle">,
335 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
336 llvm_v2f64_ty], [IntrNoMem]>;
337 def int_x86_sse2_comigt_sd : GCCBuiltin<"__builtin_ia32_comisdgt">,
338 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
339 llvm_v2f64_ty], [IntrNoMem]>;
340 def int_x86_sse2_comige_sd : GCCBuiltin<"__builtin_ia32_comisdge">,
341 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
342 llvm_v2f64_ty], [IntrNoMem]>;
343 def int_x86_sse2_comineq_sd : GCCBuiltin<"__builtin_ia32_comisdneq">,
344 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
345 llvm_v2f64_ty], [IntrNoMem]>;
346 def int_x86_sse2_ucomieq_sd : GCCBuiltin<"__builtin_ia32_ucomisdeq">,
347 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
348 llvm_v2f64_ty], [IntrNoMem]>;
349 def int_x86_sse2_ucomilt_sd : GCCBuiltin<"__builtin_ia32_ucomisdlt">,
350 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
351 llvm_v2f64_ty], [IntrNoMem]>;
352 def int_x86_sse2_ucomile_sd : GCCBuiltin<"__builtin_ia32_ucomisdle">,
353 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
354 llvm_v2f64_ty], [IntrNoMem]>;
355 def int_x86_sse2_ucomigt_sd : GCCBuiltin<"__builtin_ia32_ucomisdgt">,
356 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
357 llvm_v2f64_ty], [IntrNoMem]>;
358 def int_x86_sse2_ucomige_sd : GCCBuiltin<"__builtin_ia32_ucomisdge">,
359 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
360 llvm_v2f64_ty], [IntrNoMem]>;
361 def int_x86_sse2_ucomineq_sd : GCCBuiltin<"__builtin_ia32_ucomisdneq">,
362 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
363 llvm_v2f64_ty], [IntrNoMem]>;
366 // Integer arithmetic ops.
367 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
368 def int_x86_sse2_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw128">,
369 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
370 llvm_v8i16_ty], [IntrNoMem, Commutative]>;
371 def int_x86_sse2_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw128">,
372 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
373 llvm_v8i16_ty], [IntrNoMem, Commutative]>;
374 def int_x86_sse2_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd128">,
375 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty,
376 llvm_v8i16_ty], [IntrNoMem, Commutative]>;
377 def int_x86_sse2_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb128">,
378 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
379 llvm_v16i8_ty], [IntrNoMem, Commutative]>;
380 def int_x86_sse2_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw128">,
381 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
382 llvm_v8i16_ty], [IntrNoMem, Commutative]>;
383 def int_x86_sse2_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw128">,
384 Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty,
385 llvm_v16i8_ty], [IntrNoMem, Commutative]>;
388 // Integer shift ops.
389 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
390 def int_x86_sse2_psll_w : GCCBuiltin<"__builtin_ia32_psllw128">,
391 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
392 llvm_v8i16_ty], [IntrNoMem]>;
393 def int_x86_sse2_psll_d : GCCBuiltin<"__builtin_ia32_pslld128">,
394 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
395 llvm_v4i32_ty], [IntrNoMem]>;
396 def int_x86_sse2_psll_q : GCCBuiltin<"__builtin_ia32_psllq128">,
397 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
398 llvm_v2i64_ty], [IntrNoMem]>;
399 def int_x86_sse2_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw128">,
400 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
401 llvm_v8i16_ty], [IntrNoMem]>;
402 def int_x86_sse2_psrl_d : GCCBuiltin<"__builtin_ia32_psrld128">,
403 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
404 llvm_v4i32_ty], [IntrNoMem]>;
405 def int_x86_sse2_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq128">,
406 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
407 llvm_v2i64_ty], [IntrNoMem]>;
408 def int_x86_sse2_psra_w : GCCBuiltin<"__builtin_ia32_psraw128">,
409 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
410 llvm_v8i16_ty], [IntrNoMem]>;
411 def int_x86_sse2_psra_d : GCCBuiltin<"__builtin_ia32_psrad128">,
412 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
413 llvm_v4i32_ty], [IntrNoMem]>;
415 // Oddly these don't require an immediate due to a gcc compatibility issue.
416 def int_x86_sse2_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi128">,
417 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
418 llvm_i32_ty], [IntrNoMem]>;
419 def int_x86_sse2_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi128">,
420 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
421 llvm_i32_ty], [IntrNoMem]>;
422 def int_x86_sse2_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi128">,
423 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
424 llvm_i32_ty], [IntrNoMem]>;
425 def int_x86_sse2_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi128">,
426 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
427 llvm_i32_ty], [IntrNoMem]>;
428 def int_x86_sse2_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi128">,
429 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
430 llvm_i32_ty], [IntrNoMem]>;
431 def int_x86_sse2_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi128">,
432 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
433 llvm_i32_ty], [IntrNoMem]>;
434 def int_x86_sse2_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi128">,
435 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
436 llvm_i32_ty], [IntrNoMem]>;
437 def int_x86_sse2_psrai_d : GCCBuiltin<"__builtin_ia32_psradi128">,
438 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
439 llvm_i32_ty], [IntrNoMem]>;
443 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
444 def int_x86_sse2_cvtpd2dq : GCCBuiltin<"__builtin_ia32_cvtpd2dq">,
445 Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
446 def int_x86_sse2_cvttpd2dq : GCCBuiltin<"__builtin_ia32_cvttpd2dq">,
447 Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
448 def int_x86_sse2_cvtpd2ps : GCCBuiltin<"__builtin_ia32_cvtpd2ps">,
449 Intrinsic<[llvm_v4f32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
450 def int_x86_sse2_cvtps2dq : GCCBuiltin<"__builtin_ia32_cvtps2dq">,
451 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
452 def int_x86_sse2_cvttps2dq : GCCBuiltin<"__builtin_ia32_cvttps2dq">,
453 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
454 def int_x86_sse2_cvtsd2si : GCCBuiltin<"__builtin_ia32_cvtsd2si">,
455 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
456 def int_x86_sse2_cvtsd2si64 : GCCBuiltin<"__builtin_ia32_cvtsd2si64">,
457 Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
458 def int_x86_sse2_cvttsd2si : GCCBuiltin<"__builtin_ia32_cvttsd2si">,
459 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
460 def int_x86_sse2_cvttsd2si64 : GCCBuiltin<"__builtin_ia32_cvttsd2si64">,
461 Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
462 def int_x86_sse2_cvtsd2ss : GCCBuiltin<"__builtin_ia32_cvtsd2ss">,
463 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
464 llvm_v2f64_ty], [IntrNoMem]>;
465 def int_x86_sse_cvtpd2pi : GCCBuiltin<"__builtin_ia32_cvtpd2pi">,
466 Intrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
467 def int_x86_sse_cvttpd2pi: GCCBuiltin<"__builtin_ia32_cvttpd2pi">,
468 Intrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
469 def int_x86_sse_cvtpi2pd : GCCBuiltin<"__builtin_ia32_cvtpi2pd">,
470 Intrinsic<[llvm_v2f64_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
474 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
475 def int_x86_sse2_packsswb_128 : GCCBuiltin<"__builtin_ia32_packsswb128">,
476 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
477 llvm_v8i16_ty], [IntrNoMem]>;
478 def int_x86_sse2_packssdw_128 : GCCBuiltin<"__builtin_ia32_packssdw128">,
479 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty,
480 llvm_v4i32_ty], [IntrNoMem]>;
481 def int_x86_sse2_packuswb_128 : GCCBuiltin<"__builtin_ia32_packuswb128">,
482 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
483 llvm_v8i16_ty], [IntrNoMem]>;
484 def int_x86_sse2_movmsk_pd : GCCBuiltin<"__builtin_ia32_movmskpd">,
485 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
486 def int_x86_sse2_pmovmskb_128 : GCCBuiltin<"__builtin_ia32_pmovmskb128">,
487 Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
488 def int_x86_sse2_maskmov_dqu : GCCBuiltin<"__builtin_ia32_maskmovdqu">,
489 Intrinsic<[], [llvm_v16i8_ty,
490 llvm_v16i8_ty, llvm_ptr_ty], []>;
491 def int_x86_sse2_clflush : GCCBuiltin<"__builtin_ia32_clflush">,
492 Intrinsic<[], [llvm_ptr_ty], []>;
493 def int_x86_sse2_lfence : GCCBuiltin<"__builtin_ia32_lfence">,
494 Intrinsic<[], [], []>;
495 def int_x86_sse2_mfence : GCCBuiltin<"__builtin_ia32_mfence">,
496 Intrinsic<[], [], []>;
497 def int_x86_sse2_pause : GCCBuiltin<"__builtin_ia32_pause">,
498 Intrinsic<[], [], []>;
501 //===----------------------------------------------------------------------===//
504 // Addition / subtraction ops.
505 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
506 def int_x86_sse3_addsub_ps : GCCBuiltin<"__builtin_ia32_addsubps">,
507 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
508 llvm_v4f32_ty], [IntrNoMem]>;
509 def int_x86_sse3_addsub_pd : GCCBuiltin<"__builtin_ia32_addsubpd">,
510 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
511 llvm_v2f64_ty], [IntrNoMem]>;
515 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
516 def int_x86_sse3_hadd_ps : GCCBuiltin<"__builtin_ia32_haddps">,
517 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
518 llvm_v4f32_ty], [IntrNoMem]>;
519 def int_x86_sse3_hadd_pd : GCCBuiltin<"__builtin_ia32_haddpd">,
520 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
521 llvm_v2f64_ty], [IntrNoMem]>;
522 def int_x86_sse3_hsub_ps : GCCBuiltin<"__builtin_ia32_hsubps">,
523 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
524 llvm_v4f32_ty], [IntrNoMem]>;
525 def int_x86_sse3_hsub_pd : GCCBuiltin<"__builtin_ia32_hsubpd">,
526 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
527 llvm_v2f64_ty], [IntrNoMem]>;
530 // Specialized unaligned load.
531 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
532 def int_x86_sse3_ldu_dq : GCCBuiltin<"__builtin_ia32_lddqu">,
533 Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
536 // Thread synchronization ops.
537 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
538 def int_x86_sse3_monitor : GCCBuiltin<"__builtin_ia32_monitor">,
539 Intrinsic<[], [llvm_ptr_ty,
540 llvm_i32_ty, llvm_i32_ty], []>;
541 def int_x86_sse3_mwait : GCCBuiltin<"__builtin_ia32_mwait">,
542 Intrinsic<[], [llvm_i32_ty,
546 //===----------------------------------------------------------------------===//
549 // Horizontal arithmetic ops
550 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
551 def int_x86_ssse3_phadd_w : GCCBuiltin<"__builtin_ia32_phaddw">,
552 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
553 llvm_x86mmx_ty], [IntrNoMem]>;
554 def int_x86_ssse3_phadd_w_128 : GCCBuiltin<"__builtin_ia32_phaddw128">,
555 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
556 llvm_v8i16_ty], [IntrNoMem]>;
558 def int_x86_ssse3_phadd_d : GCCBuiltin<"__builtin_ia32_phaddd">,
559 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
560 llvm_x86mmx_ty], [IntrNoMem]>;
561 def int_x86_ssse3_phadd_d_128 : GCCBuiltin<"__builtin_ia32_phaddd128">,
562 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
563 llvm_v4i32_ty], [IntrNoMem]>;
565 def int_x86_ssse3_phadd_sw : GCCBuiltin<"__builtin_ia32_phaddsw">,
566 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
567 llvm_x86mmx_ty], [IntrNoMem]>;
568 def int_x86_ssse3_phadd_sw_128 : GCCBuiltin<"__builtin_ia32_phaddsw128">,
569 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
570 llvm_v8i16_ty], [IntrNoMem]>;
572 def int_x86_ssse3_phsub_w : GCCBuiltin<"__builtin_ia32_phsubw">,
573 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
574 llvm_x86mmx_ty], [IntrNoMem]>;
575 def int_x86_ssse3_phsub_w_128 : GCCBuiltin<"__builtin_ia32_phsubw128">,
576 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
577 llvm_v8i16_ty], [IntrNoMem]>;
579 def int_x86_ssse3_phsub_d : GCCBuiltin<"__builtin_ia32_phsubd">,
580 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
581 llvm_x86mmx_ty], [IntrNoMem]>;
582 def int_x86_ssse3_phsub_d_128 : GCCBuiltin<"__builtin_ia32_phsubd128">,
583 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
584 llvm_v4i32_ty], [IntrNoMem]>;
586 def int_x86_ssse3_phsub_sw : GCCBuiltin<"__builtin_ia32_phsubsw">,
587 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
588 llvm_x86mmx_ty], [IntrNoMem]>;
589 def int_x86_ssse3_phsub_sw_128 : GCCBuiltin<"__builtin_ia32_phsubsw128">,
590 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
591 llvm_v8i16_ty], [IntrNoMem]>;
593 def int_x86_ssse3_pmadd_ub_sw : GCCBuiltin<"__builtin_ia32_pmaddubsw">,
594 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
595 llvm_x86mmx_ty], [IntrNoMem]>;
596 def int_x86_ssse3_pmadd_ub_sw_128 : GCCBuiltin<"__builtin_ia32_pmaddubsw128">,
597 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty,
598 llvm_v16i8_ty], [IntrNoMem]>;
601 // Packed multiply high with round and scale
602 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
603 def int_x86_ssse3_pmul_hr_sw : GCCBuiltin<"__builtin_ia32_pmulhrsw">,
604 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
605 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
606 def int_x86_ssse3_pmul_hr_sw_128 : GCCBuiltin<"__builtin_ia32_pmulhrsw128">,
607 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
608 llvm_v8i16_ty], [IntrNoMem, Commutative]>;
612 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
613 def int_x86_ssse3_pshuf_b : GCCBuiltin<"__builtin_ia32_pshufb">,
614 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
615 llvm_x86mmx_ty], [IntrNoMem]>;
616 def int_x86_ssse3_pshuf_b_128 : GCCBuiltin<"__builtin_ia32_pshufb128">,
617 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
618 llvm_v16i8_ty], [IntrNoMem]>;
619 def int_x86_sse_pshuf_w : GCCBuiltin<"__builtin_ia32_pshufw">,
620 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i8_ty],
621 [IntrNoMem, ImmArg<1>]>;
625 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
626 def int_x86_ssse3_psign_b : GCCBuiltin<"__builtin_ia32_psignb">,
627 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
628 llvm_x86mmx_ty], [IntrNoMem]>;
629 def int_x86_ssse3_psign_b_128 : GCCBuiltin<"__builtin_ia32_psignb128">,
630 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
631 llvm_v16i8_ty], [IntrNoMem]>;
633 def int_x86_ssse3_psign_w : GCCBuiltin<"__builtin_ia32_psignw">,
634 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
635 llvm_x86mmx_ty], [IntrNoMem]>;
636 def int_x86_ssse3_psign_w_128 : GCCBuiltin<"__builtin_ia32_psignw128">,
637 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
638 llvm_v8i16_ty], [IntrNoMem]>;
640 def int_x86_ssse3_psign_d : GCCBuiltin<"__builtin_ia32_psignd">,
641 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
642 llvm_x86mmx_ty], [IntrNoMem]>;
643 def int_x86_ssse3_psign_d_128 : GCCBuiltin<"__builtin_ia32_psignd128">,
644 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
645 llvm_v4i32_ty], [IntrNoMem]>;
648 // Absolute value ops
649 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
650 def int_x86_ssse3_pabs_b : GCCBuiltin<"__builtin_ia32_pabsb">,
651 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
653 def int_x86_ssse3_pabs_w : GCCBuiltin<"__builtin_ia32_pabsw">,
654 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
656 def int_x86_ssse3_pabs_d : GCCBuiltin<"__builtin_ia32_pabsd">,
657 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
660 //===----------------------------------------------------------------------===//
664 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
665 def int_x86_sse41_round_ss : GCCBuiltin<"__builtin_ia32_roundss">,
666 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
667 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
668 def int_x86_sse41_round_ps : GCCBuiltin<"__builtin_ia32_roundps">,
669 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
670 llvm_i32_ty], [IntrNoMem, ImmArg<1>]>;
671 def int_x86_sse41_round_sd : GCCBuiltin<"__builtin_ia32_roundsd">,
672 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
673 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
674 def int_x86_sse41_round_pd : GCCBuiltin<"__builtin_ia32_roundpd">,
675 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
676 llvm_i32_ty], [IntrNoMem, ImmArg<1>]>;
679 // Vector min element
680 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
681 def int_x86_sse41_phminposuw : GCCBuiltin<"__builtin_ia32_phminposuw128">,
682 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty],
686 // Advanced Encryption Standard (AES) Instructions
687 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
688 def int_x86_aesni_aesimc : GCCBuiltin<"__builtin_ia32_aesimc128">,
689 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty],
692 def int_x86_aesni_aesenc : GCCBuiltin<"__builtin_ia32_aesenc128">,
693 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
695 def int_x86_aesni_aesenc_256 : GCCBuiltin<"__builtin_ia32_aesenc256">,
696 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
698 def int_x86_aesni_aesenc_512 : GCCBuiltin<"__builtin_ia32_aesenc512">,
699 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
702 def int_x86_aesni_aesenclast : GCCBuiltin<"__builtin_ia32_aesenclast128">,
703 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
705 def int_x86_aesni_aesenclast_256 :
706 GCCBuiltin<"__builtin_ia32_aesenclast256">,
707 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
709 def int_x86_aesni_aesenclast_512 :
710 GCCBuiltin<"__builtin_ia32_aesenclast512">,
711 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
714 def int_x86_aesni_aesdec : GCCBuiltin<"__builtin_ia32_aesdec128">,
715 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
717 def int_x86_aesni_aesdec_256 : GCCBuiltin<"__builtin_ia32_aesdec256">,
718 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
720 def int_x86_aesni_aesdec_512 : GCCBuiltin<"__builtin_ia32_aesdec512">,
721 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
724 def int_x86_aesni_aesdeclast : GCCBuiltin<"__builtin_ia32_aesdeclast128">,
725 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
727 def int_x86_aesni_aesdeclast_256 :
728 GCCBuiltin<"__builtin_ia32_aesdeclast256">,
729 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
731 def int_x86_aesni_aesdeclast_512 :
732 GCCBuiltin<"__builtin_ia32_aesdeclast512">,
733 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
736 def int_x86_aesni_aeskeygenassist :
737 GCCBuiltin<"__builtin_ia32_aeskeygenassist128">,
738 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty],
739 [IntrNoMem, ImmArg<1>]>;
742 // PCLMUL instructions
743 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
744 def int_x86_pclmulqdq : GCCBuiltin<"__builtin_ia32_pclmulqdq128">,
745 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
746 [IntrNoMem, ImmArg<2>]>;
747 def int_x86_pclmulqdq_256 : GCCBuiltin<"__builtin_ia32_pclmulqdq256">,
748 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
749 [IntrNoMem, ImmArg<2>]>;
750 def int_x86_pclmulqdq_512 : GCCBuiltin<"__builtin_ia32_pclmulqdq512">,
751 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty],
752 [IntrNoMem, ImmArg<2>]>;
756 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
757 def int_x86_sse41_packusdw : GCCBuiltin<"__builtin_ia32_packusdw128">,
758 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
763 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
764 def int_x86_sse41_insertps : GCCBuiltin<"__builtin_ia32_insertps128">,
765 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
766 [IntrNoMem, ImmArg<2>]>;
770 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
771 def int_x86_sse41_pblendvb : GCCBuiltin<"__builtin_ia32_pblendvb128">,
772 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,llvm_v16i8_ty],
774 def int_x86_sse41_blendvpd : GCCBuiltin<"__builtin_ia32_blendvpd">,
775 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,llvm_v2f64_ty],
777 def int_x86_sse41_blendvps : GCCBuiltin<"__builtin_ia32_blendvps">,
778 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
782 // Vector dot product
783 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
784 def int_x86_sse41_dppd : GCCBuiltin<"__builtin_ia32_dppd">,
785 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
786 [IntrNoMem, Commutative, ImmArg<2>]>;
787 def int_x86_sse41_dpps : GCCBuiltin<"__builtin_ia32_dpps">,
788 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
789 [IntrNoMem, Commutative, ImmArg<2>]>;
792 // Vector sum of absolute differences
793 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
794 def int_x86_sse41_mpsadbw : GCCBuiltin<"__builtin_ia32_mpsadbw128">,
795 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty,llvm_i8_ty],
796 [IntrNoMem, Commutative, ImmArg<2>]>;
799 // Test instruction with bitwise comparison.
800 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
801 def int_x86_sse41_ptestz : GCCBuiltin<"__builtin_ia32_ptestz128">,
802 Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
804 def int_x86_sse41_ptestc : GCCBuiltin<"__builtin_ia32_ptestc128">,
805 Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
807 def int_x86_sse41_ptestnzc : GCCBuiltin<"__builtin_ia32_ptestnzc128">,
808 Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
812 //===----------------------------------------------------------------------===//
817 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
818 def int_x86_sse42_crc32_32_8 : GCCBuiltin<"__builtin_ia32_crc32qi">,
819 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i8_ty],
821 def int_x86_sse42_crc32_32_16 : GCCBuiltin<"__builtin_ia32_crc32hi">,
822 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i16_ty],
824 def int_x86_sse42_crc32_32_32 : GCCBuiltin<"__builtin_ia32_crc32si">,
825 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
827 def int_x86_sse42_crc32_64_64 : GCCBuiltin<"__builtin_ia32_crc32di">,
828 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
832 // String/text processing ops.
833 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
834 def int_x86_sse42_pcmpistrm128 : GCCBuiltin<"__builtin_ia32_pcmpistrm128">,
835 Intrinsic<[llvm_v16i8_ty],
836 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
837 [IntrNoMem, ImmArg<2>]>;
838 def int_x86_sse42_pcmpistri128 : GCCBuiltin<"__builtin_ia32_pcmpistri128">,
839 Intrinsic<[llvm_i32_ty],
840 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
841 [IntrNoMem, ImmArg<2>]>;
842 def int_x86_sse42_pcmpistria128 : GCCBuiltin<"__builtin_ia32_pcmpistria128">,
843 Intrinsic<[llvm_i32_ty],
844 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
845 [IntrNoMem, ImmArg<2>]>;
846 def int_x86_sse42_pcmpistric128 : GCCBuiltin<"__builtin_ia32_pcmpistric128">,
847 Intrinsic<[llvm_i32_ty],
848 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
849 [IntrNoMem, ImmArg<2>]>;
850 def int_x86_sse42_pcmpistrio128 : GCCBuiltin<"__builtin_ia32_pcmpistrio128">,
851 Intrinsic<[llvm_i32_ty],
852 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
853 [IntrNoMem, ImmArg<2>]>;
854 def int_x86_sse42_pcmpistris128 : GCCBuiltin<"__builtin_ia32_pcmpistris128">,
855 Intrinsic<[llvm_i32_ty],
856 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
857 [IntrNoMem, ImmArg<2>]>;
858 def int_x86_sse42_pcmpistriz128 : GCCBuiltin<"__builtin_ia32_pcmpistriz128">,
859 Intrinsic<[llvm_i32_ty],
860 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
861 [IntrNoMem, ImmArg<2>]>;
862 def int_x86_sse42_pcmpestrm128 : GCCBuiltin<"__builtin_ia32_pcmpestrm128">,
863 Intrinsic<[llvm_v16i8_ty],
864 [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
866 [IntrNoMem, ImmArg<4>]>;
867 def int_x86_sse42_pcmpestri128 : GCCBuiltin<"__builtin_ia32_pcmpestri128">,
868 Intrinsic<[llvm_i32_ty],
869 [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
871 [IntrNoMem, ImmArg<4>]>;
872 def int_x86_sse42_pcmpestria128 : GCCBuiltin<"__builtin_ia32_pcmpestria128">,
873 Intrinsic<[llvm_i32_ty],
874 [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
876 [IntrNoMem, ImmArg<4>]>;
877 def int_x86_sse42_pcmpestric128 : GCCBuiltin<"__builtin_ia32_pcmpestric128">,
878 Intrinsic<[llvm_i32_ty],
879 [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
881 [IntrNoMem, ImmArg<4>]>;
882 def int_x86_sse42_pcmpestrio128 : GCCBuiltin<"__builtin_ia32_pcmpestrio128">,
883 Intrinsic<[llvm_i32_ty],
884 [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
886 [IntrNoMem, ImmArg<4>]>;
887 def int_x86_sse42_pcmpestris128 : GCCBuiltin<"__builtin_ia32_pcmpestris128">,
888 Intrinsic<[llvm_i32_ty],
889 [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
891 [IntrNoMem, ImmArg<4>]>;
892 def int_x86_sse42_pcmpestriz128 : GCCBuiltin<"__builtin_ia32_pcmpestriz128">,
893 Intrinsic<[llvm_i32_ty],
894 [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
896 [IntrNoMem, ImmArg<4>]>;
899 //===----------------------------------------------------------------------===//
902 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
903 def int_x86_sse4a_extrqi : GCCBuiltin<"__builtin_ia32_extrqi">,
904 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty, llvm_i8_ty],
905 [IntrNoMem, ImmArg<1>, ImmArg<2>]>;
906 def int_x86_sse4a_extrq : GCCBuiltin<"__builtin_ia32_extrq">,
907 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v16i8_ty], [IntrNoMem]>;
909 def int_x86_sse4a_insertqi : GCCBuiltin<"__builtin_ia32_insertqi">,
910 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
911 llvm_i8_ty, llvm_i8_ty],
912 [IntrNoMem, ImmArg<2>, ImmArg<3>]>;
913 def int_x86_sse4a_insertq : GCCBuiltin<"__builtin_ia32_insertq">,
914 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
917 //===----------------------------------------------------------------------===//
921 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
922 def int_x86_avx_addsub_pd_256 : GCCBuiltin<"__builtin_ia32_addsubpd256">,
923 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
924 llvm_v4f64_ty], [IntrNoMem]>;
925 def int_x86_avx_addsub_ps_256 : GCCBuiltin<"__builtin_ia32_addsubps256">,
926 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
927 llvm_v8f32_ty], [IntrNoMem]>;
928 def int_x86_avx_max_pd_256 : GCCBuiltin<"__builtin_ia32_maxpd256">,
929 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
930 llvm_v4f64_ty], [IntrNoMem]>;
931 def int_x86_avx_max_ps_256 : GCCBuiltin<"__builtin_ia32_maxps256">,
932 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
933 llvm_v8f32_ty], [IntrNoMem]>;
934 def int_x86_avx_min_pd_256 : GCCBuiltin<"__builtin_ia32_minpd256">,
935 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
936 llvm_v4f64_ty], [IntrNoMem]>;
937 def int_x86_avx_min_ps_256 : GCCBuiltin<"__builtin_ia32_minps256">,
938 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
939 llvm_v8f32_ty], [IntrNoMem]>;
941 def int_x86_avx_rsqrt_ps_256 : GCCBuiltin<"__builtin_ia32_rsqrtps256">,
942 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
944 def int_x86_avx_rcp_ps_256 : GCCBuiltin<"__builtin_ia32_rcpps256">,
945 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
947 def int_x86_avx_round_pd_256 : GCCBuiltin<"__builtin_ia32_roundpd256">,
948 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
949 llvm_i32_ty], [IntrNoMem, ImmArg<1>]>;
950 def int_x86_avx_round_ps_256 : GCCBuiltin<"__builtin_ia32_roundps256">,
951 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
952 llvm_i32_ty], [IntrNoMem, ImmArg<1>]>;
956 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
957 def int_x86_avx_hadd_pd_256 : GCCBuiltin<"__builtin_ia32_haddpd256">,
958 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
959 llvm_v4f64_ty], [IntrNoMem]>;
960 def int_x86_avx_hsub_ps_256 : GCCBuiltin<"__builtin_ia32_hsubps256">,
961 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
962 llvm_v8f32_ty], [IntrNoMem]>;
963 def int_x86_avx_hsub_pd_256 : GCCBuiltin<"__builtin_ia32_hsubpd256">,
964 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
965 llvm_v4f64_ty], [IntrNoMem]>;
966 def int_x86_avx_hadd_ps_256 : GCCBuiltin<"__builtin_ia32_haddps256">,
967 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
968 llvm_v8f32_ty], [IntrNoMem]>;
971 // Vector permutation
972 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
973 def int_x86_avx_vpermilvar_pd : GCCBuiltin<"__builtin_ia32_vpermilvarpd">,
974 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
975 llvm_v2i64_ty], [IntrNoMem]>;
976 def int_x86_avx_vpermilvar_ps : GCCBuiltin<"__builtin_ia32_vpermilvarps">,
977 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
978 llvm_v4i32_ty], [IntrNoMem]>;
980 def int_x86_avx_vpermilvar_pd_256 :
981 GCCBuiltin<"__builtin_ia32_vpermilvarpd256">,
982 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty], [IntrNoMem]>;
983 def int_x86_avx_vpermilvar_ps_256 :
984 GCCBuiltin<"__builtin_ia32_vpermilvarps256">,
985 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty], [IntrNoMem]>;
987 def int_x86_avx512_vpermi2var_d_128 :
988 GCCBuiltin<"__builtin_ia32_vpermi2vard128">,
989 Intrinsic<[llvm_v4i32_ty],
990 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
992 def int_x86_avx512_vpermi2var_d_256 :
993 GCCBuiltin<"__builtin_ia32_vpermi2vard256">,
994 Intrinsic<[llvm_v8i32_ty],
995 [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty], [IntrNoMem]>;
997 def int_x86_avx512_vpermi2var_d_512 :
998 GCCBuiltin<"__builtin_ia32_vpermi2vard512">,
999 Intrinsic<[llvm_v16i32_ty],
1000 [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty],
1003 def int_x86_avx512_vpermi2var_hi_128 :
1004 GCCBuiltin<"__builtin_ia32_vpermi2varhi128">,
1005 Intrinsic<[llvm_v8i16_ty],
1006 [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
1008 def int_x86_avx512_vpermi2var_hi_256 :
1009 GCCBuiltin<"__builtin_ia32_vpermi2varhi256">,
1010 Intrinsic<[llvm_v16i16_ty],
1011 [llvm_v16i16_ty, llvm_v16i16_ty, llvm_v16i16_ty],
1014 def int_x86_avx512_vpermi2var_hi_512 :
1015 GCCBuiltin<"__builtin_ia32_vpermi2varhi512">,
1016 Intrinsic<[llvm_v32i16_ty],
1017 [llvm_v32i16_ty, llvm_v32i16_ty, llvm_v32i16_ty],
1020 def int_x86_avx512_vpermi2var_pd_128 :
1021 GCCBuiltin<"__builtin_ia32_vpermi2varpd128">,
1022 Intrinsic<[llvm_v2f64_ty],
1023 [llvm_v2f64_ty, llvm_v2i64_ty, llvm_v2f64_ty], [IntrNoMem]>;
1025 def int_x86_avx512_vpermi2var_pd_256 :
1026 GCCBuiltin<"__builtin_ia32_vpermi2varpd256">,
1027 Intrinsic<[llvm_v4f64_ty],
1028 [llvm_v4f64_ty, llvm_v4i64_ty, llvm_v4f64_ty], [IntrNoMem]>;
1030 def int_x86_avx512_vpermi2var_pd_512 :
1031 GCCBuiltin<"__builtin_ia32_vpermi2varpd512">,
1032 Intrinsic<[llvm_v8f64_ty],
1033 [llvm_v8f64_ty, llvm_v8i64_ty, llvm_v8f64_ty], [IntrNoMem]>;
1035 def int_x86_avx512_vpermi2var_ps_128 :
1036 GCCBuiltin<"__builtin_ia32_vpermi2varps128">,
1037 Intrinsic<[llvm_v4f32_ty],
1038 [llvm_v4f32_ty, llvm_v4i32_ty, llvm_v4f32_ty], [IntrNoMem]>;
1040 def int_x86_avx512_vpermi2var_ps_256 :
1041 GCCBuiltin<"__builtin_ia32_vpermi2varps256">,
1042 Intrinsic<[llvm_v8f32_ty],
1043 [llvm_v8f32_ty, llvm_v8i32_ty, llvm_v8f32_ty], [IntrNoMem]>;
1045 def int_x86_avx512_vpermi2var_ps_512 :
1046 GCCBuiltin<"__builtin_ia32_vpermi2varps512">,
1047 Intrinsic<[llvm_v16f32_ty],
1048 [llvm_v16f32_ty, llvm_v16i32_ty, llvm_v16f32_ty],
1051 def int_x86_avx512_vpermi2var_q_128 :
1052 GCCBuiltin<"__builtin_ia32_vpermi2varq128">,
1053 Intrinsic<[llvm_v2i64_ty],
1054 [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
1056 def int_x86_avx512_vpermi2var_q_256 :
1057 GCCBuiltin<"__builtin_ia32_vpermi2varq256">,
1058 Intrinsic<[llvm_v4i64_ty],
1059 [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty], [IntrNoMem]>;
1061 def int_x86_avx512_vpermi2var_q_512 :
1062 GCCBuiltin<"__builtin_ia32_vpermi2varq512">,
1063 Intrinsic<[llvm_v8i64_ty],
1064 [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty], [IntrNoMem]>;
1066 def int_x86_avx512_vpermi2var_qi_128 :
1067 GCCBuiltin<"__builtin_ia32_vpermi2varqi128">,
1068 Intrinsic<[llvm_v16i8_ty],
1069 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1071 def int_x86_avx512_vpermi2var_qi_256 :
1072 GCCBuiltin<"__builtin_ia32_vpermi2varqi256">,
1073 Intrinsic<[llvm_v32i8_ty],
1074 [llvm_v32i8_ty, llvm_v32i8_ty, llvm_v32i8_ty], [IntrNoMem]>;
1076 def int_x86_avx512_vpermi2var_qi_512 :
1077 GCCBuiltin<"__builtin_ia32_vpermi2varqi512">,
1078 Intrinsic<[llvm_v64i8_ty],
1079 [llvm_v64i8_ty, llvm_v64i8_ty, llvm_v64i8_ty], [IntrNoMem]>;
1081 def int_x86_avx512_vpermilvar_pd_512 :
1082 GCCBuiltin<"__builtin_ia32_vpermilvarpd512">,
1083 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8i64_ty],
1086 def int_x86_avx512_vpermilvar_ps_512 :
1087 GCCBuiltin<"__builtin_ia32_vpermilvarps512">,
1088 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16i32_ty],
1091 def int_x86_avx512_pshuf_b_512 :
1092 GCCBuiltin<"__builtin_ia32_pshufb512">,
1093 Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
1098 // GFNI Instructions
1099 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1100 def int_x86_vgf2p8affineinvqb_128 :
1101 GCCBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v16qi">,
1102 Intrinsic<[llvm_v16i8_ty],
1103 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
1104 [IntrNoMem, ImmArg<2>]>;
1105 def int_x86_vgf2p8affineinvqb_256 :
1106 GCCBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v32qi">,
1107 Intrinsic<[llvm_v32i8_ty],
1108 [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i8_ty],
1109 [IntrNoMem, ImmArg<2>]>;
1110 def int_x86_vgf2p8affineinvqb_512 :
1111 GCCBuiltin<"__builtin_ia32_vgf2p8affineinvqb_v64qi">,
1112 Intrinsic<[llvm_v64i8_ty],
1113 [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i8_ty],
1114 [IntrNoMem, ImmArg<2>]>;
1116 def int_x86_vgf2p8affineqb_128 :
1117 GCCBuiltin<"__builtin_ia32_vgf2p8affineqb_v16qi">,
1118 Intrinsic<[llvm_v16i8_ty],
1119 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
1120 [IntrNoMem, ImmArg<2>]>;
1121 def int_x86_vgf2p8affineqb_256 :
1122 GCCBuiltin<"__builtin_ia32_vgf2p8affineqb_v32qi">,
1123 Intrinsic<[llvm_v32i8_ty],
1124 [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i8_ty],
1125 [IntrNoMem, ImmArg<2>]>;
1126 def int_x86_vgf2p8affineqb_512 :
1127 GCCBuiltin<"__builtin_ia32_vgf2p8affineqb_v64qi">,
1128 Intrinsic<[llvm_v64i8_ty],
1129 [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i8_ty],
1130 [IntrNoMem, ImmArg<2>]>;
1132 def int_x86_vgf2p8mulb_128 :
1133 GCCBuiltin<"__builtin_ia32_vgf2p8mulb_v16qi">,
1134 Intrinsic<[llvm_v16i8_ty],
1135 [llvm_v16i8_ty, llvm_v16i8_ty],
1137 def int_x86_vgf2p8mulb_256 :
1138 GCCBuiltin<"__builtin_ia32_vgf2p8mulb_v32qi">,
1139 Intrinsic<[llvm_v32i8_ty],
1140 [llvm_v32i8_ty, llvm_v32i8_ty],
1142 def int_x86_vgf2p8mulb_512 :
1143 GCCBuiltin<"__builtin_ia32_vgf2p8mulb_v64qi">,
1144 Intrinsic<[llvm_v64i8_ty],
1145 [llvm_v64i8_ty, llvm_v64i8_ty],
1150 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1151 def int_x86_avx_blendv_pd_256 : GCCBuiltin<"__builtin_ia32_blendvpd256">,
1152 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
1153 llvm_v4f64_ty, llvm_v4f64_ty], [IntrNoMem]>;
1154 def int_x86_avx_blendv_ps_256 : GCCBuiltin<"__builtin_ia32_blendvps256">,
1155 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
1156 llvm_v8f32_ty, llvm_v8f32_ty], [IntrNoMem]>;
1159 // Vector dot product
1160 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1161 def int_x86_avx_dp_ps_256 : GCCBuiltin<"__builtin_ia32_dpps256">,
1162 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
1163 llvm_v8f32_ty, llvm_i8_ty],
1164 [IntrNoMem, Commutative, ImmArg<2>]>;
1168 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1169 def int_x86_avx_cmp_pd_256 :
1170 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
1171 llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem, ImmArg<2>]>;
1172 def int_x86_avx_cmp_ps_256 :
1173 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
1174 llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem, ImmArg<2>]>;
1178 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1179 def int_x86_avx_cvt_pd2_ps_256 : GCCBuiltin<"__builtin_ia32_cvtpd2ps256">,
1180 Intrinsic<[llvm_v4f32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1181 def int_x86_avx_cvt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvtps2dq256">,
1182 Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1183 def int_x86_avx_cvtt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvttpd2dq256">,
1184 Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1185 def int_x86_avx_cvt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvtpd2dq256">,
1186 Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1187 def int_x86_avx_cvtt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvttps2dq256">,
1188 Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1192 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1193 def int_x86_avx_vtestz_pd : GCCBuiltin<"__builtin_ia32_vtestzpd">,
1194 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
1195 llvm_v2f64_ty], [IntrNoMem]>;
1196 def int_x86_avx_vtestc_pd : GCCBuiltin<"__builtin_ia32_vtestcpd">,
1197 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
1198 llvm_v2f64_ty], [IntrNoMem]>;
1199 def int_x86_avx_vtestnzc_pd : GCCBuiltin<"__builtin_ia32_vtestnzcpd">,
1200 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
1201 llvm_v2f64_ty], [IntrNoMem]>;
1202 def int_x86_avx_vtestz_ps : GCCBuiltin<"__builtin_ia32_vtestzps">,
1203 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
1204 llvm_v4f32_ty], [IntrNoMem]>;
1205 def int_x86_avx_vtestc_ps : GCCBuiltin<"__builtin_ia32_vtestcps">,
1206 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
1207 llvm_v4f32_ty], [IntrNoMem]>;
1208 def int_x86_avx_vtestnzc_ps : GCCBuiltin<"__builtin_ia32_vtestnzcps">,
1209 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
1210 llvm_v4f32_ty], [IntrNoMem]>;
1211 def int_x86_avx_vtestz_pd_256 : GCCBuiltin<"__builtin_ia32_vtestzpd256">,
1212 Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
1213 llvm_v4f64_ty], [IntrNoMem]>;
1214 def int_x86_avx_vtestc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestcpd256">,
1215 Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
1216 llvm_v4f64_ty], [IntrNoMem]>;
1217 def int_x86_avx_vtestnzc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestnzcpd256">,
1218 Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
1219 llvm_v4f64_ty], [IntrNoMem]>;
1220 def int_x86_avx_vtestz_ps_256 : GCCBuiltin<"__builtin_ia32_vtestzps256">,
1221 Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
1222 llvm_v8f32_ty], [IntrNoMem]>;
1223 def int_x86_avx_vtestc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestcps256">,
1224 Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
1225 llvm_v8f32_ty], [IntrNoMem]>;
1226 def int_x86_avx_vtestnzc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestnzcps256">,
1227 Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
1228 llvm_v8f32_ty], [IntrNoMem]>;
1229 def int_x86_avx_ptestz_256 : GCCBuiltin<"__builtin_ia32_ptestz256">,
1230 Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
1231 llvm_v4i64_ty], [IntrNoMem]>;
1232 def int_x86_avx_ptestc_256 : GCCBuiltin<"__builtin_ia32_ptestc256">,
1233 Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
1234 llvm_v4i64_ty], [IntrNoMem]>;
1235 def int_x86_avx_ptestnzc_256 : GCCBuiltin<"__builtin_ia32_ptestnzc256">,
1236 Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
1237 llvm_v4i64_ty], [IntrNoMem]>;
1239 def int_x86_avx512_fpclass_pd_128 :
1240 Intrinsic<[llvm_v2i1_ty], [llvm_v2f64_ty, llvm_i32_ty],
1241 [IntrNoMem, ImmArg<1>]>;
1242 def int_x86_avx512_fpclass_pd_256 :
1243 Intrinsic<[llvm_v4i1_ty], [llvm_v4f64_ty, llvm_i32_ty],
1244 [IntrNoMem, ImmArg<1>]>;
1245 def int_x86_avx512_fpclass_pd_512 :
1246 Intrinsic<[llvm_v8i1_ty], [llvm_v8f64_ty, llvm_i32_ty],
1247 [IntrNoMem, ImmArg<1>]>;
1248 def int_x86_avx512_fpclass_ps_128 :
1249 Intrinsic<[llvm_v4i1_ty], [llvm_v4f32_ty, llvm_i32_ty],
1250 [IntrNoMem, ImmArg<1>]>;
1251 def int_x86_avx512_fpclass_ps_256 :
1252 Intrinsic<[llvm_v8i1_ty], [llvm_v8f32_ty, llvm_i32_ty],
1253 [IntrNoMem, ImmArg<1>]>;
1254 def int_x86_avx512_fpclass_ps_512 :
1255 Intrinsic<[llvm_v16i1_ty], [llvm_v16f32_ty, llvm_i32_ty],
1256 [IntrNoMem, ImmArg<1>]>;
1257 def int_x86_avx512_mask_fpclass_sd :
1258 GCCBuiltin<"__builtin_ia32_fpclasssd_mask">,
1259 Intrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_i32_ty, llvm_i8_ty],
1260 [IntrNoMem, ImmArg<1>]>;
1261 def int_x86_avx512_mask_fpclass_ss :
1262 GCCBuiltin<"__builtin_ia32_fpclassss_mask">,
1263 Intrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_i32_ty, llvm_i8_ty],
1264 [IntrNoMem, ImmArg<1>]>;
1267 // Vector extract sign mask
1268 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1269 def int_x86_avx_movmsk_pd_256 : GCCBuiltin<"__builtin_ia32_movmskpd256">,
1270 Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1271 def int_x86_avx_movmsk_ps_256 : GCCBuiltin<"__builtin_ia32_movmskps256">,
1272 Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1276 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1277 def int_x86_avx_vzeroall : GCCBuiltin<"__builtin_ia32_vzeroall">,
1278 Intrinsic<[], [], []>;
1279 def int_x86_avx_vzeroupper : GCCBuiltin<"__builtin_ia32_vzeroupper">,
1280 Intrinsic<[], [], []>;
1284 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1285 def int_x86_avx_ldu_dq_256 : GCCBuiltin<"__builtin_ia32_lddqu256">,
1286 Intrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
1289 // Conditional load ops
1290 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1291 def int_x86_avx_maskload_pd : GCCBuiltin<"__builtin_ia32_maskloadpd">,
1292 Intrinsic<[llvm_v2f64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
1293 [IntrReadMem, IntrArgMemOnly]>;
1294 def int_x86_avx_maskload_ps : GCCBuiltin<"__builtin_ia32_maskloadps">,
1295 Intrinsic<[llvm_v4f32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
1296 [IntrReadMem, IntrArgMemOnly]>;
1297 def int_x86_avx_maskload_pd_256 : GCCBuiltin<"__builtin_ia32_maskloadpd256">,
1298 Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
1299 [IntrReadMem, IntrArgMemOnly]>;
1300 def int_x86_avx_maskload_ps_256 : GCCBuiltin<"__builtin_ia32_maskloadps256">,
1301 Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
1302 [IntrReadMem, IntrArgMemOnly]>;
1305 // Conditional store ops
1306 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1307 def int_x86_avx_maskstore_pd : GCCBuiltin<"__builtin_ia32_maskstorepd">,
1308 Intrinsic<[], [llvm_ptr_ty,
1309 llvm_v2i64_ty, llvm_v2f64_ty], [IntrArgMemOnly]>;
1310 def int_x86_avx_maskstore_ps : GCCBuiltin<"__builtin_ia32_maskstoreps">,
1311 Intrinsic<[], [llvm_ptr_ty,
1312 llvm_v4i32_ty, llvm_v4f32_ty], [IntrArgMemOnly]>;
1313 def int_x86_avx_maskstore_pd_256 :
1314 GCCBuiltin<"__builtin_ia32_maskstorepd256">,
1315 Intrinsic<[], [llvm_ptr_ty,
1316 llvm_v4i64_ty, llvm_v4f64_ty], [IntrArgMemOnly]>;
1317 def int_x86_avx_maskstore_ps_256 :
1318 GCCBuiltin<"__builtin_ia32_maskstoreps256">,
1319 Intrinsic<[], [llvm_ptr_ty,
1320 llvm_v8i32_ty, llvm_v8f32_ty], [IntrArgMemOnly]>;
1323 // BITALG bits shuffle
1324 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1325 def int_x86_avx512_vpshufbitqmb_128 :
1326 Intrinsic<[llvm_v16i1_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1327 def int_x86_avx512_vpshufbitqmb_256 :
1328 Intrinsic<[llvm_v32i1_ty], [llvm_v32i8_ty, llvm_v32i8_ty], [IntrNoMem]>;
1329 def int_x86_avx512_vpshufbitqmb_512 :
1330 Intrinsic<[llvm_v64i1_ty], [llvm_v64i8_ty, llvm_v64i8_ty], [IntrNoMem]>;
1333 //===----------------------------------------------------------------------===//
1336 // Integer arithmetic ops.
1337 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1338 def int_x86_avx2_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw256">,
1339 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1340 llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1341 def int_x86_avx2_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw256">,
1342 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1343 llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1344 def int_x86_avx2_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd256">,
1345 Intrinsic<[llvm_v8i32_ty], [llvm_v16i16_ty,
1346 llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1347 def int_x86_avx2_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb256">,
1348 Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
1349 llvm_v32i8_ty], [IntrNoMem, Commutative]>;
1350 def int_x86_avx2_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw256">,
1351 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1352 llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1353 def int_x86_avx2_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw256">,
1354 Intrinsic<[llvm_v4i64_ty], [llvm_v32i8_ty,
1355 llvm_v32i8_ty], [IntrNoMem, Commutative]>;
1358 // Integer shift ops.
1359 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1360 def int_x86_avx2_psll_w : GCCBuiltin<"__builtin_ia32_psllw256">,
1361 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1362 llvm_v8i16_ty], [IntrNoMem]>;
1363 def int_x86_avx2_psll_d : GCCBuiltin<"__builtin_ia32_pslld256">,
1364 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1365 llvm_v4i32_ty], [IntrNoMem]>;
1366 def int_x86_avx2_psll_q : GCCBuiltin<"__builtin_ia32_psllq256">,
1367 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1368 llvm_v2i64_ty], [IntrNoMem]>;
1369 def int_x86_avx2_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw256">,
1370 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1371 llvm_v8i16_ty], [IntrNoMem]>;
1372 def int_x86_avx2_psrl_d : GCCBuiltin<"__builtin_ia32_psrld256">,
1373 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1374 llvm_v4i32_ty], [IntrNoMem]>;
1375 def int_x86_avx2_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq256">,
1376 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1377 llvm_v2i64_ty], [IntrNoMem]>;
1378 def int_x86_avx2_psra_w : GCCBuiltin<"__builtin_ia32_psraw256">,
1379 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1380 llvm_v8i16_ty], [IntrNoMem]>;
1381 def int_x86_avx2_psra_d : GCCBuiltin<"__builtin_ia32_psrad256">,
1382 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1383 llvm_v4i32_ty], [IntrNoMem]>;
1385 // Oddly these don't require an immediate due to a gcc compatibility issue.
1386 def int_x86_avx2_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi256">,
1387 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1388 llvm_i32_ty], [IntrNoMem]>;
1389 def int_x86_avx2_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi256">,
1390 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1391 llvm_i32_ty], [IntrNoMem]>;
1392 def int_x86_avx2_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi256">,
1393 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1394 llvm_i32_ty], [IntrNoMem]>;
1395 def int_x86_avx2_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi256">,
1396 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1397 llvm_i32_ty], [IntrNoMem]>;
1398 def int_x86_avx2_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi256">,
1399 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1400 llvm_i32_ty], [IntrNoMem]>;
1401 def int_x86_avx2_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi256">,
1402 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1403 llvm_i32_ty], [IntrNoMem]>;
1404 def int_x86_avx2_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi256">,
1405 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1406 llvm_i32_ty], [IntrNoMem]>;
1407 def int_x86_avx2_psrai_d : GCCBuiltin<"__builtin_ia32_psradi256">,
1408 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1409 llvm_i32_ty], [IntrNoMem]>;
1411 def int_x86_avx512_psra_q_128 : GCCBuiltin<"__builtin_ia32_psraq128">,
1412 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
1413 llvm_v2i64_ty], [IntrNoMem]>;
1414 def int_x86_avx512_psra_q_256 : GCCBuiltin<"__builtin_ia32_psraq256">,
1415 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1416 llvm_v2i64_ty], [IntrNoMem]>;
1418 // Oddly these don't require an immediate due to a gcc compatibility issue.
1419 def int_x86_avx512_psrai_q_128 : GCCBuiltin<"__builtin_ia32_psraqi128">,
1420 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
1421 llvm_i32_ty], [IntrNoMem]>;
1422 def int_x86_avx512_psrai_q_256 : GCCBuiltin<"__builtin_ia32_psraqi256">,
1423 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
1424 llvm_i32_ty], [IntrNoMem]>;
1426 def int_x86_avx512_psll_w_512 : GCCBuiltin<"__builtin_ia32_psllw512">,
1427 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1428 llvm_v8i16_ty], [IntrNoMem]>;
1429 def int_x86_avx512_psll_d_512 : GCCBuiltin<"__builtin_ia32_pslld512">,
1430 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1431 llvm_v4i32_ty], [IntrNoMem]>;
1432 def int_x86_avx512_psll_q_512 : GCCBuiltin<"__builtin_ia32_psllq512">,
1433 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1434 llvm_v2i64_ty], [IntrNoMem]>;
1435 def int_x86_avx512_psrl_w_512 : GCCBuiltin<"__builtin_ia32_psrlw512">,
1436 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1437 llvm_v8i16_ty], [IntrNoMem]>;
1438 def int_x86_avx512_psrl_d_512 : GCCBuiltin<"__builtin_ia32_psrld512">,
1439 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1440 llvm_v4i32_ty], [IntrNoMem]>;
1441 def int_x86_avx512_psrl_q_512 : GCCBuiltin<"__builtin_ia32_psrlq512">,
1442 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1443 llvm_v2i64_ty], [IntrNoMem]>;
1444 def int_x86_avx512_psra_w_512 : GCCBuiltin<"__builtin_ia32_psraw512">,
1445 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1446 llvm_v8i16_ty], [IntrNoMem]>;
1447 def int_x86_avx512_psra_d_512 : GCCBuiltin<"__builtin_ia32_psrad512">,
1448 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1449 llvm_v4i32_ty], [IntrNoMem]>;
1450 def int_x86_avx512_psra_q_512 : GCCBuiltin<"__builtin_ia32_psraq512">,
1451 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1452 llvm_v2i64_ty], [IntrNoMem]>;
1454 // Oddly these don't require an immediate due to a gcc compatibility issue.
1455 def int_x86_avx512_pslli_w_512 : GCCBuiltin<"__builtin_ia32_psllwi512">,
1456 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1457 llvm_i32_ty], [IntrNoMem]>;
1458 def int_x86_avx512_pslli_d_512 : GCCBuiltin<"__builtin_ia32_pslldi512">,
1459 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1460 llvm_i32_ty], [IntrNoMem]>;
1461 def int_x86_avx512_pslli_q_512 : GCCBuiltin<"__builtin_ia32_psllqi512">,
1462 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1463 llvm_i32_ty], [IntrNoMem]>;
1464 def int_x86_avx512_psrli_w_512 : GCCBuiltin<"__builtin_ia32_psrlwi512">,
1465 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1466 llvm_i32_ty], [IntrNoMem]>;
1467 def int_x86_avx512_psrli_d_512 : GCCBuiltin<"__builtin_ia32_psrldi512">,
1468 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1469 llvm_i32_ty], [IntrNoMem]>;
1470 def int_x86_avx512_psrli_q_512 : GCCBuiltin<"__builtin_ia32_psrlqi512">,
1471 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1472 llvm_i32_ty], [IntrNoMem]>;
1473 def int_x86_avx512_psrai_w_512 : GCCBuiltin<"__builtin_ia32_psrawi512">,
1474 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1475 llvm_i32_ty], [IntrNoMem]>;
1476 def int_x86_avx512_psrai_d_512 : GCCBuiltin<"__builtin_ia32_psradi512">,
1477 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
1478 llvm_i32_ty], [IntrNoMem]>;
1479 def int_x86_avx512_psrai_q_512 : GCCBuiltin<"__builtin_ia32_psraqi512">,
1480 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
1481 llvm_i32_ty], [IntrNoMem]>;
1483 def int_x86_avx512_pmultishift_qb_128:
1484 GCCBuiltin<"__builtin_ia32_vpmultishiftqb128">,
1485 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
1486 def int_x86_avx512_pmultishift_qb_256:
1487 GCCBuiltin<"__builtin_ia32_vpmultishiftqb256">,
1488 Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty], [IntrNoMem]>;
1489 def int_x86_avx512_pmultishift_qb_512:
1490 GCCBuiltin<"__builtin_ia32_vpmultishiftqb512">,
1491 Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty], [IntrNoMem]>;
1495 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1496 def int_x86_avx2_packsswb : GCCBuiltin<"__builtin_ia32_packsswb256">,
1497 Intrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
1498 llvm_v16i16_ty], [IntrNoMem]>;
1499 def int_x86_avx2_packssdw : GCCBuiltin<"__builtin_ia32_packssdw256">,
1500 Intrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
1501 llvm_v8i32_ty], [IntrNoMem]>;
1502 def int_x86_avx2_packuswb : GCCBuiltin<"__builtin_ia32_packuswb256">,
1503 Intrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
1504 llvm_v16i16_ty], [IntrNoMem]>;
1505 def int_x86_avx2_packusdw : GCCBuiltin<"__builtin_ia32_packusdw256">,
1506 Intrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
1507 llvm_v8i32_ty], [IntrNoMem]>;
1510 // Horizontal arithmetic ops
1511 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1512 def int_x86_avx2_phadd_w : GCCBuiltin<"__builtin_ia32_phaddw256">,
1513 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1514 llvm_v16i16_ty], [IntrNoMem]>;
1515 def int_x86_avx2_phadd_d : GCCBuiltin<"__builtin_ia32_phaddd256">,
1516 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1517 llvm_v8i32_ty], [IntrNoMem]>;
1518 def int_x86_avx2_phadd_sw : GCCBuiltin<"__builtin_ia32_phaddsw256">,
1519 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1520 llvm_v16i16_ty], [IntrNoMem]>;
1521 def int_x86_avx2_phsub_w : GCCBuiltin<"__builtin_ia32_phsubw256">,
1522 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1523 llvm_v16i16_ty], [IntrNoMem]>;
1524 def int_x86_avx2_phsub_d : GCCBuiltin<"__builtin_ia32_phsubd256">,
1525 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1526 llvm_v8i32_ty], [IntrNoMem]>;
1527 def int_x86_avx2_phsub_sw : GCCBuiltin<"__builtin_ia32_phsubsw256">,
1528 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1529 llvm_v16i16_ty], [IntrNoMem]>;
1530 def int_x86_avx2_pmadd_ub_sw : GCCBuiltin<"__builtin_ia32_pmaddubsw256">,
1531 Intrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty,
1532 llvm_v32i8_ty], [IntrNoMem]>;
1536 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1537 def int_x86_avx2_psign_b : GCCBuiltin<"__builtin_ia32_psignb256">,
1538 Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
1539 llvm_v32i8_ty], [IntrNoMem]>;
1540 def int_x86_avx2_psign_w : GCCBuiltin<"__builtin_ia32_psignw256">,
1541 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1542 llvm_v16i16_ty], [IntrNoMem]>;
1543 def int_x86_avx2_psign_d : GCCBuiltin<"__builtin_ia32_psignd256">,
1544 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
1545 llvm_v8i32_ty], [IntrNoMem]>;
1548 // Packed multiply high with round and scale
1549 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1550 def int_x86_avx2_pmul_hr_sw : GCCBuiltin<"__builtin_ia32_pmulhrsw256">,
1551 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
1552 llvm_v16i16_ty], [IntrNoMem, Commutative]>;
1553 def int_x86_avx512_pmul_hr_sw_512 : GCCBuiltin<"__builtin_ia32_pmulhrsw512">,
1554 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
1555 llvm_v32i16_ty], [IntrNoMem, Commutative]>;
1559 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1560 def int_x86_avx2_pblendvb : GCCBuiltin<"__builtin_ia32_pblendvb256">,
1561 Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
1562 llvm_v32i8_ty], [IntrNoMem]>;
1566 // Vector permutation
1567 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1568 def int_x86_avx2_permd : GCCBuiltin<"__builtin_ia32_permvarsi256">,
1569 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1571 def int_x86_avx2_permps : GCCBuiltin<"__builtin_ia32_permvarsf256">,
1572 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty],
1576 // Conditional load ops
1577 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1578 def int_x86_avx2_maskload_d : GCCBuiltin<"__builtin_ia32_maskloadd">,
1579 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
1580 [IntrReadMem, IntrArgMemOnly]>;
1581 def int_x86_avx2_maskload_q : GCCBuiltin<"__builtin_ia32_maskloadq">,
1582 Intrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
1583 [IntrReadMem, IntrArgMemOnly]>;
1584 def int_x86_avx2_maskload_d_256 : GCCBuiltin<"__builtin_ia32_maskloadd256">,
1585 Intrinsic<[llvm_v8i32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
1586 [IntrReadMem, IntrArgMemOnly]>;
1587 def int_x86_avx2_maskload_q_256 : GCCBuiltin<"__builtin_ia32_maskloadq256">,
1588 Intrinsic<[llvm_v4i64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
1589 [IntrReadMem, IntrArgMemOnly]>;
1592 // Conditional store ops
1593 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1594 def int_x86_avx2_maskstore_d : GCCBuiltin<"__builtin_ia32_maskstored">,
1595 Intrinsic<[], [llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1597 def int_x86_avx2_maskstore_q : GCCBuiltin<"__builtin_ia32_maskstoreq">,
1598 Intrinsic<[], [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty],
1600 def int_x86_avx2_maskstore_d_256 :
1601 GCCBuiltin<"__builtin_ia32_maskstored256">,
1602 Intrinsic<[], [llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty],
1604 def int_x86_avx2_maskstore_q_256 :
1605 GCCBuiltin<"__builtin_ia32_maskstoreq256">,
1606 Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty],
1610 // Variable bit shift ops
1611 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1612 def int_x86_avx2_psllv_d : GCCBuiltin<"__builtin_ia32_psllv4si">,
1613 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
1615 def int_x86_avx2_psllv_d_256 : GCCBuiltin<"__builtin_ia32_psllv8si">,
1616 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1618 def int_x86_avx2_psllv_q : GCCBuiltin<"__builtin_ia32_psllv2di">,
1619 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
1621 def int_x86_avx2_psllv_q_256 : GCCBuiltin<"__builtin_ia32_psllv4di">,
1622 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1625 def int_x86_avx512_psllv_d_512 : GCCBuiltin<"__builtin_ia32_psllv16si">,
1626 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
1628 def int_x86_avx512_psllv_q_512 : GCCBuiltin<"__builtin_ia32_psllv8di">,
1629 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
1632 def int_x86_avx2_psrlv_d : GCCBuiltin<"__builtin_ia32_psrlv4si">,
1633 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
1635 def int_x86_avx2_psrlv_d_256 : GCCBuiltin<"__builtin_ia32_psrlv8si">,
1636 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1638 def int_x86_avx2_psrlv_q : GCCBuiltin<"__builtin_ia32_psrlv2di">,
1639 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
1641 def int_x86_avx2_psrlv_q_256 : GCCBuiltin<"__builtin_ia32_psrlv4di">,
1642 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1645 def int_x86_avx512_psrlv_d_512 : GCCBuiltin<"__builtin_ia32_psrlv16si">,
1646 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
1648 def int_x86_avx512_psrlv_q_512 : GCCBuiltin<"__builtin_ia32_psrlv8di">,
1649 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
1652 def int_x86_avx2_psrav_d : GCCBuiltin<"__builtin_ia32_psrav4si">,
1653 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
1655 def int_x86_avx2_psrav_d_256 : GCCBuiltin<"__builtin_ia32_psrav8si">,
1656 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
1659 def int_x86_avx512_psrav_d_512 : GCCBuiltin<"__builtin_ia32_psrav16si">,
1660 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
1662 def int_x86_avx512_psrav_q_128 : GCCBuiltin<"__builtin_ia32_psravq128">,
1663 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
1665 def int_x86_avx512_psrav_q_256 : GCCBuiltin<"__builtin_ia32_psravq256">,
1666 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
1668 def int_x86_avx512_psrav_q_512 : GCCBuiltin<"__builtin_ia32_psrav8di">,
1669 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
1672 def int_x86_avx512_psllv_w_128 : GCCBuiltin<"__builtin_ia32_psllv8hi">,
1673 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
1675 def int_x86_avx512_psllv_w_256 : GCCBuiltin<"__builtin_ia32_psllv16hi">,
1676 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
1678 def int_x86_avx512_psllv_w_512 : GCCBuiltin<"__builtin_ia32_psllv32hi">,
1679 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
1682 def int_x86_avx512_psrlv_w_128 : GCCBuiltin<"__builtin_ia32_psrlv8hi">,
1683 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
1685 def int_x86_avx512_psrlv_w_256 : GCCBuiltin<"__builtin_ia32_psrlv16hi">,
1686 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
1688 def int_x86_avx512_psrlv_w_512 : GCCBuiltin<"__builtin_ia32_psrlv32hi">,
1689 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
1692 def int_x86_avx512_psrav_w_128 : GCCBuiltin<"__builtin_ia32_psrav8hi">,
1693 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
1695 def int_x86_avx512_psrav_w_256 : GCCBuiltin<"__builtin_ia32_psrav16hi">,
1696 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
1698 def int_x86_avx512_psrav_w_512 : GCCBuiltin<"__builtin_ia32_psrav32hi">,
1699 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
1704 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1705 // NOTE: These can't be ArgMemOnly because you can put the address completely
1706 // in the index register.
1707 def int_x86_avx2_gather_d_pd : GCCBuiltin<"__builtin_ia32_gatherd_pd">,
1708 Intrinsic<[llvm_v2f64_ty],
1709 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i8_ty],
1710 [IntrReadMem, ImmArg<4>]>;
1711 def int_x86_avx2_gather_d_pd_256 : GCCBuiltin<"__builtin_ia32_gatherd_pd256">,
1712 Intrinsic<[llvm_v4f64_ty],
1713 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i8_ty],
1714 [IntrReadMem, ImmArg<4>]>;
1715 def int_x86_avx2_gather_q_pd : GCCBuiltin<"__builtin_ia32_gatherq_pd">,
1716 Intrinsic<[llvm_v2f64_ty],
1717 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty],
1718 [IntrReadMem, ImmArg<4>]>;
1719 def int_x86_avx2_gather_q_pd_256 : GCCBuiltin<"__builtin_ia32_gatherq_pd256">,
1720 Intrinsic<[llvm_v4f64_ty],
1721 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty],
1722 [IntrReadMem, ImmArg<4>]>;
1723 def int_x86_avx2_gather_d_ps : GCCBuiltin<"__builtin_ia32_gatherd_ps">,
1724 Intrinsic<[llvm_v4f32_ty],
1725 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty],
1726 [IntrReadMem, ImmArg<4>]>;
1727 def int_x86_avx2_gather_d_ps_256 : GCCBuiltin<"__builtin_ia32_gatherd_ps256">,
1728 Intrinsic<[llvm_v8f32_ty],
1729 [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty],
1730 [IntrReadMem, ImmArg<4>]>;
1731 def int_x86_avx2_gather_q_ps : GCCBuiltin<"__builtin_ia32_gatherq_ps">,
1732 Intrinsic<[llvm_v4f32_ty],
1733 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
1734 [IntrReadMem, ImmArg<4>]>;
1735 def int_x86_avx2_gather_q_ps_256 : GCCBuiltin<"__builtin_ia32_gatherq_ps256">,
1736 Intrinsic<[llvm_v4f32_ty],
1737 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i8_ty],
1738 [IntrReadMem, ImmArg<4>]>;
1740 def int_x86_avx2_gather_d_q : GCCBuiltin<"__builtin_ia32_gatherd_q">,
1741 Intrinsic<[llvm_v2i64_ty],
1742 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i8_ty],
1743 [IntrReadMem, ImmArg<4>]>;
1744 def int_x86_avx2_gather_d_q_256 : GCCBuiltin<"__builtin_ia32_gatherd_q256">,
1745 Intrinsic<[llvm_v4i64_ty],
1746 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i8_ty],
1747 [IntrReadMem, ImmArg<4>]>;
1748 def int_x86_avx2_gather_q_q : GCCBuiltin<"__builtin_ia32_gatherq_q">,
1749 Intrinsic<[llvm_v2i64_ty],
1750 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
1751 [IntrReadMem, ImmArg<4>]>;
1752 def int_x86_avx2_gather_q_q_256 : GCCBuiltin<"__builtin_ia32_gatherq_q256">,
1753 Intrinsic<[llvm_v4i64_ty],
1754 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
1755 [IntrReadMem, ImmArg<4>]>;
1756 def int_x86_avx2_gather_d_d : GCCBuiltin<"__builtin_ia32_gatherd_d">,
1757 Intrinsic<[llvm_v4i32_ty],
1758 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
1759 [IntrReadMem, ImmArg<4>]>;
1760 def int_x86_avx2_gather_d_d_256 : GCCBuiltin<"__builtin_ia32_gatherd_d256">,
1761 Intrinsic<[llvm_v8i32_ty],
1762 [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
1763 [IntrReadMem, ImmArg<4>]>;
1764 def int_x86_avx2_gather_q_d : GCCBuiltin<"__builtin_ia32_gatherq_d">,
1765 Intrinsic<[llvm_v4i32_ty],
1766 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
1767 [IntrReadMem, ImmArg<4>]>;
1768 def int_x86_avx2_gather_q_d_256 : GCCBuiltin<"__builtin_ia32_gatherq_d256">,
1769 Intrinsic<[llvm_v4i32_ty],
1770 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
1771 [IntrReadMem, ImmArg<4>]>;
1775 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1776 def int_x86_avx2_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb256">,
1777 Intrinsic<[llvm_i32_ty], [llvm_v32i8_ty], [IntrNoMem]>;
1778 def int_x86_avx2_pshuf_b : GCCBuiltin<"__builtin_ia32_pshufb256">,
1779 Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
1780 llvm_v32i8_ty], [IntrNoMem]>;
1781 def int_x86_avx2_mpsadbw : GCCBuiltin<"__builtin_ia32_mpsadbw256">,
1782 Intrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
1783 llvm_i8_ty], [IntrNoMem, Commutative, ImmArg<2>]>;
1786 //===----------------------------------------------------------------------===//
1789 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1790 def int_x86_avx512_vfmadd_pd_512 :
1791 Intrinsic<[llvm_v8f64_ty],
1792 [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty],
1793 [IntrNoMem, ImmArg<3>]>;
1795 def int_x86_avx512_vfmadd_ps_512 :
1796 Intrinsic<[llvm_v16f32_ty],
1797 [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty],
1798 [IntrNoMem, ImmArg<3>]>;
1800 // TODO: Can we use 2 vfmadds+shufflevector?
1801 def int_x86_avx512_vfmaddsub_pd_512 :
1802 Intrinsic<[llvm_v8f64_ty],
1803 [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty],
1804 [IntrNoMem, ImmArg<3>]>;
1806 def int_x86_avx512_vfmaddsub_ps_512 :
1807 Intrinsic<[llvm_v16f32_ty],
1808 [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty],
1809 [IntrNoMem, ImmArg<3>]>;
1811 def int_x86_avx512_vfmadd_f64 :
1812 Intrinsic<[llvm_double_ty],
1813 [llvm_double_ty, llvm_double_ty, llvm_double_ty, llvm_i32_ty],
1814 [IntrNoMem, ImmArg<3>]>;
1815 def int_x86_avx512_vfmadd_f32 :
1816 Intrinsic<[llvm_float_ty],
1817 [llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_i32_ty],
1818 [IntrNoMem, ImmArg<3>]>;
1820 def int_x86_avx512_vpmadd52h_uq_128 :
1821 GCCBuiltin<"__builtin_ia32_vpmadd52huq128">,
1822 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
1823 llvm_v2i64_ty], [IntrNoMem]>;
1824 def int_x86_avx512_vpmadd52l_uq_128 :
1825 GCCBuiltin<"__builtin_ia32_vpmadd52luq128">,
1826 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
1827 llvm_v2i64_ty], [IntrNoMem]>;
1828 def int_x86_avx512_vpmadd52h_uq_256 :
1829 GCCBuiltin<"__builtin_ia32_vpmadd52huq256">,
1830 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
1831 llvm_v4i64_ty], [IntrNoMem]>;
1832 def int_x86_avx512_vpmadd52l_uq_256 :
1833 GCCBuiltin<"__builtin_ia32_vpmadd52luq256">,
1834 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
1835 llvm_v4i64_ty], [IntrNoMem]>;
1836 def int_x86_avx512_vpmadd52h_uq_512 :
1837 GCCBuiltin<"__builtin_ia32_vpmadd52huq512">,
1838 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
1839 llvm_v8i64_ty], [IntrNoMem]>;
1840 def int_x86_avx512_vpmadd52l_uq_512 :
1841 GCCBuiltin<"__builtin_ia32_vpmadd52luq512">,
1842 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
1843 llvm_v8i64_ty], [IntrNoMem]>;
1847 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1848 def int_x86_avx512_vpdpbusd_128 :
1849 GCCBuiltin<"__builtin_ia32_vpdpbusd128">,
1850 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1851 llvm_v4i32_ty], [IntrNoMem]>;
1852 def int_x86_avx512_vpdpbusd_256 :
1853 GCCBuiltin<"__builtin_ia32_vpdpbusd256">,
1854 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1855 llvm_v8i32_ty], [IntrNoMem]>;
1856 def int_x86_avx512_vpdpbusd_512 :
1857 GCCBuiltin<"__builtin_ia32_vpdpbusd512">,
1858 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1859 llvm_v16i32_ty], [IntrNoMem]>;
1861 def int_x86_avx512_vpdpbusds_128 :
1862 GCCBuiltin<"__builtin_ia32_vpdpbusds128">,
1863 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1864 llvm_v4i32_ty], [IntrNoMem]>;
1865 def int_x86_avx512_vpdpbusds_256 :
1866 GCCBuiltin<"__builtin_ia32_vpdpbusds256">,
1867 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1868 llvm_v8i32_ty], [IntrNoMem]>;
1869 def int_x86_avx512_vpdpbusds_512 :
1870 GCCBuiltin<"__builtin_ia32_vpdpbusds512">,
1871 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1872 llvm_v16i32_ty], [IntrNoMem]>;
1874 def int_x86_avx512_vpdpwssd_128 :
1875 GCCBuiltin<"__builtin_ia32_vpdpwssd128">,
1876 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1877 llvm_v4i32_ty], [IntrNoMem]>;
1878 def int_x86_avx512_vpdpwssd_256 :
1879 GCCBuiltin<"__builtin_ia32_vpdpwssd256">,
1880 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1881 llvm_v8i32_ty], [IntrNoMem]>;
1882 def int_x86_avx512_vpdpwssd_512 :
1883 GCCBuiltin<"__builtin_ia32_vpdpwssd512">,
1884 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1885 llvm_v16i32_ty], [IntrNoMem]>;
1887 def int_x86_avx512_vpdpwssds_128 :
1888 GCCBuiltin<"__builtin_ia32_vpdpwssds128">,
1889 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
1890 llvm_v4i32_ty], [IntrNoMem]>;
1891 def int_x86_avx512_vpdpwssds_256 :
1892 GCCBuiltin<"__builtin_ia32_vpdpwssds256">,
1893 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
1894 llvm_v8i32_ty], [IntrNoMem]>;
1895 def int_x86_avx512_vpdpwssds_512 :
1896 GCCBuiltin<"__builtin_ia32_vpdpwssds512">,
1897 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
1898 llvm_v16i32_ty], [IntrNoMem]>;
1901 //===----------------------------------------------------------------------===//
1904 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
1905 def int_x86_xop_vpermil2pd : GCCBuiltin<"__builtin_ia32_vpermil2pd">,
1906 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
1907 llvm_v2i64_ty, llvm_i8_ty],
1908 [IntrNoMem, ImmArg<3>]>;
1910 def int_x86_xop_vpermil2pd_256 :
1911 GCCBuiltin<"__builtin_ia32_vpermil2pd256">,
1912 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
1913 llvm_v4i64_ty, llvm_i8_ty],
1914 [IntrNoMem, ImmArg<3>]>;
1916 def int_x86_xop_vpermil2ps : GCCBuiltin<"__builtin_ia32_vpermil2ps">,
1917 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
1918 llvm_v4i32_ty, llvm_i8_ty],
1919 [IntrNoMem, ImmArg<3>]>;
1920 def int_x86_xop_vpermil2ps_256 :
1921 GCCBuiltin<"__builtin_ia32_vpermil2ps256">,
1922 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
1923 llvm_v8i32_ty, llvm_i8_ty],
1924 [IntrNoMem, ImmArg<3>]>;
1926 def int_x86_xop_vfrcz_pd : GCCBuiltin<"__builtin_ia32_vfrczpd">,
1927 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1928 def int_x86_xop_vfrcz_ps : GCCBuiltin<"__builtin_ia32_vfrczps">,
1929 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1930 def int_x86_xop_vfrcz_sd : GCCBuiltin<"__builtin_ia32_vfrczsd">,
1931 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
1932 def int_x86_xop_vfrcz_ss : GCCBuiltin<"__builtin_ia32_vfrczss">,
1933 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
1934 def int_x86_xop_vfrcz_pd_256 : GCCBuiltin<"__builtin_ia32_vfrczpd256">,
1935 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>;
1936 def int_x86_xop_vfrcz_ps_256 : GCCBuiltin<"__builtin_ia32_vfrczps256">,
1937 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
1939 def int_x86_xop_vphaddbd :
1940 GCCBuiltin<"__builtin_ia32_vphaddbd">,
1941 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1942 def int_x86_xop_vphaddbq :
1943 GCCBuiltin<"__builtin_ia32_vphaddbq">,
1944 Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1945 def int_x86_xop_vphaddbw :
1946 GCCBuiltin<"__builtin_ia32_vphaddbw">,
1947 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1948 def int_x86_xop_vphadddq :
1949 GCCBuiltin<"__builtin_ia32_vphadddq">,
1950 Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1951 def int_x86_xop_vphaddubd :
1952 GCCBuiltin<"__builtin_ia32_vphaddubd">,
1953 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1954 def int_x86_xop_vphaddubq :
1955 GCCBuiltin<"__builtin_ia32_vphaddubq">,
1956 Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1957 def int_x86_xop_vphaddubw :
1958 GCCBuiltin<"__builtin_ia32_vphaddubw">,
1959 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1960 def int_x86_xop_vphaddudq :
1961 GCCBuiltin<"__builtin_ia32_vphaddudq">,
1962 Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1963 def int_x86_xop_vphadduwd :
1964 GCCBuiltin<"__builtin_ia32_vphadduwd">,
1965 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1966 def int_x86_xop_vphadduwq :
1967 GCCBuiltin<"__builtin_ia32_vphadduwq">,
1968 Intrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1969 def int_x86_xop_vphaddwd :
1970 GCCBuiltin<"__builtin_ia32_vphaddwd">,
1971 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1972 def int_x86_xop_vphaddwq :
1973 GCCBuiltin<"__builtin_ia32_vphaddwq">,
1974 Intrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1975 def int_x86_xop_vphsubbw :
1976 GCCBuiltin<"__builtin_ia32_vphsubbw">,
1977 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
1978 def int_x86_xop_vphsubdq :
1979 GCCBuiltin<"__builtin_ia32_vphsubdq">,
1980 Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
1981 def int_x86_xop_vphsubwd :
1982 GCCBuiltin<"__builtin_ia32_vphsubwd">,
1983 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
1984 def int_x86_xop_vpmacsdd :
1985 GCCBuiltin<"__builtin_ia32_vpmacsdd">,
1986 Intrinsic<[llvm_v4i32_ty],
1987 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
1988 [IntrNoMem, Commutative]>;
1989 def int_x86_xop_vpmacsdqh :
1990 GCCBuiltin<"__builtin_ia32_vpmacsdqh">,
1991 Intrinsic<[llvm_v2i64_ty],
1992 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
1993 [IntrNoMem, Commutative]>;
1994 def int_x86_xop_vpmacsdql :
1995 GCCBuiltin<"__builtin_ia32_vpmacsdql">,
1996 Intrinsic<[llvm_v2i64_ty],
1997 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
1998 [IntrNoMem, Commutative]>;
1999 def int_x86_xop_vpmacssdd :
2000 GCCBuiltin<"__builtin_ia32_vpmacssdd">,
2001 Intrinsic<[llvm_v4i32_ty],
2002 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
2003 [IntrNoMem, Commutative]>;
2004 def int_x86_xop_vpmacssdqh :
2005 GCCBuiltin<"__builtin_ia32_vpmacssdqh">,
2006 Intrinsic<[llvm_v2i64_ty],
2007 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
2008 [IntrNoMem, Commutative]>;
2009 def int_x86_xop_vpmacssdql :
2010 GCCBuiltin<"__builtin_ia32_vpmacssdql">,
2011 Intrinsic<[llvm_v2i64_ty],
2012 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
2013 [IntrNoMem, Commutative]>;
2014 def int_x86_xop_vpmacsswd :
2015 GCCBuiltin<"__builtin_ia32_vpmacsswd">,
2016 Intrinsic<[llvm_v4i32_ty],
2017 [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2018 [IntrNoMem, Commutative]>;
2019 def int_x86_xop_vpmacssww :
2020 GCCBuiltin<"__builtin_ia32_vpmacssww">,
2021 Intrinsic<[llvm_v8i16_ty],
2022 [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
2023 [IntrNoMem, Commutative]>;
2024 def int_x86_xop_vpmacswd :
2025 GCCBuiltin<"__builtin_ia32_vpmacswd">,
2026 Intrinsic<[llvm_v4i32_ty],
2027 [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2028 [IntrNoMem, Commutative]>;
2029 def int_x86_xop_vpmacsww :
2030 GCCBuiltin<"__builtin_ia32_vpmacsww">,
2031 Intrinsic<[llvm_v8i16_ty],
2032 [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
2033 [IntrNoMem, Commutative]>;
2034 def int_x86_xop_vpmadcsswd :
2035 GCCBuiltin<"__builtin_ia32_vpmadcsswd">,
2036 Intrinsic<[llvm_v4i32_ty],
2037 [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2038 [IntrNoMem, Commutative]>;
2039 def int_x86_xop_vpmadcswd :
2040 GCCBuiltin<"__builtin_ia32_vpmadcswd">,
2041 Intrinsic<[llvm_v4i32_ty],
2042 [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
2043 [IntrNoMem, Commutative]>;
2044 def int_x86_xop_vpperm :
2045 GCCBuiltin<"__builtin_ia32_vpperm">,
2046 Intrinsic<[llvm_v16i8_ty],
2047 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
2049 def int_x86_xop_vpshab :
2050 GCCBuiltin<"__builtin_ia32_vpshab">,
2051 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
2053 def int_x86_xop_vpshad :
2054 GCCBuiltin<"__builtin_ia32_vpshad">,
2055 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
2057 def int_x86_xop_vpshaq :
2058 GCCBuiltin<"__builtin_ia32_vpshaq">,
2059 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
2061 def int_x86_xop_vpshaw :
2062 GCCBuiltin<"__builtin_ia32_vpshaw">,
2063 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
2065 def int_x86_xop_vpshlb :
2066 GCCBuiltin<"__builtin_ia32_vpshlb">,
2067 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
2069 def int_x86_xop_vpshld :
2070 GCCBuiltin<"__builtin_ia32_vpshld">,
2071 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
2073 def int_x86_xop_vpshlq :
2074 GCCBuiltin<"__builtin_ia32_vpshlq">,
2075 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
2077 def int_x86_xop_vpshlw :
2078 GCCBuiltin<"__builtin_ia32_vpshlw">,
2079 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
2083 //===----------------------------------------------------------------------===//
2085 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2086 def int_x86_llwpcb :
2087 GCCBuiltin<"__builtin_ia32_llwpcb">,
2088 Intrinsic<[], [llvm_ptr_ty], []>;
2089 def int_x86_slwpcb :
2090 GCCBuiltin<"__builtin_ia32_slwpcb">,
2091 Intrinsic<[llvm_ptr_ty], [], []>;
2092 def int_x86_lwpins32 :
2093 GCCBuiltin<"__builtin_ia32_lwpins32">,
2094 Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
2095 def int_x86_lwpins64 :
2096 GCCBuiltin<"__builtin_ia32_lwpins64">,
2097 Intrinsic<[llvm_i8_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], []>;
2098 def int_x86_lwpval32 :
2099 GCCBuiltin<"__builtin_ia32_lwpval32">,
2100 Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
2101 def int_x86_lwpval64 :
2102 GCCBuiltin<"__builtin_ia32_lwpval64">,
2103 Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], []>;
2106 //===----------------------------------------------------------------------===//
2109 // Empty MMX state op.
2110 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2111 def int_x86_mmx_emms : GCCBuiltin<"__builtin_ia32_emms">,
2112 Intrinsic<[], [], []>;
2113 def int_x86_mmx_femms : GCCBuiltin<"__builtin_ia32_femms">,
2114 Intrinsic<[], [], []>;
2117 // Integer arithmetic ops.
2118 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2120 def int_x86_mmx_padd_b : GCCBuiltin<"__builtin_ia32_paddb">,
2121 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2122 [IntrNoMem, Commutative]>;
2123 def int_x86_mmx_padd_w : GCCBuiltin<"__builtin_ia32_paddw">,
2124 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2125 [IntrNoMem, Commutative]>;
2126 def int_x86_mmx_padd_d : GCCBuiltin<"__builtin_ia32_paddd">,
2127 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2128 [IntrNoMem, Commutative]>;
2129 def int_x86_mmx_padd_q : GCCBuiltin<"__builtin_ia32_paddq">,
2130 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2131 [IntrNoMem, Commutative]>;
2133 def int_x86_mmx_padds_b : GCCBuiltin<"__builtin_ia32_paddsb">,
2134 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2135 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2136 def int_x86_mmx_padds_w : GCCBuiltin<"__builtin_ia32_paddsw">,
2137 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2138 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2140 def int_x86_mmx_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb">,
2141 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2142 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2143 def int_x86_mmx_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw">,
2144 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2145 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2148 def int_x86_mmx_psub_b : GCCBuiltin<"__builtin_ia32_psubb">,
2149 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2151 def int_x86_mmx_psub_w : GCCBuiltin<"__builtin_ia32_psubw">,
2152 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2154 def int_x86_mmx_psub_d : GCCBuiltin<"__builtin_ia32_psubd">,
2155 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2157 def int_x86_mmx_psub_q : GCCBuiltin<"__builtin_ia32_psubq">,
2158 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2161 def int_x86_mmx_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb">,
2162 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2163 llvm_x86mmx_ty], [IntrNoMem]>;
2164 def int_x86_mmx_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw">,
2165 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2166 llvm_x86mmx_ty], [IntrNoMem]>;
2168 def int_x86_mmx_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb">,
2169 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2170 llvm_x86mmx_ty], [IntrNoMem]>;
2171 def int_x86_mmx_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw">,
2172 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2173 llvm_x86mmx_ty], [IntrNoMem]>;
2176 def int_x86_mmx_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw">,
2177 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2178 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2179 def int_x86_mmx_pmull_w : GCCBuiltin<"__builtin_ia32_pmullw">,
2180 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2181 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2182 def int_x86_mmx_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw">,
2183 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2184 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2185 def int_x86_mmx_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq">,
2186 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2187 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2188 def int_x86_mmx_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd">,
2189 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2190 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2192 // Bitwise operations
2193 def int_x86_mmx_pand : GCCBuiltin<"__builtin_ia32_pand">,
2194 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2195 [IntrNoMem, Commutative]>;
2196 def int_x86_mmx_pandn : GCCBuiltin<"__builtin_ia32_pandn">,
2197 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2199 def int_x86_mmx_por : GCCBuiltin<"__builtin_ia32_por">,
2200 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2201 [IntrNoMem, Commutative]>;
2202 def int_x86_mmx_pxor : GCCBuiltin<"__builtin_ia32_pxor">,
2203 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2204 [IntrNoMem, Commutative]>;
2207 def int_x86_mmx_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb">,
2208 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2209 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2210 def int_x86_mmx_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw">,
2211 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2212 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2215 def int_x86_mmx_pmaxu_b : GCCBuiltin<"__builtin_ia32_pmaxub">,
2216 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2217 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2218 def int_x86_mmx_pmaxs_w : GCCBuiltin<"__builtin_ia32_pmaxsw">,
2219 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2220 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2223 def int_x86_mmx_pminu_b : GCCBuiltin<"__builtin_ia32_pminub">,
2224 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2225 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2226 def int_x86_mmx_pmins_w : GCCBuiltin<"__builtin_ia32_pminsw">,
2227 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2228 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2230 // Packed sum of absolute differences
2231 def int_x86_mmx_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw">,
2232 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2233 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2236 // Integer shift ops.
2237 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2238 // Shift left logical
2239 def int_x86_mmx_psll_w : GCCBuiltin<"__builtin_ia32_psllw">,
2240 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2241 llvm_x86mmx_ty], [IntrNoMem]>;
2242 def int_x86_mmx_psll_d : GCCBuiltin<"__builtin_ia32_pslld">,
2243 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2244 llvm_x86mmx_ty], [IntrNoMem]>;
2245 def int_x86_mmx_psll_q : GCCBuiltin<"__builtin_ia32_psllq">,
2246 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2247 llvm_x86mmx_ty], [IntrNoMem]>;
2249 def int_x86_mmx_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw">,
2250 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2251 llvm_x86mmx_ty], [IntrNoMem]>;
2252 def int_x86_mmx_psrl_d : GCCBuiltin<"__builtin_ia32_psrld">,
2253 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2254 llvm_x86mmx_ty], [IntrNoMem]>;
2255 def int_x86_mmx_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq">,
2256 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2257 llvm_x86mmx_ty], [IntrNoMem]>;
2259 def int_x86_mmx_psra_w : GCCBuiltin<"__builtin_ia32_psraw">,
2260 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2261 llvm_x86mmx_ty], [IntrNoMem]>;
2262 def int_x86_mmx_psra_d : GCCBuiltin<"__builtin_ia32_psrad">,
2263 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2264 llvm_x86mmx_ty], [IntrNoMem]>;
2266 // Oddly these don't require an immediate due to a gcc compatibility issue.
2267 def int_x86_mmx_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi">,
2268 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2269 llvm_i32_ty], [IntrNoMem]>;
2270 def int_x86_mmx_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi">,
2271 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2272 llvm_i32_ty], [IntrNoMem]>;
2273 def int_x86_mmx_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi">,
2274 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2275 llvm_i32_ty], [IntrNoMem]>;
2277 def int_x86_mmx_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi">,
2278 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2279 llvm_i32_ty], [IntrNoMem]>;
2280 def int_x86_mmx_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi">,
2281 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2282 llvm_i32_ty], [IntrNoMem]>;
2283 def int_x86_mmx_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi">,
2284 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2285 llvm_i32_ty], [IntrNoMem]>;
2287 def int_x86_mmx_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi">,
2288 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2289 llvm_i32_ty], [IntrNoMem]>;
2290 def int_x86_mmx_psrai_d : GCCBuiltin<"__builtin_ia32_psradi">,
2291 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2292 llvm_i32_ty], [IntrNoMem]>;
2295 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2296 def int_x86_avx512_permvar_df_256 : GCCBuiltin<"__builtin_ia32_permvardf256">,
2297 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
2298 llvm_v4i64_ty], [IntrNoMem]>;
2299 def int_x86_avx512_permvar_df_512 : GCCBuiltin<"__builtin_ia32_permvardf512">,
2300 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty,
2301 llvm_v8i64_ty], [IntrNoMem]>;
2302 def int_x86_avx512_permvar_di_256 : GCCBuiltin<"__builtin_ia32_permvardi256">,
2303 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
2304 llvm_v4i64_ty], [IntrNoMem]>;
2305 def int_x86_avx512_permvar_di_512 : GCCBuiltin<"__builtin_ia32_permvardi512">,
2306 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
2307 llvm_v8i64_ty], [IntrNoMem]>;
2308 def int_x86_avx512_permvar_hi_128 : GCCBuiltin<"__builtin_ia32_permvarhi128">,
2309 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
2310 llvm_v8i16_ty], [IntrNoMem]>;
2311 def int_x86_avx512_permvar_hi_256 : GCCBuiltin<"__builtin_ia32_permvarhi256">,
2312 Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
2313 llvm_v16i16_ty], [IntrNoMem]>;
2314 def int_x86_avx512_permvar_hi_512 : GCCBuiltin<"__builtin_ia32_permvarhi512">,
2315 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
2316 llvm_v32i16_ty], [IntrNoMem]>;
2317 def int_x86_avx512_permvar_qi_128 : GCCBuiltin<"__builtin_ia32_permvarqi128">,
2318 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
2319 llvm_v16i8_ty], [IntrNoMem]>;
2320 def int_x86_avx512_permvar_qi_256 : GCCBuiltin<"__builtin_ia32_permvarqi256">,
2321 Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
2322 llvm_v32i8_ty], [IntrNoMem]>;
2323 def int_x86_avx512_permvar_qi_512 : GCCBuiltin<"__builtin_ia32_permvarqi512">,
2324 Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty,
2325 llvm_v64i8_ty], [IntrNoMem]>;
2326 def int_x86_avx512_permvar_sf_512 : GCCBuiltin<"__builtin_ia32_permvarsf512">,
2327 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty,
2328 llvm_v16i32_ty], [IntrNoMem]>;
2329 def int_x86_avx512_permvar_si_512 : GCCBuiltin<"__builtin_ia32_permvarsi512">,
2330 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
2331 llvm_v16i32_ty], [IntrNoMem]>;
2334 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2335 def int_x86_mmx_packsswb : GCCBuiltin<"__builtin_ia32_packsswb">,
2336 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2337 llvm_x86mmx_ty], [IntrNoMem]>;
2338 def int_x86_mmx_packssdw : GCCBuiltin<"__builtin_ia32_packssdw">,
2339 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2340 llvm_x86mmx_ty], [IntrNoMem]>;
2341 def int_x86_mmx_packuswb : GCCBuiltin<"__builtin_ia32_packuswb">,
2342 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2343 llvm_x86mmx_ty], [IntrNoMem]>;
2347 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2348 def int_x86_mmx_punpckhbw : GCCBuiltin<"__builtin_ia32_punpckhbw">,
2349 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2351 def int_x86_mmx_punpckhwd : GCCBuiltin<"__builtin_ia32_punpckhwd">,
2352 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2354 def int_x86_mmx_punpckhdq : GCCBuiltin<"__builtin_ia32_punpckhdq">,
2355 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2357 def int_x86_mmx_punpcklbw : GCCBuiltin<"__builtin_ia32_punpcklbw">,
2358 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2360 def int_x86_mmx_punpcklwd : GCCBuiltin<"__builtin_ia32_punpcklwd">,
2361 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2363 def int_x86_mmx_punpckldq : GCCBuiltin<"__builtin_ia32_punpckldq">,
2364 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
2368 // Integer comparison ops
2369 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2370 def int_x86_mmx_pcmpeq_b : GCCBuiltin<"__builtin_ia32_pcmpeqb">,
2371 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2372 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2373 def int_x86_mmx_pcmpeq_w : GCCBuiltin<"__builtin_ia32_pcmpeqw">,
2374 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2375 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2376 def int_x86_mmx_pcmpeq_d : GCCBuiltin<"__builtin_ia32_pcmpeqd">,
2377 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2378 llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
2380 def int_x86_mmx_pcmpgt_b : GCCBuiltin<"__builtin_ia32_pcmpgtb">,
2381 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2382 llvm_x86mmx_ty], [IntrNoMem]>;
2383 def int_x86_mmx_pcmpgt_w : GCCBuiltin<"__builtin_ia32_pcmpgtw">,
2384 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2385 llvm_x86mmx_ty], [IntrNoMem]>;
2386 def int_x86_mmx_pcmpgt_d : GCCBuiltin<"__builtin_ia32_pcmpgtd">,
2387 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2388 llvm_x86mmx_ty], [IntrNoMem]>;
2392 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2393 def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">,
2394 Intrinsic<[], [llvm_x86mmx_ty, llvm_x86mmx_ty, llvm_ptr_ty], []>;
2396 def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">,
2397 Intrinsic<[llvm_i32_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
2399 def int_x86_mmx_movnt_dq : GCCBuiltin<"__builtin_ia32_movntq">,
2400 Intrinsic<[], [llvm_ptrx86mmx_ty, llvm_x86mmx_ty], []>;
2402 def int_x86_mmx_palignr_b : GCCBuiltin<"__builtin_ia32_palignr">,
2403 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2404 llvm_x86mmx_ty, llvm_i8_ty], [IntrNoMem, ImmArg<2>]>;
2406 def int_x86_mmx_pextr_w : GCCBuiltin<"__builtin_ia32_vec_ext_v4hi">,
2407 Intrinsic<[llvm_i32_ty], [llvm_x86mmx_ty, llvm_i32_ty],
2408 [IntrNoMem, ImmArg<1>]>;
2410 def int_x86_mmx_pinsr_w : GCCBuiltin<"__builtin_ia32_vec_set_v4hi">,
2411 Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
2412 llvm_i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
2415 //===----------------------------------------------------------------------===//
2418 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2419 def int_x86_bmi_bextr_32 : GCCBuiltin<"__builtin_ia32_bextr_u32">,
2420 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
2421 def int_x86_bmi_bextr_64 : GCCBuiltin<"__builtin_ia32_bextr_u64">,
2422 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
2423 def int_x86_bmi_bzhi_32 : GCCBuiltin<"__builtin_ia32_bzhi_si">,
2424 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
2425 def int_x86_bmi_bzhi_64 : GCCBuiltin<"__builtin_ia32_bzhi_di">,
2426 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
2427 def int_x86_bmi_pdep_32 : GCCBuiltin<"__builtin_ia32_pdep_si">,
2428 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
2429 def int_x86_bmi_pdep_64 : GCCBuiltin<"__builtin_ia32_pdep_di">,
2430 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
2431 def int_x86_bmi_pext_32 : GCCBuiltin<"__builtin_ia32_pext_si">,
2432 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
2433 def int_x86_bmi_pext_64 : GCCBuiltin<"__builtin_ia32_pext_di">,
2434 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
2437 //===----------------------------------------------------------------------===//
2440 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2441 def int_x86_rdfsbase_32 : GCCBuiltin<"__builtin_ia32_rdfsbase32">,
2442 Intrinsic<[llvm_i32_ty], []>;
2443 def int_x86_rdgsbase_32 : GCCBuiltin<"__builtin_ia32_rdgsbase32">,
2444 Intrinsic<[llvm_i32_ty], []>;
2445 def int_x86_rdfsbase_64 : GCCBuiltin<"__builtin_ia32_rdfsbase64">,
2446 Intrinsic<[llvm_i64_ty], []>;
2447 def int_x86_rdgsbase_64 : GCCBuiltin<"__builtin_ia32_rdgsbase64">,
2448 Intrinsic<[llvm_i64_ty], []>;
2449 def int_x86_wrfsbase_32 : GCCBuiltin<"__builtin_ia32_wrfsbase32">,
2450 Intrinsic<[], [llvm_i32_ty]>;
2451 def int_x86_wrgsbase_32 : GCCBuiltin<"__builtin_ia32_wrgsbase32">,
2452 Intrinsic<[], [llvm_i32_ty]>;
2453 def int_x86_wrfsbase_64 : GCCBuiltin<"__builtin_ia32_wrfsbase64">,
2454 Intrinsic<[], [llvm_i64_ty]>;
2455 def int_x86_wrgsbase_64 : GCCBuiltin<"__builtin_ia32_wrgsbase64">,
2456 Intrinsic<[], [llvm_i64_ty]>;
2459 //===----------------------------------------------------------------------===//
2461 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2462 def int_x86_fxrstor : GCCBuiltin<"__builtin_ia32_fxrstor">,
2463 Intrinsic<[], [llvm_ptr_ty], []>;
2464 def int_x86_fxrstor64 : GCCBuiltin<"__builtin_ia32_fxrstor64">,
2465 Intrinsic<[], [llvm_ptr_ty], []>;
2466 def int_x86_fxsave : GCCBuiltin<"__builtin_ia32_fxsave">,
2467 Intrinsic<[], [llvm_ptr_ty], []>;
2468 def int_x86_fxsave64 : GCCBuiltin<"__builtin_ia32_fxsave64">,
2469 Intrinsic<[], [llvm_ptr_ty], []>;
2472 //===----------------------------------------------------------------------===//
2474 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2476 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2477 def int_x86_xsave64 :
2478 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2479 def int_x86_xrstor :
2480 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2481 def int_x86_xrstor64 :
2482 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2483 def int_x86_xsaveopt :
2484 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2485 def int_x86_xsaveopt64 :
2486 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2487 def int_x86_xrstors :
2488 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2489 def int_x86_xrstors64 :
2490 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2491 def int_x86_xsavec :
2492 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2493 def int_x86_xsavec64 :
2494 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2495 def int_x86_xsaves :
2496 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2497 def int_x86_xsaves64 :
2498 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
2499 def int_x86_xgetbv :
2500 Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
2501 def int_x86_xsetbv :
2502 Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
2505 //===----------------------------------------------------------------------===//
2506 // CLFLUSHOPT and CLWB
2507 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2508 def int_x86_clflushopt : GCCBuiltin<"__builtin_ia32_clflushopt">,
2509 Intrinsic<[], [llvm_ptr_ty], []>;
2511 def int_x86_clwb : GCCBuiltin<"__builtin_ia32_clwb">,
2512 Intrinsic<[], [llvm_ptr_ty], []>;
2515 //===----------------------------------------------------------------------===//
2516 // Support protection key
2517 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2518 def int_x86_rdpkru : GCCBuiltin <"__builtin_ia32_rdpkru">,
2519 Intrinsic<[llvm_i32_ty], [], []>;
2520 def int_x86_wrpkru : GCCBuiltin<"__builtin_ia32_wrpkru">,
2521 Intrinsic<[], [llvm_i32_ty], []>;
2523 //===----------------------------------------------------------------------===//
2524 // Half float conversion
2526 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2527 def int_x86_vcvtph2ps_128 : GCCBuiltin<"__builtin_ia32_vcvtph2ps">,
2528 Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
2529 def int_x86_vcvtph2ps_256 : GCCBuiltin<"__builtin_ia32_vcvtph2ps256">,
2530 Intrinsic<[llvm_v8f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
2531 def int_x86_vcvtps2ph_128 : GCCBuiltin<"__builtin_ia32_vcvtps2ph">,
2532 Intrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty],
2533 [IntrNoMem, ImmArg<1>]>;
2534 def int_x86_vcvtps2ph_256 : GCCBuiltin<"__builtin_ia32_vcvtps2ph256">,
2535 Intrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty],
2536 [IntrNoMem, ImmArg<1>]>;
2537 def int_x86_avx512_mask_vcvtph2ps_512 : GCCBuiltin<"__builtin_ia32_vcvtph2ps512_mask">,
2538 Intrinsic<[llvm_v16f32_ty], [llvm_v16i16_ty, llvm_v16f32_ty,
2539 llvm_i16_ty, llvm_i32_ty],
2540 [IntrNoMem, ImmArg<3>]>;
2541 def int_x86_avx512_mask_vcvtph2ps_256 : GCCBuiltin<"__builtin_ia32_vcvtph2ps256_mask">,
2542 Intrinsic<[llvm_v8f32_ty], [llvm_v8i16_ty, llvm_v8f32_ty,
2543 llvm_i8_ty], [IntrNoMem]>;
2544 def int_x86_avx512_mask_vcvtph2ps_128 : GCCBuiltin<"__builtin_ia32_vcvtph2ps_mask">,
2545 Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty, llvm_v4f32_ty,
2546 llvm_i8_ty], [IntrNoMem]>;
2547 def int_x86_avx512_mask_vcvtps2ph_512 : GCCBuiltin<"__builtin_ia32_vcvtps2ph512_mask">,
2548 Intrinsic<[llvm_v16i16_ty], [llvm_v16f32_ty, llvm_i32_ty,
2549 llvm_v16i16_ty, llvm_i16_ty],
2550 [IntrNoMem, ImmArg<1>]>;
2551 def int_x86_avx512_mask_vcvtps2ph_256 : GCCBuiltin<"__builtin_ia32_vcvtps2ph256_mask">,
2552 Intrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty,
2553 llvm_v8i16_ty, llvm_i8_ty],
2554 [IntrNoMem, ImmArg<1>]>;
2555 def int_x86_avx512_mask_vcvtps2ph_128 : GCCBuiltin<"__builtin_ia32_vcvtps2ph_mask">,
2556 Intrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty,
2557 llvm_v8i16_ty, llvm_i8_ty],
2558 [IntrNoMem, ImmArg<1>]>;
2561 //===----------------------------------------------------------------------===//
2564 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2565 def int_x86_tbm_bextri_u32 : GCCBuiltin<"__builtin_ia32_bextri_u32">,
2566 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
2567 [IntrNoMem, ImmArg<1>]>;
2568 def int_x86_tbm_bextri_u64 : GCCBuiltin<"__builtin_ia32_bextri_u64">,
2569 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
2570 [IntrNoMem, ImmArg<1>]>;
2573 //===----------------------------------------------------------------------===//
2574 // RDRAND intrinsics - Return a random value and whether it is valid.
2575 // RDSEED intrinsics - Return a NIST SP800-90B & C compliant random value and
2576 // whether it is valid.
2578 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2579 // These are declared side-effecting so they don't get eliminated by CSE or
2581 def int_x86_rdrand_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
2582 def int_x86_rdrand_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
2583 def int_x86_rdrand_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
2584 def int_x86_rdseed_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
2585 def int_x86_rdseed_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
2586 def int_x86_rdseed_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
2589 //===----------------------------------------------------------------------===//
2592 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2593 def int_x86_addcarry_32:
2594 Intrinsic<[llvm_i8_ty, llvm_i32_ty],
2595 [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
2596 def int_x86_addcarry_64:
2597 Intrinsic<[llvm_i8_ty, llvm_i64_ty],
2598 [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
2599 def int_x86_subborrow_32:
2600 Intrinsic<[llvm_i8_ty, llvm_i32_ty],
2601 [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
2602 def int_x86_subborrow_64:
2603 Intrinsic<[llvm_i8_ty, llvm_i64_ty],
2604 [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
2607 //===----------------------------------------------------------------------===//
2608 // RTM intrinsics. Transactional Memory support.
2610 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2611 def int_x86_xbegin : GCCBuiltin<"__builtin_ia32_xbegin">,
2612 Intrinsic<[llvm_i32_ty], [], []>;
2613 def int_x86_xend : GCCBuiltin<"__builtin_ia32_xend">,
2614 Intrinsic<[], [], []>;
2615 def int_x86_xabort : GCCBuiltin<"__builtin_ia32_xabort">,
2616 Intrinsic<[], [llvm_i8_ty], [ImmArg<0>]>;
2617 def int_x86_xtest : GCCBuiltin<"__builtin_ia32_xtest">,
2618 Intrinsic<[llvm_i32_ty], [], []>;
2621 //===----------------------------------------------------------------------===//
2625 let TargetPrefix = "x86" in {
2626 def int_x86_avx512_kadd_b :
2627 Intrinsic<[llvm_v8i1_ty], [llvm_v8i1_ty, llvm_v8i1_ty], [IntrNoMem]>;
2628 def int_x86_avx512_kadd_w :
2629 Intrinsic<[llvm_v16i1_ty], [llvm_v16i1_ty, llvm_v16i1_ty], [IntrNoMem]>;
2630 def int_x86_avx512_kadd_d :
2631 Intrinsic<[llvm_v32i1_ty], [llvm_v32i1_ty, llvm_v32i1_ty], [IntrNoMem]>;
2632 def int_x86_avx512_kadd_q :
2633 Intrinsic<[llvm_v64i1_ty], [llvm_v64i1_ty, llvm_v64i1_ty], [IntrNoMem]>;
2635 def int_x86_avx512_ktestc_b :
2636 Intrinsic<[llvm_i32_ty], [llvm_v8i1_ty, llvm_v8i1_ty], [IntrNoMem]>;
2637 def int_x86_avx512_ktestc_w :
2638 Intrinsic<[llvm_i32_ty], [llvm_v16i1_ty, llvm_v16i1_ty], [IntrNoMem]>;
2639 def int_x86_avx512_ktestc_d :
2640 Intrinsic<[llvm_i32_ty], [llvm_v32i1_ty, llvm_v32i1_ty], [IntrNoMem]>;
2641 def int_x86_avx512_ktestc_q :
2642 Intrinsic<[llvm_i32_ty], [llvm_v64i1_ty, llvm_v64i1_ty], [IntrNoMem]>;
2644 def int_x86_avx512_ktestz_b :
2645 Intrinsic<[llvm_i32_ty], [llvm_v8i1_ty, llvm_v8i1_ty], [IntrNoMem]>;
2646 def int_x86_avx512_ktestz_w :
2647 Intrinsic<[llvm_i32_ty], [llvm_v16i1_ty, llvm_v16i1_ty], [IntrNoMem]>;
2648 def int_x86_avx512_ktestz_d :
2649 Intrinsic<[llvm_i32_ty], [llvm_v32i1_ty, llvm_v32i1_ty], [IntrNoMem]>;
2650 def int_x86_avx512_ktestz_q :
2651 Intrinsic<[llvm_i32_ty], [llvm_v64i1_ty, llvm_v64i1_ty], [IntrNoMem]>;
2655 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2656 def int_x86_avx512_cvttss2si : GCCBuiltin<"__builtin_ia32_vcvttss2si32">,
2657 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2658 [IntrNoMem, ImmArg<1>]>;
2659 def int_x86_avx512_cvttss2si64 : GCCBuiltin<"__builtin_ia32_vcvttss2si64">,
2660 Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2661 [IntrNoMem, ImmArg<1>]>;
2662 def int_x86_avx512_cvttss2usi : GCCBuiltin<"__builtin_ia32_vcvttss2usi32">,
2663 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2664 [IntrNoMem, ImmArg<1>]>;
2665 def int_x86_avx512_cvttss2usi64 : GCCBuiltin<"__builtin_ia32_vcvttss2usi64">,
2666 Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2667 [IntrNoMem, ImmArg<1>]>;
2668 def int_x86_avx512_cvtusi2ss : GCCBuiltin<"__builtin_ia32_cvtusi2ss32">,
2669 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
2670 llvm_i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
2671 def int_x86_avx512_cvtusi642ss : GCCBuiltin<"__builtin_ia32_cvtusi2ss64">,
2672 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
2673 llvm_i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
2674 def int_x86_avx512_cvttsd2si : GCCBuiltin<"__builtin_ia32_vcvttsd2si32">,
2675 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2676 [IntrNoMem, ImmArg<1>]>;
2677 def int_x86_avx512_cvttsd2si64 : GCCBuiltin<"__builtin_ia32_vcvttsd2si64">,
2678 Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2679 [IntrNoMem, ImmArg<1>]>;
2680 def int_x86_avx512_cvttsd2usi : GCCBuiltin<"__builtin_ia32_vcvttsd2usi32">,
2681 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2682 [IntrNoMem, ImmArg<1>]>;
2683 def int_x86_avx512_cvttsd2usi64 : GCCBuiltin<"__builtin_ia32_vcvttsd2usi64">,
2684 Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2685 [IntrNoMem, ImmArg<1>]>;
2686 def int_x86_avx512_cvtusi642sd : GCCBuiltin<"__builtin_ia32_cvtusi2sd64">,
2687 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
2688 llvm_i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
2689 def int_x86_avx512_vcvtss2usi32 : GCCBuiltin<"__builtin_ia32_vcvtss2usi32">,
2690 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2691 [IntrNoMem, ImmArg<1>]>;
2692 def int_x86_avx512_vcvtss2usi64 : GCCBuiltin<"__builtin_ia32_vcvtss2usi64">,
2693 Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2694 [IntrNoMem, ImmArg<1>]>;
2695 def int_x86_avx512_vcvtss2si32 : GCCBuiltin<"__builtin_ia32_vcvtss2si32">,
2696 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
2697 [IntrNoMem, ImmArg<1>]>;
2698 def int_x86_avx512_vcvtss2si64 : GCCBuiltin<"__builtin_ia32_vcvtss2si64">,
2699 Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty],
2700 [IntrNoMem, ImmArg<1>]>;
2701 def int_x86_avx512_vcvtsd2usi32 : GCCBuiltin<"__builtin_ia32_vcvtsd2usi32">,
2702 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2703 [IntrNoMem, ImmArg<1>]>;
2704 def int_x86_avx512_vcvtsd2usi64 : GCCBuiltin<"__builtin_ia32_vcvtsd2usi64">,
2705 Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2706 [IntrNoMem, ImmArg<1>]>;
2707 def int_x86_avx512_vcvtsd2si32 : GCCBuiltin<"__builtin_ia32_vcvtsd2si32">,
2708 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty],
2709 [IntrNoMem, ImmArg<1>]>;
2710 def int_x86_avx512_vcvtsd2si64 : GCCBuiltin<"__builtin_ia32_vcvtsd2si64">,
2711 Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty],
2712 [IntrNoMem, ImmArg<1>]>;
2713 def int_x86_avx512_cvtsi2ss32 : GCCBuiltin<"__builtin_ia32_cvtsi2ss32">,
2714 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
2715 llvm_i32_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
2716 def int_x86_avx512_cvtsi2ss64 : GCCBuiltin<"__builtin_ia32_cvtsi2ss64">,
2717 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
2718 llvm_i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
2719 def int_x86_avx512_cvtsi2sd64 : GCCBuiltin<"__builtin_ia32_cvtsi2sd64">,
2720 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
2721 llvm_i64_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
2725 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2726 def int_x86_avx512_packsswb_512 : GCCBuiltin<"__builtin_ia32_packsswb512">,
2727 Intrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
2729 def int_x86_avx512_packssdw_512 : GCCBuiltin<"__builtin_ia32_packssdw512">,
2730 Intrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
2732 def int_x86_avx512_packuswb_512 : GCCBuiltin<"__builtin_ia32_packuswb512">,
2733 Intrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
2735 def int_x86_avx512_packusdw_512 : GCCBuiltin<"__builtin_ia32_packusdw512">,
2736 Intrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
2741 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
2742 def int_x86_avx512_sitofp_round :
2743 Intrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
2744 [IntrNoMem, ImmArg<1>]>;
2746 def int_x86_avx512_uitofp_round :
2747 Intrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty, llvm_i32_ty],
2748 [IntrNoMem, ImmArg<1>]>;
2750 def int_x86_avx512_mask_cvtpd2dq_128 :
2751 GCCBuiltin<"__builtin_ia32_cvtpd2dq128_mask">,
2752 Intrinsic<[llvm_v4i32_ty],
2753 [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
2756 def int_x86_avx512_mask_cvtpd2dq_512 :
2757 GCCBuiltin<"__builtin_ia32_cvtpd2dq512_mask">,
2758 Intrinsic<[llvm_v8i32_ty],
2759 [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
2760 [IntrNoMem, ImmArg<3>]>;
2762 def int_x86_avx512_mask_cvtpd2ps_512 :
2763 GCCBuiltin<"__builtin_ia32_cvtpd2ps512_mask">,
2764 Intrinsic<[llvm_v8f32_ty],
2765 [llvm_v8f64_ty, llvm_v8f32_ty, llvm_i8_ty, llvm_i32_ty],
2766 [IntrNoMem, ImmArg<3>]>;
2768 def int_x86_avx512_mask_cvtsd2ss_round :
2769 GCCBuiltin<"__builtin_ia32_cvtsd2ss_round_mask">,
2770 Intrinsic<[llvm_v4f32_ty],
2771 [llvm_v4f32_ty, llvm_v2f64_ty, llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
2772 [IntrNoMem, ImmArg<4>]>;
2774 def int_x86_avx512_mask_cvtss2sd_round :
2775 GCCBuiltin<"__builtin_ia32_cvtss2sd_round_mask">,
2776 Intrinsic<[llvm_v2f64_ty],
2777 [llvm_v2f64_ty, llvm_v4f32_ty, llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
2778 [IntrNoMem, ImmArg<4>]>;
2780 def int_x86_avx512_mask_cvtpd2ps :
2781 GCCBuiltin<"__builtin_ia32_cvtpd2ps_mask">,
2782 Intrinsic<[llvm_v4f32_ty],
2783 [llvm_v2f64_ty, llvm_v4f32_ty, llvm_i8_ty],
2786 def int_x86_avx512_mask_cvtpd2qq_128 :
2787 GCCBuiltin<"__builtin_ia32_cvtpd2qq128_mask">,
2788 Intrinsic<[llvm_v2i64_ty],
2789 [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
2792 def int_x86_avx512_mask_cvtpd2qq_256 :
2793 GCCBuiltin<"__builtin_ia32_cvtpd2qq256_mask">,
2794 Intrinsic<[llvm_v4i64_ty],
2795 [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
2798 def int_x86_avx512_mask_cvtpd2qq_512 :
2799 GCCBuiltin<"__builtin_ia32_cvtpd2qq512_mask">,
2800 Intrinsic<[llvm_v8i64_ty],
2801 [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
2802 [IntrNoMem, ImmArg<3>]>;
2804 def int_x86_avx512_mask_cvtpd2udq_128 :
2805 GCCBuiltin<"__builtin_ia32_cvtpd2udq128_mask">,
2806 Intrinsic<[llvm_v4i32_ty],
2807 [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
2810 def int_x86_avx512_mask_cvtpd2udq_256 :
2811 GCCBuiltin<"__builtin_ia32_cvtpd2udq256_mask">,
2812 Intrinsic<[llvm_v4i32_ty],
2813 [llvm_v4f64_ty, llvm_v4i32_ty, llvm_i8_ty],
2816 def int_x86_avx512_mask_cvtpd2udq_512 :
2817 GCCBuiltin<"__builtin_ia32_cvtpd2udq512_mask">,
2818 Intrinsic<[llvm_v8i32_ty],
2819 [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
2820 [IntrNoMem, ImmArg<3>]>;
2822 def int_x86_avx512_mask_cvtpd2uqq_128 :
2823 GCCBuiltin<"__builtin_ia32_cvtpd2uqq128_mask">,
2824 Intrinsic<[llvm_v2i64_ty],
2825 [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
2828 def int_x86_avx512_mask_cvtpd2uqq_256 :
2829 GCCBuiltin<"__builtin_ia32_cvtpd2uqq256_mask">,
2830 Intrinsic<[llvm_v4i64_ty],
2831 [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
2834 def int_x86_avx512_mask_cvtpd2uqq_512 :
2835 GCCBuiltin<"__builtin_ia32_cvtpd2uqq512_mask">,
2836 Intrinsic<[llvm_v8i64_ty],
2837 [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
2838 [IntrNoMem, ImmArg<3>]>;
2840 def int_x86_avx512_mask_cvtps2dq_128 :
2841 GCCBuiltin<"__builtin_ia32_cvtps2dq128_mask">,
2842 Intrinsic<[llvm_v4i32_ty],
2843 [llvm_v4f32_ty, llvm_v4i32_ty, llvm_i8_ty],
2846 def int_x86_avx512_mask_cvtps2dq_256 :
2847 GCCBuiltin<"__builtin_ia32_cvtps2dq256_mask">,
2848 Intrinsic<[llvm_v8i32_ty],
2849 [llvm_v8f32_ty, llvm_v8i32_ty, llvm_i8_ty],
2852 def int_x86_avx512_mask_cvtps2dq_512 :
2853 GCCBuiltin<"__builtin_ia32_cvtps2dq512_mask">,
2854 Intrinsic<[llvm_v16i32_ty],
2855 [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
2856 [IntrNoMem, ImmArg<3>]>;
2858 def int_x86_avx512_mask_cvtps2pd_512 :
2859 GCCBuiltin<"__builtin_ia32_cvtps2pd512_mask">,
2860 Intrinsic<[llvm_v8f64_ty],
2861 [llvm_v8f32_ty, llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty],
2862 [IntrNoMem, ImmArg<3>]>;
2864 def int_x86_avx512_mask_cvtps2qq_128 :
2865 GCCBuiltin<"__builtin_ia32_cvtps2qq128_mask">,
2866 Intrinsic<[llvm_v2i64_ty],
2867 [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
2870 def int_x86_avx512_mask_cvtps2qq_256 :
2871 GCCBuiltin<"__builtin_ia32_cvtps2qq256_mask">,
2872 Intrinsic<[llvm_v4i64_ty],
2873 [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
2876 def int_x86_avx512_mask_cvtps2qq_512 :
2877 GCCBuiltin<"__builtin_ia32_cvtps2qq512_mask">,
2878 Intrinsic<[llvm_v8i64_ty],
2879 [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
2880 [IntrNoMem, ImmArg<3>]>;
2882 def int_x86_avx512_mask_cvtps2udq_128 :
2883 GCCBuiltin<"__builtin_ia32_cvtps2udq128_mask">,
2884 Intrinsic<[llvm_v4i32_ty],
2885 [llvm_v4f32_ty, llvm_v4i32_ty, llvm_i8_ty],
2888 def int_x86_avx512_mask_cvtps2udq_256 :
2889 GCCBuiltin<"__builtin_ia32_cvtps2udq256_mask">,
2890 Intrinsic<[llvm_v8i32_ty],
2891 [llvm_v8f32_ty, llvm_v8i32_ty, llvm_i8_ty],
2894 def int_x86_avx512_mask_cvtps2udq_512 :
2895 GCCBuiltin<"__builtin_ia32_cvtps2udq512_mask">,
2896 Intrinsic<[llvm_v16i32_ty],
2897 [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
2898 [IntrNoMem, ImmArg<3>]>;
2900 def int_x86_avx512_mask_cvtps2uqq_128 :
2901 GCCBuiltin<"__builtin_ia32_cvtps2uqq128_mask">,
2902 Intrinsic<[llvm_v2i64_ty],
2903 [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
2906 def int_x86_avx512_mask_cvtps2uqq_256 :
2907 GCCBuiltin<"__builtin_ia32_cvtps2uqq256_mask">,
2908 Intrinsic<[llvm_v4i64_ty],
2909 [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
2912 def int_x86_avx512_mask_cvtps2uqq_512 :
2913 GCCBuiltin<"__builtin_ia32_cvtps2uqq512_mask">,
2914 Intrinsic<[llvm_v8i64_ty],
2915 [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
2916 [IntrNoMem, ImmArg<3>]>;
2918 def int_x86_avx512_mask_cvtqq2ps_128 :
2919 GCCBuiltin<"__builtin_ia32_cvtqq2ps128_mask">,
2920 Intrinsic<[llvm_v4f32_ty],
2921 [llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
2924 def int_x86_avx512_mask_cvttpd2dq_128 :
2925 GCCBuiltin<"__builtin_ia32_cvttpd2dq128_mask">,
2926 Intrinsic<[llvm_v4i32_ty],
2927 [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
2930 def int_x86_avx512_mask_cvttpd2dq_512 :
2931 GCCBuiltin<"__builtin_ia32_cvttpd2dq512_mask">,
2932 Intrinsic<[llvm_v8i32_ty],
2933 [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
2934 [IntrNoMem, ImmArg<3>]>;
2936 def int_x86_avx512_mask_cvttpd2qq_128 :
2937 GCCBuiltin<"__builtin_ia32_cvttpd2qq128_mask">,
2938 Intrinsic<[llvm_v2i64_ty],
2939 [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
2942 def int_x86_avx512_mask_cvttpd2qq_256 :
2943 GCCBuiltin<"__builtin_ia32_cvttpd2qq256_mask">,
2944 Intrinsic<[llvm_v4i64_ty],
2945 [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
2948 def int_x86_avx512_mask_cvttpd2qq_512 :
2949 GCCBuiltin<"__builtin_ia32_cvttpd2qq512_mask">,
2950 Intrinsic<[llvm_v8i64_ty],
2951 [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
2952 [IntrNoMem, ImmArg<3>]>;
2954 def int_x86_avx512_mask_cvttpd2udq_128 :
2955 GCCBuiltin<"__builtin_ia32_cvttpd2udq128_mask">,
2956 Intrinsic<[llvm_v4i32_ty],
2957 [llvm_v2f64_ty, llvm_v4i32_ty, llvm_i8_ty],
2960 def int_x86_avx512_mask_cvttpd2udq_256 :
2961 GCCBuiltin<"__builtin_ia32_cvttpd2udq256_mask">,
2962 Intrinsic<[llvm_v4i32_ty],
2963 [llvm_v4f64_ty, llvm_v4i32_ty, llvm_i8_ty],
2966 def int_x86_avx512_mask_cvttpd2udq_512 :
2967 GCCBuiltin<"__builtin_ia32_cvttpd2udq512_mask">,
2968 Intrinsic<[llvm_v8i32_ty],
2969 [llvm_v8f64_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
2970 [IntrNoMem, ImmArg<3>]>;
2972 def int_x86_avx512_mask_cvttpd2uqq_128 :
2973 GCCBuiltin<"__builtin_ia32_cvttpd2uqq128_mask">,
2974 Intrinsic<[llvm_v2i64_ty],
2975 [llvm_v2f64_ty, llvm_v2i64_ty, llvm_i8_ty],
2978 def int_x86_avx512_mask_cvttpd2uqq_256 :
2979 GCCBuiltin<"__builtin_ia32_cvttpd2uqq256_mask">,
2980 Intrinsic<[llvm_v4i64_ty],
2981 [llvm_v4f64_ty, llvm_v4i64_ty, llvm_i8_ty],
2984 def int_x86_avx512_mask_cvttpd2uqq_512 :
2985 GCCBuiltin<"__builtin_ia32_cvttpd2uqq512_mask">,
2986 Intrinsic<[llvm_v8i64_ty],
2987 [llvm_v8f64_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
2988 [IntrNoMem, ImmArg<3>]>;
2990 def int_x86_avx512_mask_cvttps2dq_512 :
2991 GCCBuiltin<"__builtin_ia32_cvttps2dq512_mask">,
2992 Intrinsic<[llvm_v16i32_ty],
2993 [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
2994 [IntrNoMem, ImmArg<3>]>;
2996 def int_x86_avx512_mask_cvttps2qq_128 :
2997 GCCBuiltin<"__builtin_ia32_cvttps2qq128_mask">,
2998 Intrinsic<[llvm_v2i64_ty],
2999 [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
3002 def int_x86_avx512_mask_cvttps2qq_256 :
3003 GCCBuiltin<"__builtin_ia32_cvttps2qq256_mask">,
3004 Intrinsic<[llvm_v4i64_ty],
3005 [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
3008 def int_x86_avx512_mask_cvttps2qq_512 :
3009 GCCBuiltin<"__builtin_ia32_cvttps2qq512_mask">,
3010 Intrinsic<[llvm_v8i64_ty],
3011 [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3012 [IntrNoMem, ImmArg<3>]>;
3014 def int_x86_avx512_mask_cvttps2udq_128 :
3015 GCCBuiltin<"__builtin_ia32_cvttps2udq128_mask">,
3016 Intrinsic<[llvm_v4i32_ty],
3017 [llvm_v4f32_ty, llvm_v4i32_ty, llvm_i8_ty],
3020 def int_x86_avx512_mask_cvttps2udq_256 :
3021 GCCBuiltin<"__builtin_ia32_cvttps2udq256_mask">,
3022 Intrinsic<[llvm_v8i32_ty],
3023 [llvm_v8f32_ty, llvm_v8i32_ty, llvm_i8_ty],
3026 def int_x86_avx512_mask_cvttps2udq_512 :
3027 GCCBuiltin<"__builtin_ia32_cvttps2udq512_mask">,
3028 Intrinsic<[llvm_v16i32_ty],
3029 [llvm_v16f32_ty, llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
3030 [IntrNoMem, ImmArg<3>]>;
3032 def int_x86_avx512_mask_cvttps2uqq_128 :
3033 GCCBuiltin<"__builtin_ia32_cvttps2uqq128_mask">,
3034 Intrinsic<[llvm_v2i64_ty],
3035 [llvm_v4f32_ty, llvm_v2i64_ty, llvm_i8_ty],
3038 def int_x86_avx512_mask_cvttps2uqq_256 :
3039 GCCBuiltin<"__builtin_ia32_cvttps2uqq256_mask">,
3040 Intrinsic<[llvm_v4i64_ty],
3041 [llvm_v4f32_ty, llvm_v4i64_ty, llvm_i8_ty],
3044 def int_x86_avx512_mask_cvttps2uqq_512 :
3045 GCCBuiltin<"__builtin_ia32_cvttps2uqq512_mask">,
3046 Intrinsic<[llvm_v8i64_ty],
3047 [llvm_v8f32_ty, llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3048 [IntrNoMem, ImmArg<3>]>;
3050 def int_x86_avx512_mask_cvtuqq2ps_128 :
3051 GCCBuiltin<"__builtin_ia32_cvtuqq2ps128_mask">,
3052 Intrinsic<[llvm_v4f32_ty],
3053 [llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
3056 def int_x86_avx512_mask_rndscale_pd_128 : GCCBuiltin<"__builtin_ia32_rndscalepd_128_mask">,
3057 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_i32_ty,
3058 llvm_v2f64_ty, llvm_i8_ty],
3059 [IntrNoMem, ImmArg<1>]>;
3060 def int_x86_avx512_mask_rndscale_pd_256 : GCCBuiltin<"__builtin_ia32_rndscalepd_256_mask">,
3061 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i32_ty,
3062 llvm_v4f64_ty, llvm_i8_ty],
3063 [IntrNoMem, ImmArg<1>]>;
3064 def int_x86_avx512_mask_rndscale_pd_512 : GCCBuiltin<"__builtin_ia32_rndscalepd_mask">,
3065 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
3066 llvm_i8_ty, llvm_i32_ty],
3067 [IntrNoMem, ImmArg<1>, ImmArg<4>]>;
3068 def int_x86_avx512_mask_rndscale_ps_128 : GCCBuiltin<"__builtin_ia32_rndscaleps_128_mask">,
3069 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_i32_ty,
3070 llvm_v4f32_ty, llvm_i8_ty],
3071 [IntrNoMem, ImmArg<1>]>;
3072 def int_x86_avx512_mask_rndscale_ps_256 : GCCBuiltin<"__builtin_ia32_rndscaleps_256_mask">,
3073 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i32_ty,
3074 llvm_v8f32_ty, llvm_i8_ty],
3075 [IntrNoMem, ImmArg<1>]>;
3076 def int_x86_avx512_mask_rndscale_ps_512 : GCCBuiltin<"__builtin_ia32_rndscaleps_mask">,
3077 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
3078 llvm_i16_ty, llvm_i32_ty],
3079 [IntrNoMem, ImmArg<1>, ImmArg<4>]>;
3080 def int_x86_avx512_mask_reduce_pd_128 : GCCBuiltin<"__builtin_ia32_reducepd128_mask">,
3081 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_i32_ty,
3082 llvm_v2f64_ty, llvm_i8_ty],
3083 [IntrNoMem, ImmArg<1>]>;
3084 def int_x86_avx512_mask_reduce_pd_256 : GCCBuiltin<"__builtin_ia32_reducepd256_mask">,
3085 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i32_ty,
3086 llvm_v4f64_ty, llvm_i8_ty],
3087 [IntrNoMem, ImmArg<1>]>;
3088 def int_x86_avx512_mask_reduce_pd_512 : GCCBuiltin<"__builtin_ia32_reducepd512_mask">,
3089 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
3090 llvm_i8_ty, llvm_i32_ty],
3091 [IntrNoMem, ImmArg<1>, ImmArg<4>]>;
3092 def int_x86_avx512_mask_reduce_ps_128 : GCCBuiltin<"__builtin_ia32_reduceps128_mask">,
3093 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_i32_ty,
3094 llvm_v4f32_ty, llvm_i8_ty],
3095 [IntrNoMem, ImmArg<1>]>;
3096 def int_x86_avx512_mask_reduce_ps_256 : GCCBuiltin<"__builtin_ia32_reduceps256_mask">,
3097 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i32_ty,
3098 llvm_v8f32_ty, llvm_i8_ty],
3099 [IntrNoMem, ImmArg<1>]>;
3100 def int_x86_avx512_mask_reduce_ps_512 : GCCBuiltin<"__builtin_ia32_reduceps512_mask">,
3101 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
3102 llvm_i16_ty, llvm_i32_ty],
3103 [IntrNoMem, ImmArg<1>, ImmArg<4>]>;
3104 def int_x86_avx512_mask_range_pd_128 : GCCBuiltin<"__builtin_ia32_rangepd128_mask">,
3105 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty,
3106 llvm_v2f64_ty, llvm_i8_ty],
3107 [IntrNoMem, ImmArg<2>]>;
3108 def int_x86_avx512_mask_range_pd_256 : GCCBuiltin<"__builtin_ia32_rangepd256_mask">,
3109 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i32_ty,
3110 llvm_v4f64_ty, llvm_i8_ty],
3111 [IntrNoMem, ImmArg<2>]>;
3112 def int_x86_avx512_mask_range_pd_512 : GCCBuiltin<"__builtin_ia32_rangepd512_mask">,
3113 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty,
3114 llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty],
3115 [IntrNoMem, ImmArg<2>, ImmArg<5>]>;
3116 def int_x86_avx512_mask_range_ps_128 : GCCBuiltin<"__builtin_ia32_rangeps128_mask">,
3117 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty,
3118 llvm_v4f32_ty, llvm_i8_ty],
3119 [IntrNoMem, ImmArg<2>]>;
3120 def int_x86_avx512_mask_range_ps_256 : GCCBuiltin<"__builtin_ia32_rangeps256_mask">,
3121 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i32_ty,
3122 llvm_v8f32_ty, llvm_i8_ty],
3123 [IntrNoMem, ImmArg<2>]>;
3124 def int_x86_avx512_mask_range_ps_512 : GCCBuiltin<"__builtin_ia32_rangeps512_mask">,
3125 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty,
3126 llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty],
3127 [IntrNoMem, ImmArg<2>, ImmArg<5>]>;
3130 // Vector load with broadcast
3131 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
3132 def int_x86_avx512_broadcastmw_512 :
3133 GCCBuiltin<"__builtin_ia32_broadcastmw512">,
3134 Intrinsic<[llvm_v16i32_ty], [llvm_i16_ty], [IntrNoMem]>;
3135 def int_x86_avx512_broadcastmw_256 :
3136 GCCBuiltin<"__builtin_ia32_broadcastmw256">,
3137 Intrinsic<[llvm_v8i32_ty], [llvm_i16_ty], [IntrNoMem]>;
3138 def int_x86_avx512_broadcastmw_128 :
3139 GCCBuiltin<"__builtin_ia32_broadcastmw128">,
3140 Intrinsic<[llvm_v4i32_ty], [llvm_i16_ty], [IntrNoMem]>;
3141 def int_x86_avx512_broadcastmb_512 :
3142 GCCBuiltin<"__builtin_ia32_broadcastmb512">,
3143 Intrinsic<[llvm_v8i64_ty], [llvm_i8_ty], [IntrNoMem]>;
3144 def int_x86_avx512_broadcastmb_256 :
3145 GCCBuiltin<"__builtin_ia32_broadcastmb256">,
3146 Intrinsic<[llvm_v4i64_ty], [llvm_i8_ty], [IntrNoMem]>;
3147 def int_x86_avx512_broadcastmb_128 :
3148 GCCBuiltin<"__builtin_ia32_broadcastmb128">,
3149 Intrinsic<[llvm_v2i64_ty], [llvm_i8_ty], [IntrNoMem]>;
3153 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
3155 def int_x86_avx512_add_ps_512 : GCCBuiltin<"__builtin_ia32_addps512">,
3156 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3157 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3158 def int_x86_avx512_add_pd_512 : GCCBuiltin<"__builtin_ia32_addpd512">,
3159 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3160 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3161 def int_x86_avx512_sub_ps_512 : GCCBuiltin<"__builtin_ia32_subps512">,
3162 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3163 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3164 def int_x86_avx512_sub_pd_512 : GCCBuiltin<"__builtin_ia32_subpd512">,
3165 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3166 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3167 def int_x86_avx512_mul_ps_512 : GCCBuiltin<"__builtin_ia32_mulps512">,
3168 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3169 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3170 def int_x86_avx512_mul_pd_512 : GCCBuiltin<"__builtin_ia32_mulpd512">,
3171 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3172 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3173 def int_x86_avx512_div_ps_512 : GCCBuiltin<"__builtin_ia32_divps512">,
3174 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3175 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3176 def int_x86_avx512_div_pd_512 : GCCBuiltin<"__builtin_ia32_divpd512">,
3177 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3178 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3180 def int_x86_avx512_max_ps_512 : GCCBuiltin<"__builtin_ia32_maxps512">,
3181 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3182 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3183 def int_x86_avx512_max_pd_512 : GCCBuiltin<"__builtin_ia32_maxpd512">,
3184 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3185 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3186 def int_x86_avx512_min_ps_512 : GCCBuiltin<"__builtin_ia32_minps512">,
3187 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3188 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3189 def int_x86_avx512_min_pd_512 : GCCBuiltin<"__builtin_ia32_minpd512">,
3190 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3191 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
3193 def int_x86_avx512_mask_add_ss_round : GCCBuiltin<"__builtin_ia32_addss_round_mask">,
3194 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3195 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3196 def int_x86_avx512_mask_div_ss_round : GCCBuiltin<"__builtin_ia32_divss_round_mask">,
3197 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3198 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3199 def int_x86_avx512_mask_mul_ss_round : GCCBuiltin<"__builtin_ia32_mulss_round_mask">,
3200 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3201 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3202 def int_x86_avx512_mask_sub_ss_round : GCCBuiltin<"__builtin_ia32_subss_round_mask">,
3203 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3204 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3205 def int_x86_avx512_mask_max_ss_round : GCCBuiltin<"__builtin_ia32_maxss_round_mask">,
3206 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3207 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3208 def int_x86_avx512_mask_min_ss_round : GCCBuiltin<"__builtin_ia32_minss_round_mask">,
3209 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3210 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3211 def int_x86_avx512_mask_add_sd_round : GCCBuiltin<"__builtin_ia32_addsd_round_mask">,
3212 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3213 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3214 def int_x86_avx512_mask_div_sd_round : GCCBuiltin<"__builtin_ia32_divsd_round_mask">,
3215 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3216 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3217 def int_x86_avx512_mask_mul_sd_round : GCCBuiltin<"__builtin_ia32_mulsd_round_mask">,
3218 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3219 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3220 def int_x86_avx512_mask_sub_sd_round : GCCBuiltin<"__builtin_ia32_subsd_round_mask">,
3221 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3222 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3223 def int_x86_avx512_mask_max_sd_round : GCCBuiltin<"__builtin_ia32_maxsd_round_mask">,
3224 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3225 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3226 def int_x86_avx512_mask_min_sd_round : GCCBuiltin<"__builtin_ia32_minsd_round_mask">,
3227 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3228 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<4>]>;
3230 def int_x86_avx512_mask_rndscale_ss : GCCBuiltin<"__builtin_ia32_rndscaless_round_mask">,
3231 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3232 llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3233 [IntrNoMem, ImmArg<4>, ImmArg<5>]>;
3234 def int_x86_avx512_mask_rndscale_sd : GCCBuiltin<"__builtin_ia32_rndscalesd_round_mask">,
3235 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3236 llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3237 [IntrNoMem, ImmArg<4>, ImmArg<5>]>;
3238 def int_x86_avx512_mask_range_ss : GCCBuiltin<"__builtin_ia32_rangess128_round_mask">,
3239 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3240 llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3241 [IntrNoMem, ImmArg<4>, ImmArg<5>]>;
3242 def int_x86_avx512_mask_range_sd : GCCBuiltin<"__builtin_ia32_rangesd128_round_mask">,
3243 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3244 llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3245 [IntrNoMem, ImmArg<4>, ImmArg<5>]>;
3246 def int_x86_avx512_mask_reduce_ss : GCCBuiltin<"__builtin_ia32_reducess_mask">,
3247 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3248 llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3249 [IntrNoMem, ImmArg<4>, ImmArg<5>]>;
3250 def int_x86_avx512_mask_reduce_sd : GCCBuiltin<"__builtin_ia32_reducesd_mask">,
3251 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3252 llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
3253 [IntrNoMem, ImmArg<4>, ImmArg<5>]>;
3254 def int_x86_avx512_mask_scalef_sd : GCCBuiltin<"__builtin_ia32_scalefsd_round_mask">,
3255 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3256 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
3257 [IntrNoMem, ImmArg<4>]>;
3258 def int_x86_avx512_mask_scalef_ss : GCCBuiltin<"__builtin_ia32_scalefss_round_mask">,
3259 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3260 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
3261 [IntrNoMem, ImmArg<4>]>;
3262 def int_x86_avx512_mask_scalef_pd_128 : GCCBuiltin<"__builtin_ia32_scalefpd128_mask">,
3263 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3264 llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
3265 def int_x86_avx512_mask_scalef_pd_256 : GCCBuiltin<"__builtin_ia32_scalefpd256_mask">,
3266 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
3267 llvm_v4f64_ty, llvm_i8_ty],[IntrNoMem]>;
3268 def int_x86_avx512_mask_scalef_pd_512 : GCCBuiltin<"__builtin_ia32_scalefpd512_mask">,
3269 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3270 llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty],
3271 [IntrNoMem, ImmArg<4>]>;
3272 def int_x86_avx512_mask_scalef_ps_128 : GCCBuiltin<"__builtin_ia32_scalefps128_mask">,
3273 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3274 llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
3275 def int_x86_avx512_mask_scalef_ps_256 : GCCBuiltin<"__builtin_ia32_scalefps256_mask">,
3276 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
3277 llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
3278 def int_x86_avx512_mask_scalef_ps_512 : GCCBuiltin<"__builtin_ia32_scalefps512_mask">,
3279 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3280 llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty],
3281 [IntrNoMem, ImmArg<4>]>;
3283 def int_x86_avx512_mask_sqrt_ss :
3284 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3285 llvm_i8_ty, llvm_i32_ty],
3286 [IntrNoMem, ImmArg<4>]>;
3287 def int_x86_avx512_mask_sqrt_sd :
3288 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3289 llvm_i8_ty, llvm_i32_ty],
3290 [IntrNoMem, ImmArg<4>]>;
3292 def int_x86_avx512_sqrt_pd_512 :
3293 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i32_ty],
3294 [IntrNoMem, ImmArg<1>]>;
3295 def int_x86_avx512_sqrt_ps_512 :
3296 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i32_ty],
3297 [IntrNoMem, ImmArg<1>]>;
3298 def int_x86_avx512_mask_fixupimm_pd_128 :
3299 GCCBuiltin<"__builtin_ia32_fixupimmpd128_mask">,
3300 Intrinsic<[llvm_v2f64_ty],
3301 [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
3302 [IntrNoMem, ImmArg<3>]>;
3303 def int_x86_avx512_maskz_fixupimm_pd_128 :
3304 GCCBuiltin<"__builtin_ia32_fixupimmpd128_maskz">,
3305 Intrinsic<[llvm_v2f64_ty],
3306 [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
3307 [IntrNoMem, ImmArg<3>]>;
3308 def int_x86_avx512_mask_fixupimm_pd_256 :
3309 GCCBuiltin<"__builtin_ia32_fixupimmpd256_mask">,
3310 Intrinsic<[llvm_v4f64_ty],
3311 [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
3312 [IntrNoMem, ImmArg<3>]>;
3313 def int_x86_avx512_maskz_fixupimm_pd_256 :
3314 GCCBuiltin<"__builtin_ia32_fixupimmpd256_maskz">,
3315 Intrinsic<[llvm_v4f64_ty],
3316 [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
3317 [IntrNoMem, ImmArg<3>]>;
3318 def int_x86_avx512_mask_fixupimm_pd_512 :
3319 GCCBuiltin<"__builtin_ia32_fixupimmpd512_mask">,
3320 Intrinsic<[llvm_v8f64_ty],
3321 [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
3322 llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3323 def int_x86_avx512_maskz_fixupimm_pd_512 :
3324 GCCBuiltin<"__builtin_ia32_fixupimmpd512_maskz">,
3325 Intrinsic<[llvm_v8f64_ty],
3326 [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
3327 llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3328 def int_x86_avx512_mask_fixupimm_ps_128 :
3329 GCCBuiltin<"__builtin_ia32_fixupimmps128_mask">,
3330 Intrinsic<[llvm_v4f32_ty],
3331 [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
3332 [IntrNoMem, ImmArg<3>]>;
3333 def int_x86_avx512_maskz_fixupimm_ps_128 :
3334 GCCBuiltin<"__builtin_ia32_fixupimmps128_maskz">,
3335 Intrinsic<[llvm_v4f32_ty],
3336 [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
3337 [IntrNoMem, ImmArg<3>]>;
3338 def int_x86_avx512_mask_fixupimm_ps_256 :
3339 GCCBuiltin<"__builtin_ia32_fixupimmps256_mask">,
3340 Intrinsic<[llvm_v8f32_ty],
3341 [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
3342 [IntrNoMem, ImmArg<3>]>;
3343 def int_x86_avx512_maskz_fixupimm_ps_256 :
3344 GCCBuiltin<"__builtin_ia32_fixupimmps256_maskz">,
3345 Intrinsic<[llvm_v8f32_ty],
3346 [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
3347 [IntrNoMem, ImmArg<3>]>;
3348 def int_x86_avx512_mask_fixupimm_ps_512 :
3349 GCCBuiltin<"__builtin_ia32_fixupimmps512_mask">,
3350 Intrinsic<[llvm_v16f32_ty],
3351 [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
3352 llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3353 def int_x86_avx512_maskz_fixupimm_ps_512 :
3354 GCCBuiltin<"__builtin_ia32_fixupimmps512_maskz">,
3355 Intrinsic<[llvm_v16f32_ty],
3356 [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
3357 llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3358 def int_x86_avx512_mask_fixupimm_sd :
3359 GCCBuiltin<"__builtin_ia32_fixupimmsd_mask">,
3360 Intrinsic<[llvm_v2f64_ty],
3361 [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
3362 llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3363 def int_x86_avx512_maskz_fixupimm_sd :
3364 GCCBuiltin<"__builtin_ia32_fixupimmsd_maskz">,
3365 Intrinsic<[llvm_v2f64_ty],
3366 [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
3367 llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3368 def int_x86_avx512_mask_fixupimm_ss :
3369 GCCBuiltin<"__builtin_ia32_fixupimmss_mask">,
3370 Intrinsic<[llvm_v4f32_ty],
3371 [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
3372 llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3373 def int_x86_avx512_maskz_fixupimm_ss :
3374 GCCBuiltin<"__builtin_ia32_fixupimmss_maskz">,
3375 Intrinsic<[llvm_v4f32_ty],
3376 [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
3377 llvm_i32_ty], [IntrNoMem, ImmArg<3>, ImmArg<5>]>;
3378 def int_x86_avx512_mask_getexp_pd_128 : GCCBuiltin<"__builtin_ia32_getexppd128_mask">,
3379 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3380 llvm_i8_ty], [IntrNoMem]>;
3381 def int_x86_avx512_mask_getexp_pd_256 : GCCBuiltin<"__builtin_ia32_getexppd256_mask">,
3382 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
3383 llvm_i8_ty], [IntrNoMem]>;
3384 def int_x86_avx512_mask_getexp_pd_512 : GCCBuiltin<"__builtin_ia32_getexppd512_mask">,
3385 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3386 llvm_i8_ty, llvm_i32_ty],
3387 [IntrNoMem, ImmArg<3>]>;
3388 def int_x86_avx512_mask_getexp_ps_128 : GCCBuiltin<"__builtin_ia32_getexpps128_mask">,
3389 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3390 llvm_i8_ty], [IntrNoMem]>;
3391 def int_x86_avx512_mask_getexp_ps_256 : GCCBuiltin<"__builtin_ia32_getexpps256_mask">,
3392 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
3393 llvm_i8_ty], [IntrNoMem]>;
3394 def int_x86_avx512_mask_getexp_ps_512 : GCCBuiltin<"__builtin_ia32_getexpps512_mask">,
3395 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3396 llvm_i16_ty, llvm_i32_ty],
3397 [IntrNoMem, ImmArg<3>]>;
3399 def int_x86_avx512_mask_getexp_ss : GCCBuiltin<"__builtin_ia32_getexpss128_round_mask">,
3400 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3401 llvm_i8_ty, llvm_i32_ty],
3402 [IntrNoMem, ImmArg<4>]>;
3403 def int_x86_avx512_mask_getexp_sd : GCCBuiltin<"__builtin_ia32_getexpsd128_round_mask">,
3404 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3405 llvm_i8_ty, llvm_i32_ty],
3406 [IntrNoMem, ImmArg<4>]>;
3408 def int_x86_avx512_mask_getmant_pd_128 :
3409 GCCBuiltin<"__builtin_ia32_getmantpd128_mask">,
3410 Intrinsic<[llvm_v2f64_ty],
3411 [llvm_v2f64_ty,llvm_i32_ty, llvm_v2f64_ty, llvm_i8_ty],
3412 [IntrNoMem, ImmArg<1>]>;
3414 def int_x86_avx512_mask_getmant_pd_256 :
3415 GCCBuiltin<"__builtin_ia32_getmantpd256_mask">,
3416 Intrinsic<[llvm_v4f64_ty],
3417 [llvm_v4f64_ty,llvm_i32_ty, llvm_v4f64_ty, llvm_i8_ty],
3418 [IntrNoMem, ImmArg<1>]>;
3420 def int_x86_avx512_mask_getmant_pd_512 :
3421 GCCBuiltin<"__builtin_ia32_getmantpd512_mask">,
3422 Intrinsic<[llvm_v8f64_ty],
3423 [llvm_v8f64_ty,llvm_i32_ty, llvm_v8f64_ty, llvm_i8_ty,llvm_i32_ty ],
3424 [IntrNoMem, ImmArg<1>, ImmArg<4>]>;
3426 def int_x86_avx512_mask_getmant_ps_128 :
3427 GCCBuiltin<"__builtin_ia32_getmantps128_mask">,
3428 Intrinsic<[llvm_v4f32_ty],
3429 [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty, llvm_i8_ty],
3430 [IntrNoMem, ImmArg<1>]>;
3432 def int_x86_avx512_mask_getmant_ps_256 :
3433 GCCBuiltin<"__builtin_ia32_getmantps256_mask">,
3434 Intrinsic<[llvm_v8f32_ty],
3435 [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty, llvm_i8_ty],
3436 [IntrNoMem, ImmArg<1>]>;
3438 def int_x86_avx512_mask_getmant_ps_512 :
3439 GCCBuiltin<"__builtin_ia32_getmantps512_mask">,
3440 Intrinsic<[llvm_v16f32_ty],
3441 [llvm_v16f32_ty,llvm_i32_ty, llvm_v16f32_ty,llvm_i16_ty,llvm_i32_ty],
3442 [IntrNoMem, ImmArg<1>, ImmArg<4>]>;
3444 def int_x86_avx512_mask_getmant_ss :
3445 GCCBuiltin<"__builtin_ia32_getmantss_round_mask">,
3446 Intrinsic<[llvm_v4f32_ty],
3447 [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
3448 llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>, ImmArg<5>]>;
3450 def int_x86_avx512_mask_getmant_sd :
3451 GCCBuiltin<"__builtin_ia32_getmantsd_round_mask">,
3452 Intrinsic<[llvm_v2f64_ty],
3453 [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
3454 llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<2>, ImmArg<5>]>;
3456 def int_x86_avx512_rsqrt14_ss : GCCBuiltin<"__builtin_ia32_rsqrt14ss_mask">,
3457 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3458 llvm_i8_ty], [IntrNoMem]>;
3459 def int_x86_avx512_rsqrt14_sd : GCCBuiltin<"__builtin_ia32_rsqrt14sd_mask">,
3460 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3461 llvm_i8_ty], [IntrNoMem]>;
3463 def int_x86_avx512_rsqrt14_pd_128 : GCCBuiltin<"__builtin_ia32_rsqrt14pd128_mask">,
3464 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3465 llvm_i8_ty], [IntrNoMem]>;
3466 def int_x86_avx512_rsqrt14_pd_256 : GCCBuiltin<"__builtin_ia32_rsqrt14pd256_mask">,
3467 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
3468 llvm_i8_ty], [IntrNoMem]>;
3469 def int_x86_avx512_rsqrt14_pd_512 : GCCBuiltin<"__builtin_ia32_rsqrt14pd512_mask">,
3470 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3471 llvm_i8_ty], [IntrNoMem]>;
3472 def int_x86_avx512_rsqrt14_ps_128 : GCCBuiltin<"__builtin_ia32_rsqrt14ps128_mask">,
3473 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3474 llvm_i8_ty], [IntrNoMem]>;
3475 def int_x86_avx512_rsqrt14_ps_256 : GCCBuiltin<"__builtin_ia32_rsqrt14ps256_mask">,
3476 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
3477 llvm_i8_ty], [IntrNoMem]>;
3478 def int_x86_avx512_rsqrt14_ps_512 : GCCBuiltin<"__builtin_ia32_rsqrt14ps512_mask">,
3479 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3480 llvm_i16_ty], [IntrNoMem]>;
3481 def int_x86_avx512_rcp14_ss : GCCBuiltin<"__builtin_ia32_rcp14ss_mask">,
3482 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
3483 llvm_i8_ty], [IntrNoMem]>;
3484 def int_x86_avx512_rcp14_sd : GCCBuiltin<"__builtin_ia32_rcp14sd_mask">,
3485 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
3486 llvm_i8_ty], [IntrNoMem]>;
3488 def int_x86_avx512_rcp14_pd_128 : GCCBuiltin<"__builtin_ia32_rcp14pd128_mask">,
3489 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3490 llvm_i8_ty], [IntrNoMem]>;
3491 def int_x86_avx512_rcp14_pd_256 : GCCBuiltin<"__builtin_ia32_rcp14pd256_mask">,
3492 Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
3493 llvm_i8_ty], [IntrNoMem]>;
3494 def int_x86_avx512_rcp14_pd_512 : GCCBuiltin<"__builtin_ia32_rcp14pd512_mask">,
3495 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3496 llvm_i8_ty], [IntrNoMem]>;
3497 def int_x86_avx512_rcp14_ps_128 : GCCBuiltin<"__builtin_ia32_rcp14ps128_mask">,
3498 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3499 llvm_i8_ty], [IntrNoMem]>;
3500 def int_x86_avx512_rcp14_ps_256 : GCCBuiltin<"__builtin_ia32_rcp14ps256_mask">,
3501 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
3502 llvm_i8_ty], [IntrNoMem]>;
3503 def int_x86_avx512_rcp14_ps_512 : GCCBuiltin<"__builtin_ia32_rcp14ps512_mask">,
3504 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3505 llvm_i16_ty], [IntrNoMem]>;
3507 def int_x86_avx512_rcp28_ps : GCCBuiltin<"__builtin_ia32_rcp28ps_mask">,
3508 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3509 llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<3>]>;
3510 def int_x86_avx512_rcp28_pd : GCCBuiltin<"__builtin_ia32_rcp28pd_mask">,
3511 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3512 llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<3>]>;
3513 def int_x86_avx512_exp2_ps : GCCBuiltin<"__builtin_ia32_exp2ps_mask">,
3514 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3515 llvm_i16_ty, llvm_i32_ty], [IntrNoMem, ImmArg<3>]>;
3516 def int_x86_avx512_exp2_pd : GCCBuiltin<"__builtin_ia32_exp2pd_mask">,
3517 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3518 llvm_i8_ty, llvm_i32_ty], [IntrNoMem, ImmArg<3>]>;
3520 def int_x86_avx512_rcp28_ss : GCCBuiltin<"__builtin_ia32_rcp28ss_round_mask">,
3521 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3522 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
3523 [IntrNoMem, ImmArg<4>]>;
3524 def int_x86_avx512_rcp28_sd : GCCBuiltin<"__builtin_ia32_rcp28sd_round_mask">,
3525 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3526 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
3527 [IntrNoMem, ImmArg<4>]>;
3528 def int_x86_avx512_rsqrt28_ps : GCCBuiltin<"__builtin_ia32_rsqrt28ps_mask">,
3529 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
3530 llvm_i16_ty, llvm_i32_ty],
3531 [IntrNoMem, ImmArg<3>]>;
3532 def int_x86_avx512_rsqrt28_pd : GCCBuiltin<"__builtin_ia32_rsqrt28pd_mask">,
3533 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
3534 llvm_i8_ty, llvm_i32_ty],
3535 [IntrNoMem, ImmArg<3>]>;
3536 def int_x86_avx512_rsqrt28_ss : GCCBuiltin<"__builtin_ia32_rsqrt28ss_round_mask">,
3537 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
3538 llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
3539 [IntrNoMem, ImmArg<4>]>;
3540 def int_x86_avx512_rsqrt28_sd : GCCBuiltin<"__builtin_ia32_rsqrt28sd_round_mask">,
3541 Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
3542 llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
3543 [IntrNoMem, ImmArg<4>]>;
3544 def int_x86_avx512_psad_bw_512 : GCCBuiltin<"__builtin_ia32_psadbw512">,
3545 Intrinsic<[llvm_v8i64_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
3546 [IntrNoMem, Commutative]>;
3548 // Integer arithmetic ops
3549 let TargetPrefix = "x86" in {
3550 def int_x86_avx512_pmulhu_w_512 : GCCBuiltin<"__builtin_ia32_pmulhuw512">,
3551 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
3552 llvm_v32i16_ty], [IntrNoMem, Commutative]>;
3553 def int_x86_avx512_pmulh_w_512 : GCCBuiltin<"__builtin_ia32_pmulhw512">,
3554 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
3555 llvm_v32i16_ty], [IntrNoMem, Commutative]>;
3556 def int_x86_avx512_pavg_b_512 : GCCBuiltin<"__builtin_ia32_pavgb512">,
3557 Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
3559 def int_x86_avx512_pavg_w_512 : GCCBuiltin<"__builtin_ia32_pavgw512">,
3560 Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
3562 def int_x86_avx512_pmaddw_d_512 : GCCBuiltin<"__builtin_ia32_pmaddwd512">,
3563 Intrinsic<[llvm_v16i32_ty], [llvm_v32i16_ty,
3564 llvm_v32i16_ty], [IntrNoMem, Commutative]>;
3565 def int_x86_avx512_pmaddubs_w_512 : GCCBuiltin<"__builtin_ia32_pmaddubsw512">,
3566 Intrinsic<[llvm_v32i16_ty], [llvm_v64i8_ty,
3567 llvm_v64i8_ty], [IntrNoMem]>;
3569 def int_x86_avx512_dbpsadbw_128 :
3570 GCCBuiltin<"__builtin_ia32_dbpsadbw128">,
3571 Intrinsic<[llvm_v8i16_ty],
3572 [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
3573 [IntrNoMem, ImmArg<2>]>;
3575 def int_x86_avx512_dbpsadbw_256 :
3576 GCCBuiltin<"__builtin_ia32_dbpsadbw256">,
3577 Intrinsic<[llvm_v16i16_ty],
3578 [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty],
3579 [IntrNoMem, ImmArg<2>]>;
3581 def int_x86_avx512_dbpsadbw_512 :
3582 GCCBuiltin<"__builtin_ia32_dbpsadbw512">,
3583 Intrinsic<[llvm_v32i16_ty],
3584 [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i32_ty],
3585 [IntrNoMem, ImmArg<2>]>;
3588 // Gather and Scatter ops
3589 let TargetPrefix = "x86" in {
3590 // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
3591 // NOTE: These can't be ArgMemOnly because you can put the address completely
3592 // in the index register.
3593 def int_x86_avx512_gather_dpd_512 :
3594 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
3595 llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3596 [IntrReadMem, ImmArg<4>]>;
3597 def int_x86_avx512_gather_dps_512 :
3598 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
3599 llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
3600 [IntrReadMem, ImmArg<4>]>;
3601 def int_x86_avx512_gather_qpd_512 :
3602 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
3603 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3604 [IntrReadMem, ImmArg<4>]>;
3605 def int_x86_avx512_gather_qps_512 :
3606 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
3607 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3608 [IntrReadMem, ImmArg<4>]>;
3611 def int_x86_avx512_gather_dpq_512 :
3612 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
3613 llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3614 [IntrReadMem, ImmArg<4>]>;
3615 def int_x86_avx512_gather_dpi_512 :
3616 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
3617 llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
3618 [IntrReadMem, ImmArg<4>]>;
3619 def int_x86_avx512_gather_qpq_512 :
3620 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
3621 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3622 [IntrReadMem, ImmArg<4>]>;
3623 def int_x86_avx512_gather_qpi_512 :
3624 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
3625 llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
3626 [IntrReadMem, ImmArg<4>]>;
3628 def int_x86_avx512_gather3div2_df :
3629 Intrinsic<[llvm_v2f64_ty],
3630 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3631 [IntrReadMem, ImmArg<4>]>;
3633 def int_x86_avx512_gather3div2_di :
3634 Intrinsic<[llvm_v2i64_ty],
3635 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3636 [IntrReadMem, ImmArg<4>]>;
3638 def int_x86_avx512_gather3div4_df :
3639 Intrinsic<[llvm_v4f64_ty],
3640 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3641 [IntrReadMem, ImmArg<4>]>;
3643 def int_x86_avx512_gather3div4_di :
3644 Intrinsic<[llvm_v4i64_ty],
3645 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3646 [IntrReadMem, ImmArg<4>]>;
3648 def int_x86_avx512_gather3div4_sf :
3649 Intrinsic<[llvm_v4f32_ty],
3650 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3651 [IntrReadMem, ImmArg<4>]>;
3653 def int_x86_avx512_gather3div4_si :
3654 Intrinsic<[llvm_v4i32_ty],
3655 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
3656 [IntrReadMem, ImmArg<4>]>;
3658 def int_x86_avx512_gather3div8_sf :
3659 Intrinsic<[llvm_v4f32_ty],
3660 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3661 [IntrReadMem, ImmArg<4>]>;
3663 def int_x86_avx512_gather3div8_si :
3664 Intrinsic<[llvm_v4i32_ty],
3665 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
3666 [IntrReadMem, ImmArg<4>]>;
3668 def int_x86_avx512_gather3siv2_df :
3669 Intrinsic<[llvm_v2f64_ty],
3670 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3671 [IntrReadMem, ImmArg<4>]>;
3673 def int_x86_avx512_gather3siv2_di :
3674 Intrinsic<[llvm_v2i64_ty],
3675 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3676 [IntrReadMem, ImmArg<4>]>;
3678 def int_x86_avx512_gather3siv4_df :
3679 Intrinsic<[llvm_v4f64_ty],
3680 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3681 [IntrReadMem, ImmArg<4>]>;
3683 def int_x86_avx512_gather3siv4_di :
3684 Intrinsic<[llvm_v4i64_ty],
3685 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3686 [IntrReadMem, ImmArg<4>]>;
3688 def int_x86_avx512_gather3siv4_sf :
3689 Intrinsic<[llvm_v4f32_ty],
3690 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3691 [IntrReadMem, ImmArg<4>]>;
3693 def int_x86_avx512_gather3siv4_si :
3694 Intrinsic<[llvm_v4i32_ty],
3695 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
3696 [IntrReadMem, ImmArg<4>]>;
3698 def int_x86_avx512_gather3siv8_sf :
3699 Intrinsic<[llvm_v8f32_ty],
3700 [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3701 [IntrReadMem, ImmArg<4>]>;
3703 def int_x86_avx512_gather3siv8_si :
3704 Intrinsic<[llvm_v8i32_ty],
3705 [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
3706 [IntrReadMem, ImmArg<4>]>;
3709 // NOTE: These are deprecated in favor of the versions that take a vXi1 mask.
3710 // NOTE: These can't be ArgMemOnly because you can put the address completely
3711 // in the index register.
3712 def int_x86_avx512_scatter_dpd_512 :
3713 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
3714 llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
3716 def int_x86_avx512_scatter_dps_512 :
3717 Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
3718 llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
3720 def int_x86_avx512_scatter_qpd_512 :
3721 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
3722 llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
3724 def int_x86_avx512_scatter_qps_512 :
3725 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
3726 llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
3730 def int_x86_avx512_scatter_dpq_512 :
3731 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
3732 llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
3734 def int_x86_avx512_scatter_dpi_512 :
3735 Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
3736 llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
3738 def int_x86_avx512_scatter_qpq_512 :
3739 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,llvm_v8i64_ty, llvm_v8i64_ty,
3742 def int_x86_avx512_scatter_qpi_512 :
3743 Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_v8i32_ty,
3747 def int_x86_avx512_scatterdiv2_df :
3749 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
3752 def int_x86_avx512_scatterdiv2_di :
3754 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
3757 def int_x86_avx512_scatterdiv4_df :
3759 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
3762 def int_x86_avx512_scatterdiv4_di :
3764 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
3767 def int_x86_avx512_scatterdiv4_sf :
3769 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
3772 def int_x86_avx512_scatterdiv4_si :
3774 [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
3777 def int_x86_avx512_scatterdiv8_sf :
3779 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
3782 def int_x86_avx512_scatterdiv8_si :
3784 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
3787 def int_x86_avx512_scattersiv2_df :
3789 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
3792 def int_x86_avx512_scattersiv2_di :
3794 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
3797 def int_x86_avx512_scattersiv4_df :
3799 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
3802 def int_x86_avx512_scattersiv4_di :
3804 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
3807 def int_x86_avx512_scattersiv4_sf :
3809 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
3812 def int_x86_avx512_scattersiv4_si :
3814 [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
3817 def int_x86_avx512_scattersiv8_sf :
3819 [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
3822 def int_x86_avx512_scattersiv8_si :
3824 [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
3828 // NOTE: These can't be ArgMemOnly because you can put the address completely
3829 // in the index register.
3830 def int_x86_avx512_gatherpf_dpd_512 : GCCBuiltin<"__builtin_ia32_gatherpfdpd">,
3831 Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
3832 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3833 def int_x86_avx512_gatherpf_dps_512 : GCCBuiltin<"__builtin_ia32_gatherpfdps">,
3834 Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
3835 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3836 def int_x86_avx512_gatherpf_qpd_512 : GCCBuiltin<"__builtin_ia32_gatherpfqpd">,
3837 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3838 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3839 def int_x86_avx512_gatherpf_qps_512 : GCCBuiltin<"__builtin_ia32_gatherpfqps">,
3840 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3841 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3844 // NOTE: These can't be ArgMemOnly because you can put the address completely
3845 // in the index register.
3846 def int_x86_avx512_scatterpf_dpd_512 : GCCBuiltin<"__builtin_ia32_scatterpfdpd">,
3847 Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
3848 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3849 def int_x86_avx512_scatterpf_dps_512 : GCCBuiltin<"__builtin_ia32_scatterpfdps">,
3850 Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
3851 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3852 def int_x86_avx512_scatterpf_qpd_512 : GCCBuiltin<"__builtin_ia32_scatterpfqpd">,
3853 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3854 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3855 def int_x86_avx512_scatterpf_qps_512 : GCCBuiltin<"__builtin_ia32_scatterpfqps">,
3856 Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
3857 llvm_i32_ty, llvm_i32_ty], [ImmArg<3>, ImmArg<4>]>;
3860 // AVX512 gather/scatter intrinsics that use vXi1 masks.
3861 let TargetPrefix = "x86" in {
3862 // NOTE: These can't be ArgMemOnly because you can put the address completely
3863 // in the index register.
3864 def int_x86_avx512_mask_gather_dpd_512 :
3865 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
3866 llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3867 [IntrReadMem, ImmArg<4>]>;
3868 def int_x86_avx512_mask_gather_dps_512 :
3869 Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
3870 llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
3871 [IntrReadMem, ImmArg<4>]>;
3872 def int_x86_avx512_mask_gather_qpd_512 :
3873 Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
3874 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3875 [IntrReadMem, ImmArg<4>]>;
3876 def int_x86_avx512_mask_gather_qps_512 :
3877 Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
3878 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3879 [IntrReadMem, ImmArg<4>]>;
3882 def int_x86_avx512_mask_gather_dpq_512 :
3883 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
3884 llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3885 [IntrReadMem, ImmArg<4>]>;
3886 def int_x86_avx512_mask_gather_dpi_512 :
3887 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
3888 llvm_v16i32_ty, llvm_v16i1_ty, llvm_i32_ty],
3889 [IntrReadMem, ImmArg<4>]>;
3890 def int_x86_avx512_mask_gather_qpq_512 :
3891 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
3892 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3893 [IntrReadMem, ImmArg<4>]>;
3894 def int_x86_avx512_mask_gather_qpi_512 :
3895 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
3896 llvm_v8i64_ty, llvm_v8i1_ty, llvm_i32_ty],
3897 [IntrReadMem, ImmArg<4>]>;
3899 def int_x86_avx512_mask_gather3div2_df :
3900 Intrinsic<[llvm_v2f64_ty],
3901 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3902 [IntrReadMem, ImmArg<4>]>;
3904 def int_x86_avx512_mask_gather3div2_di :
3905 Intrinsic<[llvm_v2i64_ty],
3906 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3907 [IntrReadMem, ImmArg<4>]>;
3909 def int_x86_avx512_mask_gather3div4_df :
3910 Intrinsic<[llvm_v4f64_ty],
3911 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3912 [IntrReadMem, ImmArg<4>]>;
3914 def int_x86_avx512_mask_gather3div4_di :
3915 Intrinsic<[llvm_v4i64_ty],
3916 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3917 [IntrReadMem, ImmArg<4>]>;
3919 def int_x86_avx512_mask_gather3div4_sf :
3920 Intrinsic<[llvm_v4f32_ty],
3921 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3922 [IntrReadMem, ImmArg<4>]>;
3924 def int_x86_avx512_mask_gather3div4_si :
3925 Intrinsic<[llvm_v4i32_ty],
3926 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i1_ty, llvm_i32_ty],
3927 [IntrReadMem, ImmArg<4>]>;
3929 def int_x86_avx512_mask_gather3div8_sf :
3930 Intrinsic<[llvm_v4f32_ty],
3931 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3932 [IntrReadMem, ImmArg<4>]>;
3934 def int_x86_avx512_mask_gather3div8_si :
3935 Intrinsic<[llvm_v4i32_ty],
3936 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i1_ty, llvm_i32_ty],
3937 [IntrReadMem, ImmArg<4>]>;
3939 def int_x86_avx512_mask_gather3siv2_df :
3940 Intrinsic<[llvm_v2f64_ty],
3941 [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
3942 [IntrReadMem, ImmArg<4>]>;
3944 def int_x86_avx512_mask_gather3siv2_di :
3945 Intrinsic<[llvm_v2i64_ty],
3946 [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i1_ty, llvm_i32_ty],
3947 [IntrReadMem, ImmArg<4>]>;
3949 def int_x86_avx512_mask_gather3siv4_df :
3950 Intrinsic<[llvm_v4f64_ty],
3951 [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3952 [IntrReadMem, ImmArg<4>]>;
3954 def int_x86_avx512_mask_gather3siv4_di :
3955 Intrinsic<[llvm_v4i64_ty],
3956 [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3957 [IntrReadMem, ImmArg<4>]>;
3959 def int_x86_avx512_mask_gather3siv4_sf :
3960 Intrinsic<[llvm_v4f32_ty],
3961 [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3962 [IntrReadMem, ImmArg<4>]>;
3964 def int_x86_avx512_mask_gather3siv4_si :
3965 Intrinsic<[llvm_v4i32_ty],
3966 [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i1_ty, llvm_i32_ty],
3967 [IntrReadMem, ImmArg<4>]>;
3969 def int_x86_avx512_mask_gather3siv8_sf :
3970 Intrinsic<[llvm_v8f32_ty],
3971 [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3972 [IntrReadMem, ImmArg<4>]>;
3974 def int_x86_avx512_mask_gather3siv8_si :
3975 Intrinsic<[llvm_v8i32_ty],
3976 [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i1_ty, llvm_i32_ty],
3977 [IntrReadMem, ImmArg<4>]>;
3979 def int_x86_avx512_mask_scatter_dpd_512 :
3980 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
3981 llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
3983 def int_x86_avx512_mask_scatter_dps_512 :
3984 Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
3985 llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
3987 def int_x86_avx512_mask_scatter_qpd_512 :
3988 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
3989 llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
3991 def int_x86_avx512_mask_scatter_qps_512 :
3992 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
3993 llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
3997 // NOTE: These can't be ArgMemOnly because you can put the address completely
3998 // in the index register.
3999 def int_x86_avx512_mask_scatter_dpq_512 :
4000 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,
4001 llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
4003 def int_x86_avx512_mask_scatter_dpi_512 :
4004 Intrinsic<[], [llvm_ptr_ty, llvm_v16i1_ty,
4005 llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
4007 def int_x86_avx512_mask_scatter_qpq_512 :
4008 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty,llvm_v8i64_ty, llvm_v8i64_ty,
4011 def int_x86_avx512_mask_scatter_qpi_512 :
4012 Intrinsic<[], [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i64_ty, llvm_v8i32_ty,
4016 def int_x86_avx512_mask_scatterdiv2_df :
4018 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
4021 def int_x86_avx512_mask_scatterdiv2_di :
4023 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
4026 def int_x86_avx512_mask_scatterdiv4_df :
4028 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
4031 def int_x86_avx512_mask_scatterdiv4_di :
4033 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
4036 def int_x86_avx512_mask_scatterdiv4_sf :
4038 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
4041 def int_x86_avx512_mask_scatterdiv4_si :
4043 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
4046 def int_x86_avx512_mask_scatterdiv8_sf :
4048 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
4051 def int_x86_avx512_mask_scatterdiv8_si :
4053 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
4056 def int_x86_avx512_mask_scattersiv2_df :
4058 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
4061 def int_x86_avx512_mask_scattersiv2_di :
4063 [llvm_ptr_ty, llvm_v2i1_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
4066 def int_x86_avx512_mask_scattersiv4_df :
4068 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
4071 def int_x86_avx512_mask_scattersiv4_di :
4073 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
4076 def int_x86_avx512_mask_scattersiv4_sf :
4078 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
4081 def int_x86_avx512_mask_scattersiv4_si :
4083 [llvm_ptr_ty, llvm_v4i1_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
4086 def int_x86_avx512_mask_scattersiv8_sf :
4088 [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
4091 def int_x86_avx512_mask_scattersiv8_si :
4093 [llvm_ptr_ty, llvm_v8i1_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
4097 // AVX-512 conflict detection instruction
4098 // Instructions that count the number of leading zero bits
4099 let TargetPrefix = "x86" in {
4100 def int_x86_avx512_conflict_d_128 :
4101 GCCBuiltin<"__builtin_ia32_vpconflictsi_128">,
4102 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
4103 def int_x86_avx512_conflict_d_256 :
4104 GCCBuiltin<"__builtin_ia32_vpconflictsi_256">,
4105 Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty], [IntrNoMem]>;
4106 def int_x86_avx512_conflict_d_512 :
4107 GCCBuiltin<"__builtin_ia32_vpconflictsi_512">,
4108 Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty], [IntrNoMem]>;
4110 def int_x86_avx512_conflict_q_128 :
4111 GCCBuiltin<"__builtin_ia32_vpconflictdi_128">,
4112 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
4113 def int_x86_avx512_conflict_q_256 :
4114 GCCBuiltin<"__builtin_ia32_vpconflictdi_256">,
4115 Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty], [IntrNoMem]>;
4116 def int_x86_avx512_conflict_q_512 :
4117 GCCBuiltin<"__builtin_ia32_vpconflictdi_512">,
4118 Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty], [IntrNoMem]>;
4122 let TargetPrefix = "x86" in {
4124 def int_x86_avx512_vcomi_sd : GCCBuiltin<"__builtin_ia32_vcomisd">,
4125 Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
4126 llvm_v2f64_ty, llvm_i32_ty, llvm_i32_ty],
4127 [IntrNoMem, ImmArg<2>, ImmArg<3>]>;
4128 def int_x86_avx512_vcomi_ss : GCCBuiltin<"__builtin_ia32_vcomiss">,
4129 Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
4130 llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty],
4131 [IntrNoMem, ImmArg<2>, ImmArg<3>]>;
4135 let TargetPrefix = "x86" in {
4136 def int_x86_avx512_mask_compress :
4137 Intrinsic<[llvm_anyvector_ty],
4138 [LLVMMatchType<0>, LLVMMatchType<0>,
4139 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
4141 def int_x86_avx512_mask_expand :
4142 Intrinsic<[llvm_anyvector_ty],
4143 [LLVMMatchType<0>, LLVMMatchType<0>,
4144 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
4149 let TargetPrefix = "x86" in {
4150 def int_x86_avx512_mask_pmov_qb_128 :
4151 GCCBuiltin<"__builtin_ia32_pmovqb128_mask">,
4152 Intrinsic<[llvm_v16i8_ty],
4153 [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4155 def int_x86_avx512_mask_pmov_qb_mem_128 :
4156 GCCBuiltin<"__builtin_ia32_pmovqb128mem_mask">,
4158 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4160 def int_x86_avx512_mask_pmovs_qb_128 :
4161 GCCBuiltin<"__builtin_ia32_pmovsqb128_mask">,
4162 Intrinsic<[llvm_v16i8_ty],
4163 [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4165 def int_x86_avx512_mask_pmovs_qb_mem_128 :
4166 GCCBuiltin<"__builtin_ia32_pmovsqb128mem_mask">,
4168 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4170 def int_x86_avx512_mask_pmovus_qb_128 :
4171 GCCBuiltin<"__builtin_ia32_pmovusqb128_mask">,
4172 Intrinsic<[llvm_v16i8_ty],
4173 [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4175 def int_x86_avx512_mask_pmovus_qb_mem_128 :
4176 GCCBuiltin<"__builtin_ia32_pmovusqb128mem_mask">,
4178 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4180 def int_x86_avx512_mask_pmov_qb_256 :
4181 GCCBuiltin<"__builtin_ia32_pmovqb256_mask">,
4182 Intrinsic<[llvm_v16i8_ty],
4183 [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4185 def int_x86_avx512_mask_pmov_qb_mem_256 :
4186 GCCBuiltin<"__builtin_ia32_pmovqb256mem_mask">,
4188 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4190 def int_x86_avx512_mask_pmovs_qb_256 :
4191 GCCBuiltin<"__builtin_ia32_pmovsqb256_mask">,
4192 Intrinsic<[llvm_v16i8_ty],
4193 [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4195 def int_x86_avx512_mask_pmovs_qb_mem_256 :
4196 GCCBuiltin<"__builtin_ia32_pmovsqb256mem_mask">,
4198 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4200 def int_x86_avx512_mask_pmovus_qb_256 :
4201 GCCBuiltin<"__builtin_ia32_pmovusqb256_mask">,
4202 Intrinsic<[llvm_v16i8_ty],
4203 [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4205 def int_x86_avx512_mask_pmovus_qb_mem_256 :
4206 GCCBuiltin<"__builtin_ia32_pmovusqb256mem_mask">,
4208 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4210 def int_x86_avx512_mask_pmov_qb_512 :
4211 GCCBuiltin<"__builtin_ia32_pmovqb512_mask">,
4212 Intrinsic<[llvm_v16i8_ty],
4213 [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4215 def int_x86_avx512_mask_pmov_qb_mem_512 :
4216 GCCBuiltin<"__builtin_ia32_pmovqb512mem_mask">,
4218 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4220 def int_x86_avx512_mask_pmovs_qb_512 :
4221 GCCBuiltin<"__builtin_ia32_pmovsqb512_mask">,
4222 Intrinsic<[llvm_v16i8_ty],
4223 [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4225 def int_x86_avx512_mask_pmovs_qb_mem_512 :
4226 GCCBuiltin<"__builtin_ia32_pmovsqb512mem_mask">,
4228 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4230 def int_x86_avx512_mask_pmovus_qb_512 :
4231 GCCBuiltin<"__builtin_ia32_pmovusqb512_mask">,
4232 Intrinsic<[llvm_v16i8_ty],
4233 [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
4235 def int_x86_avx512_mask_pmovus_qb_mem_512 :
4236 GCCBuiltin<"__builtin_ia32_pmovusqb512mem_mask">,
4238 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4240 def int_x86_avx512_mask_pmov_qw_128 :
4241 GCCBuiltin<"__builtin_ia32_pmovqw128_mask">,
4242 Intrinsic<[llvm_v8i16_ty],
4243 [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4245 def int_x86_avx512_mask_pmov_qw_mem_128 :
4246 GCCBuiltin<"__builtin_ia32_pmovqw128mem_mask">,
4248 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4250 def int_x86_avx512_mask_pmovs_qw_128 :
4251 GCCBuiltin<"__builtin_ia32_pmovsqw128_mask">,
4252 Intrinsic<[llvm_v8i16_ty],
4253 [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4255 def int_x86_avx512_mask_pmovs_qw_mem_128 :
4256 GCCBuiltin<"__builtin_ia32_pmovsqw128mem_mask">,
4258 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4260 def int_x86_avx512_mask_pmovus_qw_128 :
4261 GCCBuiltin<"__builtin_ia32_pmovusqw128_mask">,
4262 Intrinsic<[llvm_v8i16_ty],
4263 [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4265 def int_x86_avx512_mask_pmovus_qw_mem_128 :
4266 GCCBuiltin<"__builtin_ia32_pmovusqw128mem_mask">,
4268 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4270 def int_x86_avx512_mask_pmov_qw_256 :
4271 GCCBuiltin<"__builtin_ia32_pmovqw256_mask">,
4272 Intrinsic<[llvm_v8i16_ty],
4273 [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4275 def int_x86_avx512_mask_pmov_qw_mem_256 :
4276 GCCBuiltin<"__builtin_ia32_pmovqw256mem_mask">,
4278 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4280 def int_x86_avx512_mask_pmovs_qw_256 :
4281 GCCBuiltin<"__builtin_ia32_pmovsqw256_mask">,
4282 Intrinsic<[llvm_v8i16_ty],
4283 [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4285 def int_x86_avx512_mask_pmovs_qw_mem_256 :
4286 GCCBuiltin<"__builtin_ia32_pmovsqw256mem_mask">,
4288 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4290 def int_x86_avx512_mask_pmovus_qw_256 :
4291 GCCBuiltin<"__builtin_ia32_pmovusqw256_mask">,
4292 Intrinsic<[llvm_v8i16_ty],
4293 [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4295 def int_x86_avx512_mask_pmovus_qw_mem_256 :
4296 GCCBuiltin<"__builtin_ia32_pmovusqw256mem_mask">,
4298 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4300 def int_x86_avx512_mask_pmov_qw_512 :
4301 Intrinsic<[llvm_v8i16_ty],
4302 [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4304 def int_x86_avx512_mask_pmov_qw_mem_512 :
4305 GCCBuiltin<"__builtin_ia32_pmovqw512mem_mask">,
4307 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4309 def int_x86_avx512_mask_pmovs_qw_512 :
4310 GCCBuiltin<"__builtin_ia32_pmovsqw512_mask">,
4311 Intrinsic<[llvm_v8i16_ty],
4312 [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4314 def int_x86_avx512_mask_pmovs_qw_mem_512 :
4315 GCCBuiltin<"__builtin_ia32_pmovsqw512mem_mask">,
4317 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4319 def int_x86_avx512_mask_pmovus_qw_512 :
4320 GCCBuiltin<"__builtin_ia32_pmovusqw512_mask">,
4321 Intrinsic<[llvm_v8i16_ty],
4322 [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
4324 def int_x86_avx512_mask_pmovus_qw_mem_512 :
4325 GCCBuiltin<"__builtin_ia32_pmovusqw512mem_mask">,
4327 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4329 def int_x86_avx512_mask_pmov_qd_128 :
4330 GCCBuiltin<"__builtin_ia32_pmovqd128_mask">,
4331 Intrinsic<[llvm_v4i32_ty],
4332 [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4334 def int_x86_avx512_mask_pmov_qd_mem_128 :
4335 GCCBuiltin<"__builtin_ia32_pmovqd128mem_mask">,
4337 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4339 def int_x86_avx512_mask_pmovs_qd_128 :
4340 GCCBuiltin<"__builtin_ia32_pmovsqd128_mask">,
4341 Intrinsic<[llvm_v4i32_ty],
4342 [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4344 def int_x86_avx512_mask_pmovs_qd_mem_128 :
4345 GCCBuiltin<"__builtin_ia32_pmovsqd128mem_mask">,
4347 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4349 def int_x86_avx512_mask_pmovus_qd_128 :
4350 GCCBuiltin<"__builtin_ia32_pmovusqd128_mask">,
4351 Intrinsic<[llvm_v4i32_ty],
4352 [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4354 def int_x86_avx512_mask_pmovus_qd_mem_128 :
4355 GCCBuiltin<"__builtin_ia32_pmovusqd128mem_mask">,
4357 [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
4359 def int_x86_avx512_mask_pmov_qd_mem_256 :
4360 GCCBuiltin<"__builtin_ia32_pmovqd256mem_mask">,
4362 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4364 def int_x86_avx512_mask_pmovs_qd_256 :
4365 GCCBuiltin<"__builtin_ia32_pmovsqd256_mask">,
4366 Intrinsic<[llvm_v4i32_ty],
4367 [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4369 def int_x86_avx512_mask_pmovs_qd_mem_256 :
4370 GCCBuiltin<"__builtin_ia32_pmovsqd256mem_mask">,
4372 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4374 def int_x86_avx512_mask_pmovus_qd_256 :
4375 GCCBuiltin<"__builtin_ia32_pmovusqd256_mask">,
4376 Intrinsic<[llvm_v4i32_ty],
4377 [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
4379 def int_x86_avx512_mask_pmovus_qd_mem_256 :
4380 GCCBuiltin<"__builtin_ia32_pmovusqd256mem_mask">,
4382 [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
4384 def int_x86_avx512_mask_pmov_qd_mem_512 :
4385 GCCBuiltin<"__builtin_ia32_pmovqd512mem_mask">,
4387 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4389 def int_x86_avx512_mask_pmovs_qd_512 :
4390 GCCBuiltin<"__builtin_ia32_pmovsqd512_mask">,
4391 Intrinsic<[llvm_v8i32_ty],
4392 [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
4394 def int_x86_avx512_mask_pmovs_qd_mem_512 :
4395 GCCBuiltin<"__builtin_ia32_pmovsqd512mem_mask">,
4397 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4399 def int_x86_avx512_mask_pmovus_qd_512 :
4400 GCCBuiltin<"__builtin_ia32_pmovusqd512_mask">,
4401 Intrinsic<[llvm_v8i32_ty],
4402 [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
4404 def int_x86_avx512_mask_pmovus_qd_mem_512 :
4405 GCCBuiltin<"__builtin_ia32_pmovusqd512mem_mask">,
4407 [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
4409 def int_x86_avx512_mask_pmov_db_128 :
4410 GCCBuiltin<"__builtin_ia32_pmovdb128_mask">,
4411 Intrinsic<[llvm_v16i8_ty],
4412 [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4414 def int_x86_avx512_mask_pmov_db_mem_128 :
4415 GCCBuiltin<"__builtin_ia32_pmovdb128mem_mask">,
4417 [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4419 def int_x86_avx512_mask_pmovs_db_128 :
4420 GCCBuiltin<"__builtin_ia32_pmovsdb128_mask">,
4421 Intrinsic<[llvm_v16i8_ty],
4422 [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4424 def int_x86_avx512_mask_pmovs_db_mem_128 :
4425 GCCBuiltin<"__builtin_ia32_pmovsdb128mem_mask">,
4427 [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4429 def int_x86_avx512_mask_pmovus_db_128 :
4430 GCCBuiltin<"__builtin_ia32_pmovusdb128_mask">,
4431 Intrinsic<[llvm_v16i8_ty],
4432 [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4434 def int_x86_avx512_mask_pmovus_db_mem_128 :
4435 GCCBuiltin<"__builtin_ia32_pmovusdb128mem_mask">,
4437 [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4439 def int_x86_avx512_mask_pmov_db_256 :
4440 GCCBuiltin<"__builtin_ia32_pmovdb256_mask">,
4441 Intrinsic<[llvm_v16i8_ty],
4442 [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4444 def int_x86_avx512_mask_pmov_db_mem_256 :
4445 GCCBuiltin<"__builtin_ia32_pmovdb256mem_mask">,
4447 [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4449 def int_x86_avx512_mask_pmovs_db_256 :
4450 GCCBuiltin<"__builtin_ia32_pmovsdb256_mask">,
4451 Intrinsic<[llvm_v16i8_ty],
4452 [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4454 def int_x86_avx512_mask_pmovs_db_mem_256 :
4455 GCCBuiltin<"__builtin_ia32_pmovsdb256mem_mask">,
4457 [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4459 def int_x86_avx512_mask_pmovus_db_256 :
4460 GCCBuiltin<"__builtin_ia32_pmovusdb256_mask">,
4461 Intrinsic<[llvm_v16i8_ty],
4462 [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
4464 def int_x86_avx512_mask_pmovus_db_mem_256 :
4465 GCCBuiltin<"__builtin_ia32_pmovusdb256mem_mask">,
4467 [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4469 def int_x86_avx512_mask_pmov_db_512 :
4470 Intrinsic<[llvm_v16i8_ty],
4471 [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
4473 def int_x86_avx512_mask_pmov_db_mem_512 :
4474 GCCBuiltin<"__builtin_ia32_pmovdb512mem_mask">,
4476 [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4478 def int_x86_avx512_mask_pmovs_db_512 :
4479 GCCBuiltin<"__builtin_ia32_pmovsdb512_mask">,
4480 Intrinsic<[llvm_v16i8_ty],
4481 [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
4483 def int_x86_avx512_mask_pmovs_db_mem_512 :
4484 GCCBuiltin<"__builtin_ia32_pmovsdb512mem_mask">,
4486 [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4488 def int_x86_avx512_mask_pmovus_db_512 :
4489 GCCBuiltin<"__builtin_ia32_pmovusdb512_mask">,
4490 Intrinsic<[llvm_v16i8_ty],
4491 [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
4493 def int_x86_avx512_mask_pmovus_db_mem_512 :
4494 GCCBuiltin<"__builtin_ia32_pmovusdb512mem_mask">,
4496 [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4498 def int_x86_avx512_mask_pmov_dw_128 :
4499 GCCBuiltin<"__builtin_ia32_pmovdw128_mask">,
4500 Intrinsic<[llvm_v8i16_ty],
4501 [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4503 def int_x86_avx512_mask_pmov_dw_mem_128 :
4504 GCCBuiltin<"__builtin_ia32_pmovdw128mem_mask">,
4506 [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4508 def int_x86_avx512_mask_pmovs_dw_128 :
4509 GCCBuiltin<"__builtin_ia32_pmovsdw128_mask">,
4510 Intrinsic<[llvm_v8i16_ty],
4511 [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4513 def int_x86_avx512_mask_pmovs_dw_mem_128 :
4514 GCCBuiltin<"__builtin_ia32_pmovsdw128mem_mask">,
4516 [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4518 def int_x86_avx512_mask_pmovus_dw_128 :
4519 GCCBuiltin<"__builtin_ia32_pmovusdw128_mask">,
4520 Intrinsic<[llvm_v8i16_ty],
4521 [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4523 def int_x86_avx512_mask_pmovus_dw_mem_128 :
4524 GCCBuiltin<"__builtin_ia32_pmovusdw128mem_mask">,
4526 [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
4528 def int_x86_avx512_mask_pmov_dw_256 :
4529 GCCBuiltin<"__builtin_ia32_pmovdw256_mask">,
4530 Intrinsic<[llvm_v8i16_ty],
4531 [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4533 def int_x86_avx512_mask_pmov_dw_mem_256 :
4534 GCCBuiltin<"__builtin_ia32_pmovdw256mem_mask">,
4536 [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4538 def int_x86_avx512_mask_pmovs_dw_256 :
4539 GCCBuiltin<"__builtin_ia32_pmovsdw256_mask">,
4540 Intrinsic<[llvm_v8i16_ty],
4541 [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4543 def int_x86_avx512_mask_pmovs_dw_mem_256 :
4544 GCCBuiltin<"__builtin_ia32_pmovsdw256mem_mask">,
4546 [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4548 def int_x86_avx512_mask_pmovus_dw_256 :
4549 GCCBuiltin<"__builtin_ia32_pmovusdw256_mask">,
4550 Intrinsic<[llvm_v8i16_ty],
4551 [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
4553 def int_x86_avx512_mask_pmovus_dw_mem_256 :
4554 GCCBuiltin<"__builtin_ia32_pmovusdw256mem_mask">,
4556 [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
4558 def int_x86_avx512_mask_pmov_dw_512 :
4559 Intrinsic<[llvm_v16i16_ty],
4560 [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
4562 def int_x86_avx512_mask_pmov_dw_mem_512 :
4563 GCCBuiltin<"__builtin_ia32_pmovdw512mem_mask">,
4565 [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4567 def int_x86_avx512_mask_pmovs_dw_512 :
4568 GCCBuiltin<"__builtin_ia32_pmovsdw512_mask">,
4569 Intrinsic<[llvm_v16i16_ty],
4570 [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
4572 def int_x86_avx512_mask_pmovs_dw_mem_512 :
4573 GCCBuiltin<"__builtin_ia32_pmovsdw512mem_mask">,
4575 [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4577 def int_x86_avx512_mask_pmovus_dw_512 :
4578 GCCBuiltin<"__builtin_ia32_pmovusdw512_mask">,
4579 Intrinsic<[llvm_v16i16_ty],
4580 [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
4582 def int_x86_avx512_mask_pmovus_dw_mem_512 :
4583 GCCBuiltin<"__builtin_ia32_pmovusdw512mem_mask">,
4585 [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
4587 def int_x86_avx512_mask_pmov_wb_128 :
4588 GCCBuiltin<"__builtin_ia32_pmovwb128_mask">,
4589 Intrinsic<[llvm_v16i8_ty],
4590 [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
4592 def int_x86_avx512_mask_pmov_wb_mem_128 :
4593 GCCBuiltin<"__builtin_ia32_pmovwb128mem_mask">,
4595 [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
4597 def int_x86_avx512_mask_pmovs_wb_128 :
4598 GCCBuiltin<"__builtin_ia32_pmovswb128_mask">,
4599 Intrinsic<[llvm_v16i8_ty],
4600 [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
4602 def int_x86_avx512_mask_pmovs_wb_mem_128 :
4603 GCCBuiltin<"__builtin_ia32_pmovswb128mem_mask">,
4605 [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
4607 def int_x86_avx512_mask_pmovus_wb_128 :
4608 GCCBuiltin<"__builtin_ia32_pmovuswb128_mask">,
4609 Intrinsic<[llvm_v16i8_ty],
4610 [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
4612 def int_x86_avx512_mask_pmovus_wb_mem_128 :
4613 GCCBuiltin<"__builtin_ia32_pmovuswb128mem_mask">,
4615 [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
4617 def int_x86_avx512_mask_pmov_wb_mem_256 :
4618 GCCBuiltin<"__builtin_ia32_pmovwb256mem_mask">,
4620 [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
4622 def int_x86_avx512_mask_pmovs_wb_256 :
4623 GCCBuiltin<"__builtin_ia32_pmovswb256_mask">,
4624 Intrinsic<[llvm_v16i8_ty],
4625 [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
4627 def int_x86_avx512_mask_pmovs_wb_mem_256 :
4628 GCCBuiltin<"__builtin_ia32_pmovswb256mem_mask">,
4630 [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
4632 def int_x86_avx512_mask_pmovus_wb_256 :
4633 GCCBuiltin<"__builtin_ia32_pmovuswb256_mask">,
4634 Intrinsic<[llvm_v16i8_ty],
4635 [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
4637 def int_x86_avx512_mask_pmovus_wb_mem_256 :
4638 GCCBuiltin<"__builtin_ia32_pmovuswb256mem_mask">,
4640 [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
4642 def int_x86_avx512_mask_pmov_wb_mem_512 :
4643 GCCBuiltin<"__builtin_ia32_pmovwb512mem_mask">,
4645 [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
4647 def int_x86_avx512_mask_pmovs_wb_512 :
4648 GCCBuiltin<"__builtin_ia32_pmovswb512_mask">,
4649 Intrinsic<[llvm_v32i8_ty],
4650 [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
4652 def int_x86_avx512_mask_pmovs_wb_mem_512 :
4653 GCCBuiltin<"__builtin_ia32_pmovswb512mem_mask">,
4655 [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
4657 def int_x86_avx512_mask_pmovus_wb_512 :
4658 GCCBuiltin<"__builtin_ia32_pmovuswb512_mask">,
4659 Intrinsic<[llvm_v32i8_ty],
4660 [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
4662 def int_x86_avx512_mask_pmovus_wb_mem_512 :
4663 GCCBuiltin<"__builtin_ia32_pmovuswb512mem_mask">,
4665 [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
4669 // Bitwise ternary logic
4670 let TargetPrefix = "x86" in {
4671 def int_x86_avx512_pternlog_d_128 :
4672 GCCBuiltin<"__builtin_ia32_pternlogd128">,
4673 Intrinsic<[llvm_v4i32_ty],
4674 [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
4675 [IntrNoMem, ImmArg<3>]>;
4677 def int_x86_avx512_pternlog_d_256 :
4678 GCCBuiltin<"__builtin_ia32_pternlogd256">,
4679 Intrinsic<[llvm_v8i32_ty],
4680 [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
4681 [IntrNoMem, ImmArg<3>]>;
4683 def int_x86_avx512_pternlog_d_512 :
4684 GCCBuiltin<"__builtin_ia32_pternlogd512">,
4685 Intrinsic<[llvm_v16i32_ty],
4686 [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty,
4687 llvm_i32_ty], [IntrNoMem, ImmArg<3>]>;
4689 def int_x86_avx512_pternlog_q_128 :
4690 GCCBuiltin<"__builtin_ia32_pternlogq128">,
4691 Intrinsic<[llvm_v2i64_ty],
4692 [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
4693 [IntrNoMem, ImmArg<3>]>;
4695 def int_x86_avx512_pternlog_q_256 :
4696 GCCBuiltin<"__builtin_ia32_pternlogq256">,
4697 Intrinsic<[llvm_v4i64_ty],
4698 [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
4699 [IntrNoMem, ImmArg<3>]>;
4701 def int_x86_avx512_pternlog_q_512 :
4702 GCCBuiltin<"__builtin_ia32_pternlogq512">,
4703 Intrinsic<[llvm_v8i64_ty],
4704 [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty, llvm_i32_ty],
4705 [IntrNoMem, ImmArg<3>]>;
4709 let TargetPrefix = "x86" in {
4710 def int_x86_avx512_vp2intersect_q_512 :
4711 Intrinsic<[llvm_v8i1_ty, llvm_v8i1_ty],
4712 [llvm_v8i64_ty, llvm_v8i64_ty],
4714 def int_x86_avx512_vp2intersect_q_256 :
4715 Intrinsic<[llvm_v4i1_ty, llvm_v4i1_ty],
4716 [llvm_v4i64_ty, llvm_v4i64_ty],
4718 def int_x86_avx512_vp2intersect_q_128 :
4719 Intrinsic<[llvm_v2i1_ty, llvm_v2i1_ty],
4720 [llvm_v2i64_ty, llvm_v2i64_ty],
4722 def int_x86_avx512_vp2intersect_d_512 :
4723 Intrinsic<[llvm_v16i1_ty, llvm_v16i1_ty],
4724 [llvm_v16i32_ty, llvm_v16i32_ty],
4726 def int_x86_avx512_vp2intersect_d_256 :
4727 Intrinsic<[llvm_v8i1_ty, llvm_v8i1_ty],
4728 [llvm_v8i32_ty, llvm_v8i32_ty],
4730 def int_x86_avx512_vp2intersect_d_128 :
4731 Intrinsic<[llvm_v4i1_ty, llvm_v4i1_ty],
4732 [llvm_v4i32_ty, llvm_v4i32_ty],
4737 let TargetPrefix = "x86" in {
4738 // NOTE: These comparison intrinsics are not used by clang as long as the
4739 // distinction in signaling behaviour is not implemented.
4740 def int_x86_avx512_cmp_ps_512 :
4741 Intrinsic<[llvm_v16i1_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
4742 llvm_i32_ty, llvm_i32_ty],
4743 [IntrNoMem, ImmArg<2>, ImmArg<3>]>;
4744 def int_x86_avx512_cmp_pd_512 :
4745 Intrinsic<[llvm_v8i1_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
4746 llvm_i32_ty, llvm_i32_ty],
4747 [IntrNoMem, ImmArg<2>, ImmArg<3>]>;
4748 def int_x86_avx512_cmp_ps_256 :
4749 Intrinsic<[llvm_v8i1_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
4750 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
4751 def int_x86_avx512_cmp_pd_256 :
4752 Intrinsic<[llvm_v4i1_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
4753 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
4754 def int_x86_avx512_cmp_ps_128 :
4755 Intrinsic<[llvm_v4i1_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
4756 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
4757 def int_x86_avx512_cmp_pd_128 :
4758 Intrinsic<[llvm_v2i1_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
4759 llvm_i32_ty], [IntrNoMem, ImmArg<2>]>;
4761 def int_x86_avx512_mask_cmp_ss :
4762 GCCBuiltin<"__builtin_ia32_cmpss_mask">,
4763 Intrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
4764 llvm_i32_ty, llvm_i8_ty, llvm_i32_ty],
4765 [IntrNoMem, ImmArg<2>, ImmArg<4>]>;
4766 def int_x86_avx512_mask_cmp_sd :
4767 GCCBuiltin<"__builtin_ia32_cmpsd_mask">,
4768 Intrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
4769 llvm_i32_ty, llvm_i8_ty, llvm_i32_ty],
4770 [IntrNoMem, ImmArg<2>, ImmArg<4>]>;
4773 //===----------------------------------------------------------------------===//
4775 let TargetPrefix = "x86" in {
4776 def int_x86_sha1rnds4 : GCCBuiltin<"__builtin_ia32_sha1rnds4">,
4777 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
4778 [IntrNoMem, ImmArg<2>]>;
4779 def int_x86_sha1nexte : GCCBuiltin<"__builtin_ia32_sha1nexte">,
4780 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
4781 def int_x86_sha1msg1 : GCCBuiltin<"__builtin_ia32_sha1msg1">,
4782 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
4783 def int_x86_sha1msg2 : GCCBuiltin<"__builtin_ia32_sha1msg2">,
4784 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
4785 def int_x86_sha256rnds2 : GCCBuiltin<"__builtin_ia32_sha256rnds2">,
4786 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
4788 def int_x86_sha256msg1 : GCCBuiltin<"__builtin_ia32_sha256msg1">,
4789 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
4790 def int_x86_sha256msg2 : GCCBuiltin<"__builtin_ia32_sha256msg2">,
4791 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
4794 //===----------------------------------------------------------------------===//
4795 // Thread synchronization ops with timer.
4796 let TargetPrefix = "x86" in {
4797 def int_x86_monitorx
4798 : GCCBuiltin<"__builtin_ia32_monitorx">,
4799 Intrinsic<[], [ llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty ], []>;
4801 : GCCBuiltin<"__builtin_ia32_mwaitx">,
4802 Intrinsic<[], [ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty ], []>;
4805 //===----------------------------------------------------------------------===//
4807 let TargetPrefix = "x86" in {
4808 def int_x86_clzero : GCCBuiltin<"__builtin_ia32_clzero">,
4809 Intrinsic<[], [llvm_ptr_ty], []>;
4812 //===----------------------------------------------------------------------===//
4813 // Cache write back intrinsics
4815 let TargetPrefix = "x86" in {
4816 // Write back and invalidate
4817 def int_x86_wbinvd : GCCBuiltin<"__builtin_ia32_wbinvd">,
4818 Intrinsic<[], [], []>;
4820 // Write back no-invalidate
4821 def int_x86_wbnoinvd : GCCBuiltin<"__builtin_ia32_wbnoinvd">,
4822 Intrinsic<[], [], []>;
4825 //===----------------------------------------------------------------------===//
4826 // Cache-line demote
4828 let TargetPrefix = "x86" in {
4829 def int_x86_cldemote : GCCBuiltin<"__builtin_ia32_cldemote">,
4830 Intrinsic<[], [llvm_ptr_ty], []>;
4833 //===----------------------------------------------------------------------===//
4834 // Wait and pause enhancements
4835 let TargetPrefix = "x86" in {
4836 def int_x86_umonitor : GCCBuiltin<"__builtin_ia32_umonitor">,
4837 Intrinsic<[], [llvm_ptr_ty], []>;
4838 def int_x86_umwait : GCCBuiltin<"__builtin_ia32_umwait">,
4839 Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
4840 def int_x86_tpause : GCCBuiltin<"__builtin_ia32_tpause">,
4841 Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
4844 //===----------------------------------------------------------------------===//
4845 // Direct Move Instructions
4847 let TargetPrefix = "x86" in {
4848 def int_x86_directstore32 : GCCBuiltin<"__builtin_ia32_directstore_u32">,
4849 Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], []>;
4850 def int_x86_directstore64 : GCCBuiltin<"__builtin_ia32_directstore_u64">,
4851 Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], []>;
4852 def int_x86_movdir64b : GCCBuiltin<"__builtin_ia32_movdir64b">,
4853 Intrinsic<[], [llvm_ptr_ty, llvm_ptr_ty], []>;
4856 //===----------------------------------------------------------------------===//
4857 // PTWrite - Write data to processor trace pocket
4859 let TargetPrefix = "x86" in {
4860 def int_x86_ptwrite32 : GCCBuiltin<"__builtin_ia32_ptwrite32">,
4861 Intrinsic<[], [llvm_i32_ty], []>;
4862 def int_x86_ptwrite64 : GCCBuiltin<"__builtin_ia32_ptwrite64">,
4863 Intrinsic<[], [llvm_i64_ty], []>;
4866 //===----------------------------------------------------------------------===//
4867 // INVPCID - Invalidate Process-Context Identifier
4869 let TargetPrefix = "x86" in {
4870 def int_x86_invpcid : GCCBuiltin<"__builtin_ia32_invpcid">,
4871 Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], []>;
4874 let TargetPrefix = "x86" in {
4875 def int_x86_avx512bf16_cvtne2ps2bf16_128:
4876 GCCBuiltin<"__builtin_ia32_cvtne2ps2bf16_128">,
4877 Intrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
4879 def int_x86_avx512bf16_cvtne2ps2bf16_256:
4880 GCCBuiltin<"__builtin_ia32_cvtne2ps2bf16_256">,
4881 Intrinsic<[llvm_v16i16_ty], [llvm_v8f32_ty, llvm_v8f32_ty],
4883 def int_x86_avx512bf16_cvtne2ps2bf16_512:
4884 GCCBuiltin<"__builtin_ia32_cvtne2ps2bf16_512">,
4885 Intrinsic<[llvm_v32i16_ty], [llvm_v16f32_ty, llvm_v16f32_ty],
4887 // Intrinsic must be masked due to it producing less than 128 bits of results.
4888 def int_x86_avx512bf16_mask_cvtneps2bf16_128:
4889 Intrinsic<[llvm_v8i16_ty],
4890 [llvm_v4f32_ty, llvm_v8i16_ty, llvm_v4i1_ty],
4892 def int_x86_avx512bf16_cvtneps2bf16_256:
4893 GCCBuiltin<"__builtin_ia32_cvtneps2bf16_256">,
4894 Intrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty], [IntrNoMem]>;
4895 def int_x86_avx512bf16_cvtneps2bf16_512:
4896 GCCBuiltin<"__builtin_ia32_cvtneps2bf16_512">,
4897 Intrinsic<[llvm_v16i16_ty], [llvm_v16f32_ty], [IntrNoMem]>;
4898 def int_x86_avx512bf16_dpbf16ps_128:
4899 GCCBuiltin<"__builtin_ia32_dpbf16ps_128">,
4900 Intrinsic<[llvm_v4f32_ty],
4901 [llvm_v4f32_ty, llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
4902 def int_x86_avx512bf16_dpbf16ps_256:
4903 GCCBuiltin<"__builtin_ia32_dpbf16ps_256">,
4904 Intrinsic<[llvm_v8f32_ty],
4905 [llvm_v8f32_ty, llvm_v8i32_ty, llvm_v8i32_ty], [IntrNoMem]>;
4906 def int_x86_avx512bf16_dpbf16ps_512:
4907 GCCBuiltin<"__builtin_ia32_dpbf16ps_512">,
4908 Intrinsic<[llvm_v16f32_ty],
4909 [llvm_v16f32_ty, llvm_v16i32_ty, llvm_v16i32_ty], [IntrNoMem]>;
4912 //===----------------------------------------------------------------------===//
4913 // ENQCMD - Enqueue Stores Instructions
4915 let TargetPrefix = "x86" in {
4916 def int_x86_enqcmd : GCCBuiltin<"__builtin_ia32_enqcmd">,
4917 Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_ptr_ty], []>;
4918 def int_x86_enqcmds : GCCBuiltin<"__builtin_ia32_enqcmds">,
4919 Intrinsic<[llvm_i8_ty], [llvm_ptr_ty, llvm_ptr_ty], []>;