Recommit [NFC] Better encapsulation of llvm::Optional Storage
[llvm-complete.git] / include / llvm / IR / IntrinsicsNVVM.td
blobcf072c70ebafdf5be0f7f59473d4f5cba23d34f4
1 //===- IntrinsicsNVVM.td - Defines NVVM intrinsics ---------*- tablegen -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines all of the NVVM-specific intrinsics for use with NVPTX.
11 //===----------------------------------------------------------------------===//
13 // The following intrinsics were once defined here, but are now auto-upgraded
14 // to target-generic LLVM intrinsics.
16 //   * llvm.nvvm.brev32  --> llvm.bitreverse.i32
17 //   * llvm.nvvm.brev64  --> llvm.bitreverse.i64
18 //   * llvm.nvvm.clz.i   --> llvm.ctlz.i32
19 //   * llvm.nvvm.clz.ll  --> trunc i64 llvm.ctlz.i64(x) to i32
20 //   * llvm.nvvm.popc.i  --> llvm.ctpop.i32
21 //   * llvm.nvvm.popc.ll --> trunc i64 llvm.ctpop.i64 to i32
22 //   * llvm.nvvm.abs.i   --> select(x >= -x, x, -x)
23 //   * llvm.nvvm.abs.ll  --> ibid.
24 //   * llvm.nvvm.max.i   --> select(x sge y, x, y)
25 //   * llvm.nvvm.max.ll  --> ibid.
26 //   * llvm.nvvm.max.ui  --> select(x uge y, x, y)
27 //   * llvm.nvvm.max.ull --> ibid.
28 //   * llvm.nvvm.max.i   --> select(x sle y, x, y)
29 //   * llvm.nvvm.max.ll  --> ibid.
30 //   * llvm.nvvm.max.ui  --> select(x ule y, x, y)
31 //   * llvm.nvvm.max.ull --> ibid.
32 //   * llvm.nvvm.h2f     --> llvm.convert.to.fp16.f32
34 def llvm_anyi64ptr_ty     : LLVMAnyPointerType<llvm_i64_ty>;     // (space)i64*
37 // MISC
40 let TargetPrefix = "nvvm" in {
41   def int_nvvm_prmt : GCCBuiltin<"__nvvm_prmt">,
42       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
43         [IntrNoMem, Commutative]>;
46 // Min Max
49   def int_nvvm_fmin_f : GCCBuiltin<"__nvvm_fmin_f">,
50       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
51         [IntrNoMem, Commutative]>;
52   def int_nvvm_fmin_ftz_f : GCCBuiltin<"__nvvm_fmin_ftz_f">,
53       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
54         [IntrNoMem, Commutative]>;
56   def int_nvvm_fmax_f : GCCBuiltin<"__nvvm_fmax_f">,
57       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty]
58         , [IntrNoMem, Commutative]>;
59   def int_nvvm_fmax_ftz_f : GCCBuiltin<"__nvvm_fmax_ftz_f">,
60       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
61         [IntrNoMem, Commutative]>;
63   def int_nvvm_fmin_d : GCCBuiltin<"__nvvm_fmin_d">,
64       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
65         [IntrNoMem, Commutative]>;
66   def int_nvvm_fmax_d : GCCBuiltin<"__nvvm_fmax_d">,
67       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
68         [IntrNoMem, Commutative]>;
71 // Multiplication
74   def int_nvvm_mulhi_i : GCCBuiltin<"__nvvm_mulhi_i">,
75       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
76         [IntrNoMem, Commutative]>;
77   def int_nvvm_mulhi_ui : GCCBuiltin<"__nvvm_mulhi_ui">,
78       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
79         [IntrNoMem, Commutative]>;
81   def int_nvvm_mulhi_ll : GCCBuiltin<"__nvvm_mulhi_ll">,
82       Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
83         [IntrNoMem, Commutative]>;
84   def int_nvvm_mulhi_ull : GCCBuiltin<"__nvvm_mulhi_ull">,
85       Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
86         [IntrNoMem, Commutative]>;
88   def int_nvvm_mul_rn_ftz_f : GCCBuiltin<"__nvvm_mul_rn_ftz_f">,
89       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
90         [IntrNoMem, Commutative]>;
91   def int_nvvm_mul_rn_f : GCCBuiltin<"__nvvm_mul_rn_f">,
92       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
93         [IntrNoMem, Commutative]>;
94   def int_nvvm_mul_rz_ftz_f : GCCBuiltin<"__nvvm_mul_rz_ftz_f">,
95       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
96         [IntrNoMem, Commutative]>;
97   def int_nvvm_mul_rz_f : GCCBuiltin<"__nvvm_mul_rz_f">,
98       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
99         [IntrNoMem, Commutative]>;
100   def int_nvvm_mul_rm_ftz_f : GCCBuiltin<"__nvvm_mul_rm_ftz_f">,
101       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
102         [IntrNoMem, Commutative]>;
103   def int_nvvm_mul_rm_f : GCCBuiltin<"__nvvm_mul_rm_f">,
104       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
105         [IntrNoMem, Commutative]>;
106   def int_nvvm_mul_rp_ftz_f : GCCBuiltin<"__nvvm_mul_rp_ftz_f">,
107       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
108         [IntrNoMem, Commutative]>;
109   def int_nvvm_mul_rp_f : GCCBuiltin<"__nvvm_mul_rp_f">,
110       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
111         [IntrNoMem, Commutative]>;
113   def int_nvvm_mul_rn_d : GCCBuiltin<"__nvvm_mul_rn_d">,
114       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
115         [IntrNoMem, Commutative]>;
116   def int_nvvm_mul_rz_d : GCCBuiltin<"__nvvm_mul_rz_d">,
117       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
118         [IntrNoMem, Commutative]>;
119   def int_nvvm_mul_rm_d : GCCBuiltin<"__nvvm_mul_rm_d">,
120       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
121         [IntrNoMem, Commutative]>;
122   def int_nvvm_mul_rp_d : GCCBuiltin<"__nvvm_mul_rp_d">,
123       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
124         [IntrNoMem, Commutative]>;
126   def int_nvvm_mul24_i : GCCBuiltin<"__nvvm_mul24_i">,
127       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
128         [IntrNoMem, Commutative]>;
129   def int_nvvm_mul24_ui : GCCBuiltin<"__nvvm_mul24_ui">,
130       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
131         [IntrNoMem, Commutative]>;
134 // Div
137   def int_nvvm_div_approx_ftz_f : GCCBuiltin<"__nvvm_div_approx_ftz_f">,
138       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
139         [IntrNoMem, Commutative]>;
140   def int_nvvm_div_approx_f : GCCBuiltin<"__nvvm_div_approx_f">,
141       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
142         [IntrNoMem, Commutative]>;
144   def int_nvvm_div_rn_ftz_f : GCCBuiltin<"__nvvm_div_rn_ftz_f">,
145       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
146         [IntrNoMem, Commutative]>;
147   def int_nvvm_div_rn_f : GCCBuiltin<"__nvvm_div_rn_f">,
148       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
149         [IntrNoMem, Commutative]>;
151   def int_nvvm_div_rz_ftz_f : GCCBuiltin<"__nvvm_div_rz_ftz_f">,
152       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
153         [IntrNoMem, Commutative]>;
154   def int_nvvm_div_rz_f : GCCBuiltin<"__nvvm_div_rz_f">,
155       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
156         [IntrNoMem, Commutative]>;
158   def int_nvvm_div_rm_ftz_f : GCCBuiltin<"__nvvm_div_rm_ftz_f">,
159       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
160         [IntrNoMem, Commutative]>;
161   def int_nvvm_div_rm_f : GCCBuiltin<"__nvvm_div_rm_f">,
162       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
163         [IntrNoMem, Commutative]>;
165   def int_nvvm_div_rp_ftz_f : GCCBuiltin<"__nvvm_div_rp_ftz_f">,
166       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
167         [IntrNoMem, Commutative]>;
168   def int_nvvm_div_rp_f : GCCBuiltin<"__nvvm_div_rp_f">,
169       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
170         [IntrNoMem, Commutative]>;
172   def int_nvvm_div_rn_d : GCCBuiltin<"__nvvm_div_rn_d">,
173       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
174         [IntrNoMem, Commutative]>;
175   def int_nvvm_div_rz_d : GCCBuiltin<"__nvvm_div_rz_d">,
176       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
177         [IntrNoMem, Commutative]>;
178   def int_nvvm_div_rm_d : GCCBuiltin<"__nvvm_div_rm_d">,
179       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
180         [IntrNoMem, Commutative]>;
181   def int_nvvm_div_rp_d : GCCBuiltin<"__nvvm_div_rp_d">,
182       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
183         [IntrNoMem, Commutative]>;
186 // Sad
189   def int_nvvm_sad_i : GCCBuiltin<"__nvvm_sad_i">,
190       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
191         [IntrNoMem, Commutative]>;
192   def int_nvvm_sad_ui : GCCBuiltin<"__nvvm_sad_ui">,
193       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
194         [IntrNoMem, Commutative]>;
197 // Floor  Ceil
200   def int_nvvm_floor_ftz_f : GCCBuiltin<"__nvvm_floor_ftz_f">,
201       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
202   def int_nvvm_floor_f : GCCBuiltin<"__nvvm_floor_f">,
203       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
204   def int_nvvm_floor_d : GCCBuiltin<"__nvvm_floor_d">,
205       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
207   def int_nvvm_ceil_ftz_f : GCCBuiltin<"__nvvm_ceil_ftz_f">,
208       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
209   def int_nvvm_ceil_f : GCCBuiltin<"__nvvm_ceil_f">,
210       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
211   def int_nvvm_ceil_d : GCCBuiltin<"__nvvm_ceil_d">,
212       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
215 // Abs
218   def int_nvvm_fabs_ftz_f : GCCBuiltin<"__nvvm_fabs_ftz_f">,
219       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
220   def int_nvvm_fabs_f : GCCBuiltin<"__nvvm_fabs_f">,
221       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
222   def int_nvvm_fabs_d : GCCBuiltin<"__nvvm_fabs_d">,
223       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
226 // Round
229   def int_nvvm_round_ftz_f : GCCBuiltin<"__nvvm_round_ftz_f">,
230       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
231   def int_nvvm_round_f : GCCBuiltin<"__nvvm_round_f">,
232       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
234   def int_nvvm_round_d : GCCBuiltin<"__nvvm_round_d">,
235       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
238 // Trunc
241   def int_nvvm_trunc_ftz_f : GCCBuiltin<"__nvvm_trunc_ftz_f">,
242       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
243   def int_nvvm_trunc_f : GCCBuiltin<"__nvvm_trunc_f">,
244       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
246   def int_nvvm_trunc_d : GCCBuiltin<"__nvvm_trunc_d">,
247       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
250 // Saturate
253   def int_nvvm_saturate_ftz_f : GCCBuiltin<"__nvvm_saturate_ftz_f">,
254       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
255   def int_nvvm_saturate_f : GCCBuiltin<"__nvvm_saturate_f">,
256       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
258   def int_nvvm_saturate_d : GCCBuiltin<"__nvvm_saturate_d">,
259       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
262 // Exp2  Log2
265   def int_nvvm_ex2_approx_ftz_f : GCCBuiltin<"__nvvm_ex2_approx_ftz_f">,
266       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
267   def int_nvvm_ex2_approx_f : GCCBuiltin<"__nvvm_ex2_approx_f">,
268       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
269   def int_nvvm_ex2_approx_d : GCCBuiltin<"__nvvm_ex2_approx_d">,
270       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
272   def int_nvvm_lg2_approx_ftz_f : GCCBuiltin<"__nvvm_lg2_approx_ftz_f">,
273       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
274   def int_nvvm_lg2_approx_f : GCCBuiltin<"__nvvm_lg2_approx_f">,
275       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
276   def int_nvvm_lg2_approx_d : GCCBuiltin<"__nvvm_lg2_approx_d">,
277       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
280 // Sin  Cos
283   def int_nvvm_sin_approx_ftz_f : GCCBuiltin<"__nvvm_sin_approx_ftz_f">,
284       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
285   def int_nvvm_sin_approx_f : GCCBuiltin<"__nvvm_sin_approx_f">,
286       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
288   def int_nvvm_cos_approx_ftz_f : GCCBuiltin<"__nvvm_cos_approx_ftz_f">,
289       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
290   def int_nvvm_cos_approx_f : GCCBuiltin<"__nvvm_cos_approx_f">,
291       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
294 // Fma
297   def int_nvvm_fma_rn_ftz_f : GCCBuiltin<"__nvvm_fma_rn_ftz_f">,
298       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
299         [IntrNoMem, Commutative]>;
300   def int_nvvm_fma_rn_f : GCCBuiltin<"__nvvm_fma_rn_f">,
301       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
302         [IntrNoMem, Commutative]>;
303   def int_nvvm_fma_rz_ftz_f : GCCBuiltin<"__nvvm_fma_rz_ftz_f">,
304       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
305         [IntrNoMem, Commutative]>;
306   def int_nvvm_fma_rz_f : GCCBuiltin<"__nvvm_fma_rz_f">,
307       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
308         [IntrNoMem, Commutative]>;
309   def int_nvvm_fma_rm_ftz_f : GCCBuiltin<"__nvvm_fma_rm_ftz_f">,
310       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
311         [IntrNoMem, Commutative]>;
312   def int_nvvm_fma_rm_f : GCCBuiltin<"__nvvm_fma_rm_f">,
313       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
314         [IntrNoMem, Commutative]>;
315   def int_nvvm_fma_rp_ftz_f : GCCBuiltin<"__nvvm_fma_rp_ftz_f">,
316       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
317         [IntrNoMem, Commutative]>;
318   def int_nvvm_fma_rp_f : GCCBuiltin<"__nvvm_fma_rp_f">,
319       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty, llvm_float_ty],
320         [IntrNoMem, Commutative]>;
322   def int_nvvm_fma_rn_d : GCCBuiltin<"__nvvm_fma_rn_d">,
323       Intrinsic<[llvm_double_ty],
324         [llvm_double_ty, llvm_double_ty, llvm_double_ty],
325         [IntrNoMem, Commutative]>;
326   def int_nvvm_fma_rz_d : GCCBuiltin<"__nvvm_fma_rz_d">,
327       Intrinsic<[llvm_double_ty],
328         [llvm_double_ty, llvm_double_ty, llvm_double_ty],
329         [IntrNoMem, Commutative]>;
330   def int_nvvm_fma_rm_d : GCCBuiltin<"__nvvm_fma_rm_d">,
331       Intrinsic<[llvm_double_ty],
332         [llvm_double_ty, llvm_double_ty, llvm_double_ty],
333         [IntrNoMem, Commutative]>;
334   def int_nvvm_fma_rp_d : GCCBuiltin<"__nvvm_fma_rp_d">,
335       Intrinsic<[llvm_double_ty],
336         [llvm_double_ty, llvm_double_ty, llvm_double_ty],
337         [IntrNoMem, Commutative]>;
340 // Rcp
343   def int_nvvm_rcp_rn_ftz_f : GCCBuiltin<"__nvvm_rcp_rn_ftz_f">,
344       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
345   def int_nvvm_rcp_rn_f : GCCBuiltin<"__nvvm_rcp_rn_f">,
346       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
347   def int_nvvm_rcp_rz_ftz_f : GCCBuiltin<"__nvvm_rcp_rz_ftz_f">,
348       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
349   def int_nvvm_rcp_rz_f : GCCBuiltin<"__nvvm_rcp_rz_f">,
350       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
351   def int_nvvm_rcp_rm_ftz_f : GCCBuiltin<"__nvvm_rcp_rm_ftz_f">,
352       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
353   def int_nvvm_rcp_rm_f : GCCBuiltin<"__nvvm_rcp_rm_f">,
354       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
355   def int_nvvm_rcp_rp_ftz_f : GCCBuiltin<"__nvvm_rcp_rp_ftz_f">,
356       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
357   def int_nvvm_rcp_rp_f : GCCBuiltin<"__nvvm_rcp_rp_f">,
358       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
360   def int_nvvm_rcp_rn_d : GCCBuiltin<"__nvvm_rcp_rn_d">,
361       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
362   def int_nvvm_rcp_rz_d : GCCBuiltin<"__nvvm_rcp_rz_d">,
363       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
364   def int_nvvm_rcp_rm_d : GCCBuiltin<"__nvvm_rcp_rm_d">,
365       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
366   def int_nvvm_rcp_rp_d : GCCBuiltin<"__nvvm_rcp_rp_d">,
367       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
369   def int_nvvm_rcp_approx_ftz_d : GCCBuiltin<"__nvvm_rcp_approx_ftz_d">,
370       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
373 // Sqrt
376   def int_nvvm_sqrt_f : GCCBuiltin<"__nvvm_sqrt_f">,
377       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
378   def int_nvvm_sqrt_rn_ftz_f : GCCBuiltin<"__nvvm_sqrt_rn_ftz_f">,
379       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
380   def int_nvvm_sqrt_rn_f : GCCBuiltin<"__nvvm_sqrt_rn_f">,
381       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
382   def int_nvvm_sqrt_rz_ftz_f : GCCBuiltin<"__nvvm_sqrt_rz_ftz_f">,
383       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
384   def int_nvvm_sqrt_rz_f : GCCBuiltin<"__nvvm_sqrt_rz_f">,
385       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
386   def int_nvvm_sqrt_rm_ftz_f : GCCBuiltin<"__nvvm_sqrt_rm_ftz_f">,
387       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
388   def int_nvvm_sqrt_rm_f : GCCBuiltin<"__nvvm_sqrt_rm_f">,
389       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
390   def int_nvvm_sqrt_rp_ftz_f : GCCBuiltin<"__nvvm_sqrt_rp_ftz_f">,
391       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
392   def int_nvvm_sqrt_rp_f : GCCBuiltin<"__nvvm_sqrt_rp_f">,
393       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
394   def int_nvvm_sqrt_approx_ftz_f : GCCBuiltin<"__nvvm_sqrt_approx_ftz_f">,
395       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
396   def int_nvvm_sqrt_approx_f : GCCBuiltin<"__nvvm_sqrt_approx_f">,
397       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
399   def int_nvvm_sqrt_rn_d : GCCBuiltin<"__nvvm_sqrt_rn_d">,
400       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
401   def int_nvvm_sqrt_rz_d : GCCBuiltin<"__nvvm_sqrt_rz_d">,
402       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
403   def int_nvvm_sqrt_rm_d : GCCBuiltin<"__nvvm_sqrt_rm_d">,
404       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
405   def int_nvvm_sqrt_rp_d : GCCBuiltin<"__nvvm_sqrt_rp_d">,
406       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
409 // Rsqrt
412   def int_nvvm_rsqrt_approx_ftz_f : GCCBuiltin<"__nvvm_rsqrt_approx_ftz_f">,
413       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
414   def int_nvvm_rsqrt_approx_f : GCCBuiltin<"__nvvm_rsqrt_approx_f">,
415       Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
416   def int_nvvm_rsqrt_approx_d : GCCBuiltin<"__nvvm_rsqrt_approx_d">,
417       Intrinsic<[llvm_double_ty], [llvm_double_ty], [IntrNoMem]>;
420 // Add
423   def int_nvvm_add_rn_ftz_f : GCCBuiltin<"__nvvm_add_rn_ftz_f">,
424       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
425         [IntrNoMem, Commutative]>;
426   def int_nvvm_add_rn_f : GCCBuiltin<"__nvvm_add_rn_f">,
427       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
428         [IntrNoMem, Commutative]>;
429   def int_nvvm_add_rz_ftz_f : GCCBuiltin<"__nvvm_add_rz_ftz_f">,
430       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
431         [IntrNoMem, Commutative]>;
432   def int_nvvm_add_rz_f : GCCBuiltin<"__nvvm_add_rz_f">,
433       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
434         [IntrNoMem, Commutative]>;
435   def int_nvvm_add_rm_ftz_f : GCCBuiltin<"__nvvm_add_rm_ftz_f">,
436       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
437         [IntrNoMem, Commutative]>;
438   def int_nvvm_add_rm_f : GCCBuiltin<"__nvvm_add_rm_f">,
439       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
440         [IntrNoMem, Commutative]>;
441   def int_nvvm_add_rp_ftz_f : GCCBuiltin<"__nvvm_add_rp_ftz_f">,
442       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
443         [IntrNoMem, Commutative]>;
444   def int_nvvm_add_rp_f : GCCBuiltin<"__nvvm_add_rp_f">,
445       Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty],
446         [IntrNoMem, Commutative]>;
448   def int_nvvm_add_rn_d : GCCBuiltin<"__nvvm_add_rn_d">,
449       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
450         [IntrNoMem, Commutative]>;
451   def int_nvvm_add_rz_d : GCCBuiltin<"__nvvm_add_rz_d">,
452       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
453         [IntrNoMem, Commutative]>;
454   def int_nvvm_add_rm_d : GCCBuiltin<"__nvvm_add_rm_d">,
455       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
456         [IntrNoMem, Commutative]>;
457   def int_nvvm_add_rp_d : GCCBuiltin<"__nvvm_add_rp_d">,
458       Intrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty],
459         [IntrNoMem, Commutative]>;
462 // Convert
465   def int_nvvm_d2f_rn_ftz : GCCBuiltin<"__nvvm_d2f_rn_ftz">,
466       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
467   def int_nvvm_d2f_rn : GCCBuiltin<"__nvvm_d2f_rn">,
468       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
469   def int_nvvm_d2f_rz_ftz : GCCBuiltin<"__nvvm_d2f_rz_ftz">,
470       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
471   def int_nvvm_d2f_rz : GCCBuiltin<"__nvvm_d2f_rz">,
472       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
473   def int_nvvm_d2f_rm_ftz : GCCBuiltin<"__nvvm_d2f_rm_ftz">,
474       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
475   def int_nvvm_d2f_rm : GCCBuiltin<"__nvvm_d2f_rm">,
476       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
477   def int_nvvm_d2f_rp_ftz : GCCBuiltin<"__nvvm_d2f_rp_ftz">,
478       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
479   def int_nvvm_d2f_rp : GCCBuiltin<"__nvvm_d2f_rp">,
480       Intrinsic<[llvm_float_ty], [llvm_double_ty], [IntrNoMem]>;
482   def int_nvvm_d2i_rn : GCCBuiltin<"__nvvm_d2i_rn">,
483       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
484   def int_nvvm_d2i_rz : GCCBuiltin<"__nvvm_d2i_rz">,
485       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
486   def int_nvvm_d2i_rm : GCCBuiltin<"__nvvm_d2i_rm">,
487       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
488   def int_nvvm_d2i_rp : GCCBuiltin<"__nvvm_d2i_rp">,
489       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
491   def int_nvvm_d2ui_rn : GCCBuiltin<"__nvvm_d2ui_rn">,
492       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
493   def int_nvvm_d2ui_rz : GCCBuiltin<"__nvvm_d2ui_rz">,
494       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
495   def int_nvvm_d2ui_rm : GCCBuiltin<"__nvvm_d2ui_rm">,
496       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
497   def int_nvvm_d2ui_rp : GCCBuiltin<"__nvvm_d2ui_rp">,
498       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
500   def int_nvvm_i2d_rn : GCCBuiltin<"__nvvm_i2d_rn">,
501       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
502   def int_nvvm_i2d_rz : GCCBuiltin<"__nvvm_i2d_rz">,
503       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
504   def int_nvvm_i2d_rm : GCCBuiltin<"__nvvm_i2d_rm">,
505       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
506   def int_nvvm_i2d_rp : GCCBuiltin<"__nvvm_i2d_rp">,
507       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
509   def int_nvvm_ui2d_rn : GCCBuiltin<"__nvvm_ui2d_rn">,
510       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
511   def int_nvvm_ui2d_rz : GCCBuiltin<"__nvvm_ui2d_rz">,
512       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
513   def int_nvvm_ui2d_rm : GCCBuiltin<"__nvvm_ui2d_rm">,
514       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
515   def int_nvvm_ui2d_rp : GCCBuiltin<"__nvvm_ui2d_rp">,
516       Intrinsic<[llvm_double_ty], [llvm_i32_ty], [IntrNoMem]>;
518   def int_nvvm_f2i_rn_ftz : GCCBuiltin<"__nvvm_f2i_rn_ftz">,
519       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
520   def int_nvvm_f2i_rn : GCCBuiltin<"__nvvm_f2i_rn">,
521       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
522   def int_nvvm_f2i_rz_ftz : GCCBuiltin<"__nvvm_f2i_rz_ftz">,
523       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
524   def int_nvvm_f2i_rz : GCCBuiltin<"__nvvm_f2i_rz">,
525       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
526   def int_nvvm_f2i_rm_ftz : GCCBuiltin<"__nvvm_f2i_rm_ftz">,
527       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
528   def int_nvvm_f2i_rm : GCCBuiltin<"__nvvm_f2i_rm">,
529       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
530   def int_nvvm_f2i_rp_ftz : GCCBuiltin<"__nvvm_f2i_rp_ftz">,
531       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
532   def int_nvvm_f2i_rp : GCCBuiltin<"__nvvm_f2i_rp">,
533       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
535   def int_nvvm_f2ui_rn_ftz : GCCBuiltin<"__nvvm_f2ui_rn_ftz">,
536       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
537   def int_nvvm_f2ui_rn : GCCBuiltin<"__nvvm_f2ui_rn">,
538       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
539   def int_nvvm_f2ui_rz_ftz : GCCBuiltin<"__nvvm_f2ui_rz_ftz">,
540       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
541   def int_nvvm_f2ui_rz : GCCBuiltin<"__nvvm_f2ui_rz">,
542       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
543   def int_nvvm_f2ui_rm_ftz : GCCBuiltin<"__nvvm_f2ui_rm_ftz">,
544       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
545   def int_nvvm_f2ui_rm : GCCBuiltin<"__nvvm_f2ui_rm">,
546       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
547   def int_nvvm_f2ui_rp_ftz : GCCBuiltin<"__nvvm_f2ui_rp_ftz">,
548       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
549   def int_nvvm_f2ui_rp : GCCBuiltin<"__nvvm_f2ui_rp">,
550       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
552   def int_nvvm_i2f_rn : GCCBuiltin<"__nvvm_i2f_rn">,
553       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
554   def int_nvvm_i2f_rz : GCCBuiltin<"__nvvm_i2f_rz">,
555       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
556   def int_nvvm_i2f_rm : GCCBuiltin<"__nvvm_i2f_rm">,
557       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
558   def int_nvvm_i2f_rp : GCCBuiltin<"__nvvm_i2f_rp">,
559       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
561   def int_nvvm_ui2f_rn : GCCBuiltin<"__nvvm_ui2f_rn">,
562       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
563   def int_nvvm_ui2f_rz : GCCBuiltin<"__nvvm_ui2f_rz">,
564       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
565   def int_nvvm_ui2f_rm : GCCBuiltin<"__nvvm_ui2f_rm">,
566       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
567   def int_nvvm_ui2f_rp : GCCBuiltin<"__nvvm_ui2f_rp">,
568       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
570   def int_nvvm_lohi_i2d : GCCBuiltin<"__nvvm_lohi_i2d">,
571       Intrinsic<[llvm_double_ty], [llvm_i32_ty, llvm_i32_ty],
572         [IntrNoMem, Commutative]>;
574   def int_nvvm_d2i_lo : GCCBuiltin<"__nvvm_d2i_lo">,
575       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
576   def int_nvvm_d2i_hi : GCCBuiltin<"__nvvm_d2i_hi">,
577       Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
579   def int_nvvm_f2ll_rn_ftz : GCCBuiltin<"__nvvm_f2ll_rn_ftz">,
580       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
581   def int_nvvm_f2ll_rn : GCCBuiltin<"__nvvm_f2ll_rn">,
582       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
583   def int_nvvm_f2ll_rz_ftz : GCCBuiltin<"__nvvm_f2ll_rz_ftz">,
584       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
585   def int_nvvm_f2ll_rz : GCCBuiltin<"__nvvm_f2ll_rz">,
586       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
587   def int_nvvm_f2ll_rm_ftz : GCCBuiltin<"__nvvm_f2ll_rm_ftz">,
588       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
589   def int_nvvm_f2ll_rm : GCCBuiltin<"__nvvm_f2ll_rm">,
590       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
591   def int_nvvm_f2ll_rp_ftz : GCCBuiltin<"__nvvm_f2ll_rp_ftz">,
592       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
593   def int_nvvm_f2ll_rp : GCCBuiltin<"__nvvm_f2ll_rp">,
594       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
596   def int_nvvm_f2ull_rn_ftz : GCCBuiltin<"__nvvm_f2ull_rn_ftz">,
597       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
598   def int_nvvm_f2ull_rn : GCCBuiltin<"__nvvm_f2ull_rn">,
599       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
600   def int_nvvm_f2ull_rz_ftz : GCCBuiltin<"__nvvm_f2ull_rz_ftz">,
601       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
602   def int_nvvm_f2ull_rz : GCCBuiltin<"__nvvm_f2ull_rz">,
603       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
604   def int_nvvm_f2ull_rm_ftz : GCCBuiltin<"__nvvm_f2ull_rm_ftz">,
605       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
606   def int_nvvm_f2ull_rm : GCCBuiltin<"__nvvm_f2ull_rm">,
607       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
608   def int_nvvm_f2ull_rp_ftz : GCCBuiltin<"__nvvm_f2ull_rp_ftz">,
609       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
610   def int_nvvm_f2ull_rp : GCCBuiltin<"__nvvm_f2ull_rp">,
611       Intrinsic<[llvm_i64_ty], [llvm_float_ty], [IntrNoMem]>;
613   def int_nvvm_d2ll_rn : GCCBuiltin<"__nvvm_d2ll_rn">,
614       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
615   def int_nvvm_d2ll_rz : GCCBuiltin<"__nvvm_d2ll_rz">,
616       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
617   def int_nvvm_d2ll_rm : GCCBuiltin<"__nvvm_d2ll_rm">,
618       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
619   def int_nvvm_d2ll_rp : GCCBuiltin<"__nvvm_d2ll_rp">,
620       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
622   def int_nvvm_d2ull_rn : GCCBuiltin<"__nvvm_d2ull_rn">,
623       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
624   def int_nvvm_d2ull_rz : GCCBuiltin<"__nvvm_d2ull_rz">,
625       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
626   def int_nvvm_d2ull_rm : GCCBuiltin<"__nvvm_d2ull_rm">,
627       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
628   def int_nvvm_d2ull_rp : GCCBuiltin<"__nvvm_d2ull_rp">,
629       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
631   def int_nvvm_ll2f_rn : GCCBuiltin<"__nvvm_ll2f_rn">,
632       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
633   def int_nvvm_ll2f_rz : GCCBuiltin<"__nvvm_ll2f_rz">,
634       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
635   def int_nvvm_ll2f_rm : GCCBuiltin<"__nvvm_ll2f_rm">,
636       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
637   def int_nvvm_ll2f_rp : GCCBuiltin<"__nvvm_ll2f_rp">,
638       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
639   def int_nvvm_ull2f_rn : GCCBuiltin<"__nvvm_ull2f_rn">,
640       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
641   def int_nvvm_ull2f_rz : GCCBuiltin<"__nvvm_ull2f_rz">,
642       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
643   def int_nvvm_ull2f_rm : GCCBuiltin<"__nvvm_ull2f_rm">,
644       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
645   def int_nvvm_ull2f_rp : GCCBuiltin<"__nvvm_ull2f_rp">,
646       Intrinsic<[llvm_float_ty], [llvm_i64_ty], [IntrNoMem]>;
648   def int_nvvm_ll2d_rn : GCCBuiltin<"__nvvm_ll2d_rn">,
649       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
650   def int_nvvm_ll2d_rz : GCCBuiltin<"__nvvm_ll2d_rz">,
651       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
652   def int_nvvm_ll2d_rm : GCCBuiltin<"__nvvm_ll2d_rm">,
653       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
654   def int_nvvm_ll2d_rp : GCCBuiltin<"__nvvm_ll2d_rp">,
655       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
656   def int_nvvm_ull2d_rn : GCCBuiltin<"__nvvm_ull2d_rn">,
657       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
658   def int_nvvm_ull2d_rz : GCCBuiltin<"__nvvm_ull2d_rz">,
659       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
660   def int_nvvm_ull2d_rm : GCCBuiltin<"__nvvm_ull2d_rm">,
661       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
662   def int_nvvm_ull2d_rp : GCCBuiltin<"__nvvm_ull2d_rp">,
663       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
665   def int_nvvm_f2h_rn_ftz : GCCBuiltin<"__nvvm_f2h_rn_ftz">,
666       Intrinsic<[llvm_i16_ty], [llvm_float_ty], [IntrNoMem]>;
667   def int_nvvm_f2h_rn : GCCBuiltin<"__nvvm_f2h_rn">,
668       Intrinsic<[llvm_i16_ty], [llvm_float_ty], [IntrNoMem]>;
671 // Bitcast
674   def int_nvvm_bitcast_f2i : GCCBuiltin<"__nvvm_bitcast_f2i">,
675       Intrinsic<[llvm_i32_ty], [llvm_float_ty], [IntrNoMem]>;
676   def int_nvvm_bitcast_i2f : GCCBuiltin<"__nvvm_bitcast_i2f">,
677       Intrinsic<[llvm_float_ty], [llvm_i32_ty], [IntrNoMem]>;
679   def int_nvvm_bitcast_ll2d : GCCBuiltin<"__nvvm_bitcast_ll2d">,
680       Intrinsic<[llvm_double_ty], [llvm_i64_ty], [IntrNoMem]>;
681   def int_nvvm_bitcast_d2ll : GCCBuiltin<"__nvvm_bitcast_d2ll">,
682       Intrinsic<[llvm_i64_ty], [llvm_double_ty], [IntrNoMem]>;
684 // FNS
686   def int_nvvm_fns : GCCBuiltin<"__nvvm_fns">,
687       Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
688                 [IntrNoMem]>;
690 // Atomics not available as llvm intrinsics.
691   def int_nvvm_atomic_load_add_f32 : Intrinsic<[llvm_float_ty],
692           [LLVMAnyPointerType<llvm_float_ty>, llvm_float_ty],
693                                       [IntrArgMemOnly, NoCapture<0>]>;
694   // Atomic add of f64 requires sm_60.
695   def int_nvvm_atomic_load_add_f64 : Intrinsic<[llvm_double_ty],
696           [LLVMAnyPointerType<llvm_double_ty>, llvm_double_ty],
697                                       [IntrArgMemOnly, NoCapture<0>]>;
699   def int_nvvm_atomic_load_inc_32 : Intrinsic<[llvm_i32_ty],
700           [LLVMAnyPointerType<llvm_i32_ty>, llvm_i32_ty],
701                                       [IntrArgMemOnly, NoCapture<0>]>;
702   def int_nvvm_atomic_load_dec_32 : Intrinsic<[llvm_i32_ty],
703           [LLVMAnyPointerType<llvm_i32_ty>, llvm_i32_ty],
704                                       [IntrArgMemOnly, NoCapture<0>]>;
706   class SCOPED_ATOMIC2_impl<LLVMType elty>
707         : Intrinsic<[elty],
708           [LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>],
709           [IntrArgMemOnly, NoCapture<0>]>;
710   class SCOPED_ATOMIC3_impl<LLVMType elty>
711         : Intrinsic<[elty],
712           [LLVMAnyPointerType<LLVMMatchType<0>>, LLVMMatchType<0>,
713            LLVMMatchType<0>],
714           [IntrArgMemOnly, NoCapture<0>]>;
716   multiclass PTXAtomicWithScope2<LLVMType elty> {
717     def _cta : SCOPED_ATOMIC2_impl<elty>;
718     def _sys : SCOPED_ATOMIC2_impl<elty>;
719   }
720   multiclass PTXAtomicWithScope3<LLVMType elty> {
721     def _cta : SCOPED_ATOMIC3_impl<elty>;
722     def _sys : SCOPED_ATOMIC3_impl<elty>;
723   }
724   multiclass PTXAtomicWithScope2_fi {
725     defm _f: PTXAtomicWithScope2<llvm_anyfloat_ty>;
726     defm _i: PTXAtomicWithScope2<llvm_anyint_ty>;
727   }
728   defm int_nvvm_atomic_add_gen   : PTXAtomicWithScope2_fi;
729   defm int_nvvm_atomic_inc_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
730   defm int_nvvm_atomic_dec_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
731   defm int_nvvm_atomic_exch_gen_i: PTXAtomicWithScope2<llvm_anyint_ty>;
732   defm int_nvvm_atomic_xor_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
733   defm int_nvvm_atomic_max_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
734   defm int_nvvm_atomic_min_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
735   defm int_nvvm_atomic_or_gen_i  : PTXAtomicWithScope2<llvm_anyint_ty>;
736   defm int_nvvm_atomic_and_gen_i : PTXAtomicWithScope2<llvm_anyint_ty>;
737   defm int_nvvm_atomic_cas_gen_i : PTXAtomicWithScope3<llvm_anyint_ty>;
739 // Bar.Sync
741   // The builtin for "bar.sync 0" is called __syncthreads.  Unlike most of the
742   // intrinsics in this file, this one is a user-facing API.
743   def int_nvvm_barrier0 : GCCBuiltin<"__syncthreads">,
744       Intrinsic<[], [], [IntrConvergent]>;
745   // Synchronize all threads in the CTA at barrier 'n'.
746   def int_nvvm_barrier_n : GCCBuiltin<"__nvvm_bar_n">,
747       Intrinsic<[], [llvm_i32_ty], [IntrConvergent]>;
748   // Synchronize 'm', a multiple of warp size, (arg 2) threads in
749   // the CTA at barrier 'n' (arg 1).
750   def int_nvvm_barrier : GCCBuiltin<"__nvvm_bar">,
751       Intrinsic<[], [llvm_i32_ty, llvm_i32_ty], [IntrConvergent]>;
752   def int_nvvm_barrier0_popc : GCCBuiltin<"__nvvm_bar0_popc">,
753       Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrConvergent]>;
754   def int_nvvm_barrier0_and : GCCBuiltin<"__nvvm_bar0_and">,
755       Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrConvergent]>;
756   def int_nvvm_barrier0_or : GCCBuiltin<"__nvvm_bar0_or">,
757       Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrConvergent]>;
759   def int_nvvm_bar_sync :
760       Intrinsic<[], [llvm_i32_ty], [IntrConvergent]>,
761       GCCBuiltin<"__nvvm_bar_sync">;
762   def int_nvvm_bar_warp_sync :
763       Intrinsic<[], [llvm_i32_ty], [IntrConvergent]>,
764       GCCBuiltin<"__nvvm_bar_warp_sync">;
766   // barrier.sync id[, cnt]
767   def int_nvvm_barrier_sync :
768       Intrinsic<[], [llvm_i32_ty], [IntrConvergent]>,
769       GCCBuiltin<"__nvvm_barrier_sync">;
770   def int_nvvm_barrier_sync_cnt :
771       Intrinsic<[], [llvm_i32_ty, llvm_i32_ty], [IntrConvergent]>,
772       GCCBuiltin<"__nvvm_barrier_sync_cnt">;
774   // Membar
775   def int_nvvm_membar_cta : GCCBuiltin<"__nvvm_membar_cta">,
776       Intrinsic<[], [], []>;
777   def int_nvvm_membar_gl : GCCBuiltin<"__nvvm_membar_gl">,
778       Intrinsic<[], [], []>;
779   def int_nvvm_membar_sys : GCCBuiltin<"__nvvm_membar_sys">,
780       Intrinsic<[], [], []>;
782 // Generated within nvvm. Use for ldu on sm_20 or later.  Second arg is the
783 // pointer's alignment.
784 def int_nvvm_ldu_global_i : Intrinsic<[llvm_anyint_ty],
785   [LLVMAnyPointerType<LLVMMatchType<0>>, llvm_i32_ty],
786   [IntrReadMem, IntrArgMemOnly, NoCapture<0>],
787   "llvm.nvvm.ldu.global.i">;
788 def int_nvvm_ldu_global_f : Intrinsic<[llvm_anyfloat_ty],
789   [LLVMAnyPointerType<LLVMMatchType<0>>, llvm_i32_ty],
790   [IntrReadMem, IntrArgMemOnly, NoCapture<0>],
791   "llvm.nvvm.ldu.global.f">;
792 def int_nvvm_ldu_global_p : Intrinsic<[llvm_anyptr_ty],
793   [LLVMAnyPointerType<LLVMMatchType<0>>, llvm_i32_ty],
794   [IntrReadMem, IntrArgMemOnly, NoCapture<0>],
795   "llvm.nvvm.ldu.global.p">;
797 // Generated within nvvm. Use for ldg on sm_35 or later.  Second arg is the
798 // pointer's alignment.
799 def int_nvvm_ldg_global_i : Intrinsic<[llvm_anyint_ty],
800   [LLVMAnyPointerType<LLVMMatchType<0>>, llvm_i32_ty],
801   [IntrReadMem, IntrArgMemOnly, NoCapture<0>],
802   "llvm.nvvm.ldg.global.i">;
803 def int_nvvm_ldg_global_f : Intrinsic<[llvm_anyfloat_ty],
804   [LLVMAnyPointerType<LLVMMatchType<0>>, llvm_i32_ty],
805   [IntrReadMem, IntrArgMemOnly, NoCapture<0>],
806   "llvm.nvvm.ldg.global.f">;
807 def int_nvvm_ldg_global_p : Intrinsic<[llvm_anyptr_ty],
808   [LLVMAnyPointerType<LLVMMatchType<0>>, llvm_i32_ty],
809   [IntrReadMem, IntrArgMemOnly, NoCapture<0>],
810   "llvm.nvvm.ldg.global.p">;
812 // Use for generic pointers
813 // - These intrinsics are used to convert address spaces.
814 // - The input pointer and output pointer must have the same type, except for
815 //   the address-space. (This restriction is not enforced here as there is
816 //   currently no way to describe it).
817 // - This complements the llvm bitcast, which can be used to cast one type
818 //   of pointer to another type of pointer, while the address space remains
819 //   the same.
820 def int_nvvm_ptr_local_to_gen: Intrinsic<[llvm_anyptr_ty],
821                  [llvm_anyptr_ty], [IntrNoMem],
822                  "llvm.nvvm.ptr.local.to.gen">;
823 def int_nvvm_ptr_shared_to_gen: Intrinsic<[llvm_anyptr_ty],
824                  [llvm_anyptr_ty], [IntrNoMem],
825                  "llvm.nvvm.ptr.shared.to.gen">;
826 def int_nvvm_ptr_global_to_gen: Intrinsic<[llvm_anyptr_ty],
827                  [llvm_anyptr_ty], [IntrNoMem],
828                  "llvm.nvvm.ptr.global.to.gen">;
829 def int_nvvm_ptr_constant_to_gen: Intrinsic<[llvm_anyptr_ty],
830                  [llvm_anyptr_ty], [IntrNoMem],
831                  "llvm.nvvm.ptr.constant.to.gen">;
833 def int_nvvm_ptr_gen_to_global: Intrinsic<[llvm_anyptr_ty],
834                  [llvm_anyptr_ty], [IntrNoMem],
835                  "llvm.nvvm.ptr.gen.to.global">;
836 def int_nvvm_ptr_gen_to_shared: Intrinsic<[llvm_anyptr_ty],
837                  [llvm_anyptr_ty], [IntrNoMem],
838                  "llvm.nvvm.ptr.gen.to.shared">;
839 def int_nvvm_ptr_gen_to_local: Intrinsic<[llvm_anyptr_ty],
840                  [llvm_anyptr_ty], [IntrNoMem],
841                  "llvm.nvvm.ptr.gen.to.local">;
842 def int_nvvm_ptr_gen_to_constant: Intrinsic<[llvm_anyptr_ty],
843                  [llvm_anyptr_ty], [IntrNoMem],
844                  "llvm.nvvm.ptr.gen.to.constant">;
846 // Used in nvvm internally to help address space opt and ptx code generation
847 // This is for params that are passed to kernel functions by pointer by-val.
848 def int_nvvm_ptr_gen_to_param: Intrinsic<[llvm_anyptr_ty],
849                                      [llvm_anyptr_ty],
850                                    [IntrNoMem],
851                                    "llvm.nvvm.ptr.gen.to.param">;
853 // Move intrinsics, used in nvvm internally
855 def int_nvvm_move_i16 : Intrinsic<[llvm_i16_ty], [llvm_i16_ty], [IntrNoMem],
856   "llvm.nvvm.move.i16">;
857 def int_nvvm_move_i32 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem],
858   "llvm.nvvm.move.i32">;
859 def int_nvvm_move_i64 : Intrinsic<[llvm_i64_ty], [llvm_i64_ty], [IntrNoMem],
860   "llvm.nvvm.move.i64">;
861 def int_nvvm_move_float : Intrinsic<[llvm_float_ty], [llvm_float_ty],
862   [IntrNoMem], "llvm.nvvm.move.float">;
863 def int_nvvm_move_double : Intrinsic<[llvm_double_ty], [llvm_double_ty],
864   [IntrNoMem], "llvm.nvvm.move.double">;
865 def int_nvvm_move_ptr : Intrinsic<[llvm_anyptr_ty], [llvm_anyptr_ty],
866   [IntrNoMem, NoCapture<0>], "llvm.nvvm.move.ptr">;
869 // For getting the handle from a texture or surface variable
870 def int_nvvm_texsurf_handle
871   : Intrinsic<[llvm_i64_ty], [llvm_metadata_ty, llvm_anyi64ptr_ty],
872               [IntrNoMem], "llvm.nvvm.texsurf.handle">;
873 def int_nvvm_texsurf_handle_internal
874   : Intrinsic<[llvm_i64_ty], [llvm_anyptr_ty],
875               [IntrNoMem], "llvm.nvvm.texsurf.handle.internal">;
877 /// Error / Warn
878 def int_nvvm_compiler_error :
879     Intrinsic<[], [llvm_anyptr_ty], [], "llvm.nvvm.compiler.error">;
880 def int_nvvm_compiler_warn :
881     Intrinsic<[], [llvm_anyptr_ty], [], "llvm.nvvm.compiler.warn">;
883 def int_nvvm_reflect :
884   Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty], [IntrNoMem], "llvm.nvvm.reflect">;
886 // isspacep.{const, global, local, shared}
887 def int_nvvm_isspacep_const
888   : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty], [IntrNoMem],
889               "llvm.nvvm.isspacep.const">,
890     GCCBuiltin<"__nvvm_isspacep_const">;
891 def int_nvvm_isspacep_global
892   : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty], [IntrNoMem],
893               "llvm.nvvm.isspacep.global">,
894     GCCBuiltin<"__nvvm_isspacep_global">;
895 def int_nvvm_isspacep_local
896   : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty], [IntrNoMem],
897               "llvm.nvvm.isspacep.local">,
898     GCCBuiltin<"__nvvm_isspacep_local">;
899 def int_nvvm_isspacep_shared
900   : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty], [IntrNoMem],
901               "llvm.nvvm.isspacep.shared">,
902     GCCBuiltin<"__nvvm_isspacep_shared">;
904 // Environment register read
905 def int_nvvm_read_ptx_sreg_envreg0
906   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
907               "llvm.nvvm.read.ptx.sreg.envreg0">,
908     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg0">;
909 def int_nvvm_read_ptx_sreg_envreg1
910   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
911               "llvm.nvvm.read.ptx.sreg.envreg1">,
912     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg1">;
913 def int_nvvm_read_ptx_sreg_envreg2
914   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
915               "llvm.nvvm.read.ptx.sreg.envreg2">,
916     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg2">;
917 def int_nvvm_read_ptx_sreg_envreg3
918   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
919               "llvm.nvvm.read.ptx.sreg.envreg3">,
920     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg3">;
921 def int_nvvm_read_ptx_sreg_envreg4
922   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
923               "llvm.nvvm.read.ptx.sreg.envreg4">,
924     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg4">;
925 def int_nvvm_read_ptx_sreg_envreg5
926   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
927               "llvm.nvvm.read.ptx.sreg.envreg5">,
928     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg5">;
929 def int_nvvm_read_ptx_sreg_envreg6
930   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
931               "llvm.nvvm.read.ptx.sreg.envreg6">,
932     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg6">;
933 def int_nvvm_read_ptx_sreg_envreg7
934   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
935               "llvm.nvvm.read.ptx.sreg.envreg7">,
936     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg7">;
937 def int_nvvm_read_ptx_sreg_envreg8
938   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
939               "llvm.nvvm.read.ptx.sreg.envreg8">,
940     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg8">;
941 def int_nvvm_read_ptx_sreg_envreg9
942   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
943               "llvm.nvvm.read.ptx.sreg.envreg9">,
944     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg9">;
945 def int_nvvm_read_ptx_sreg_envreg10
946   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
947               "llvm.nvvm.read.ptx.sreg.envreg10">,
948     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg10">;
949 def int_nvvm_read_ptx_sreg_envreg11
950   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
951               "llvm.nvvm.read.ptx.sreg.envreg11">,
952     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg11">;
953 def int_nvvm_read_ptx_sreg_envreg12
954   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
955               "llvm.nvvm.read.ptx.sreg.envreg12">,
956     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg12">;
957 def int_nvvm_read_ptx_sreg_envreg13
958   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
959               "llvm.nvvm.read.ptx.sreg.envreg13">,
960     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg13">;
961 def int_nvvm_read_ptx_sreg_envreg14
962   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
963               "llvm.nvvm.read.ptx.sreg.envreg14">,
964     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg14">;
965 def int_nvvm_read_ptx_sreg_envreg15
966   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
967               "llvm.nvvm.read.ptx.sreg.envreg15">,
968     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg15">;
969 def int_nvvm_read_ptx_sreg_envreg16
970   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
971               "llvm.nvvm.read.ptx.sreg.envreg16">,
972     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg16">;
973 def int_nvvm_read_ptx_sreg_envreg17
974   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
975               "llvm.nvvm.read.ptx.sreg.envreg17">,
976     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg17">;
977 def int_nvvm_read_ptx_sreg_envreg18
978   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
979               "llvm.nvvm.read.ptx.sreg.envreg18">,
980     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg18">;
981 def int_nvvm_read_ptx_sreg_envreg19
982   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
983               "llvm.nvvm.read.ptx.sreg.envreg19">,
984     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg19">;
985 def int_nvvm_read_ptx_sreg_envreg20
986   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
987               "llvm.nvvm.read.ptx.sreg.envreg20">,
988     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg20">;
989 def int_nvvm_read_ptx_sreg_envreg21
990   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
991               "llvm.nvvm.read.ptx.sreg.envreg21">,
992     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg21">;
993 def int_nvvm_read_ptx_sreg_envreg22
994   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
995               "llvm.nvvm.read.ptx.sreg.envreg22">,
996     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg22">;
997 def int_nvvm_read_ptx_sreg_envreg23
998   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
999               "llvm.nvvm.read.ptx.sreg.envreg23">,
1000     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg23">;
1001 def int_nvvm_read_ptx_sreg_envreg24
1002   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1003               "llvm.nvvm.read.ptx.sreg.envreg24">,
1004     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg24">;
1005 def int_nvvm_read_ptx_sreg_envreg25
1006   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1007               "llvm.nvvm.read.ptx.sreg.envreg25">,
1008     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg25">;
1009 def int_nvvm_read_ptx_sreg_envreg26
1010   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1011               "llvm.nvvm.read.ptx.sreg.envreg26">,
1012     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg26">;
1013 def int_nvvm_read_ptx_sreg_envreg27
1014   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1015               "llvm.nvvm.read.ptx.sreg.envreg27">,
1016     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg27">;
1017 def int_nvvm_read_ptx_sreg_envreg28
1018   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1019               "llvm.nvvm.read.ptx.sreg.envreg28">,
1020     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg28">;
1021 def int_nvvm_read_ptx_sreg_envreg29
1022   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1023               "llvm.nvvm.read.ptx.sreg.envreg29">,
1024     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg29">;
1025 def int_nvvm_read_ptx_sreg_envreg30
1026   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1027               "llvm.nvvm.read.ptx.sreg.envreg30">,
1028     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg30">;
1029 def int_nvvm_read_ptx_sreg_envreg31
1030   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem],
1031               "llvm.nvvm.read.ptx.sreg.envreg31">,
1032     GCCBuiltin<"__nvvm_read_ptx_sreg_envreg31">;
1035 // Texture Fetch
1036 // texmode_independent
1037 def int_nvvm_tex_1d_v4f32_s32
1038   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1039               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty], [],
1040               "llvm.nvvm.tex.1d.v4f32.s32">;
1041 def int_nvvm_tex_1d_v4f32_f32
1042   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1043               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty], [],
1044               "llvm.nvvm.tex.1d.v4f32.f32">;
1045 def int_nvvm_tex_1d_level_v4f32_f32
1046   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1047               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1048               "llvm.nvvm.tex.1d.level.v4f32.f32">;
1049 def int_nvvm_tex_1d_grad_v4f32_f32
1050   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1051               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1052                llvm_float_ty], [],
1053               "llvm.nvvm.tex.1d.grad.v4f32.f32">;
1054 def int_nvvm_tex_1d_v4s32_s32
1055   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1056               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty], [],
1057               "llvm.nvvm.tex.1d.v4s32.s32">;
1058 def int_nvvm_tex_1d_v4s32_f32
1059   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1060               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty], [],
1061               "llvm.nvvm.tex.1d.v4s32.f32">;
1062 def int_nvvm_tex_1d_level_v4s32_f32
1063   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1064               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1065               "llvm.nvvm.tex.1d.level.v4s32.f32">;
1066 def int_nvvm_tex_1d_grad_v4s32_f32
1067   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1068               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1069                llvm_float_ty], [],
1070               "llvm.nvvm.tex.1d.grad.v4s32.f32">;
1071 def int_nvvm_tex_1d_v4u32_s32
1072   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1073               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty], [],
1074               "llvm.nvvm.tex.1d.v4u32.s32">;
1075 def int_nvvm_tex_1d_v4u32_f32
1076   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1077               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty], [],
1078               "llvm.nvvm.tex.1d.v4u32.f32">;
1079 def int_nvvm_tex_1d_level_v4u32_f32
1080   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1081               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1082               "llvm.nvvm.tex.1d.level.v4u32.f32">;
1083 def int_nvvm_tex_1d_grad_v4u32_f32
1084   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1085               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1086                llvm_float_ty], [],
1087               "llvm.nvvm.tex.1d.grad.v4u32.f32">;
1089 def int_nvvm_tex_1d_array_v4f32_s32
1090   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1091               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1092               "llvm.nvvm.tex.1d.array.v4f32.s32">;
1093 def int_nvvm_tex_1d_array_v4f32_f32
1094   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1095               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty], [],
1096               "llvm.nvvm.tex.1d.array.v4f32.f32">;
1097 def int_nvvm_tex_1d_array_level_v4f32_f32
1098   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1099               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1100                llvm_float_ty], [],
1101               "llvm.nvvm.tex.1d.array.level.v4f32.f32">;
1102 def int_nvvm_tex_1d_array_grad_v4f32_f32
1103   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1104               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1105                llvm_float_ty, llvm_float_ty], [],
1106               "llvm.nvvm.tex.1d.array.grad.v4f32.f32">;
1107 def int_nvvm_tex_1d_array_v4s32_s32
1108   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1109               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1110               "llvm.nvvm.tex.1d.array.v4s32.s32">;
1111 def int_nvvm_tex_1d_array_v4s32_f32
1112   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1113               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty], [],
1114               "llvm.nvvm.tex.1d.array.v4s32.f32">;
1115 def int_nvvm_tex_1d_array_level_v4s32_f32
1116   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1117               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1118                llvm_float_ty], [],
1119               "llvm.nvvm.tex.1d.array.level.v4s32.f32">;
1120 def int_nvvm_tex_1d_array_grad_v4s32_f32
1121   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1122               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1123                llvm_float_ty, llvm_float_ty], [],
1124               "llvm.nvvm.tex.1d.array.grad.v4s32.f32">;
1125 def int_nvvm_tex_1d_array_v4u32_s32
1126   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1127               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1128               "llvm.nvvm.tex.1d.array.v4u32.s32">;
1129 def int_nvvm_tex_1d_array_v4u32_f32
1130   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1131               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty], [],
1132               "llvm.nvvm.tex.1d.array.v4u32.f32">;
1133 def int_nvvm_tex_1d_array_level_v4u32_f32
1134   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1135               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1136                llvm_float_ty], [],
1137               "llvm.nvvm.tex.1d.array.level.v4u32.f32">;
1138 def int_nvvm_tex_1d_array_grad_v4u32_f32
1139   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1140               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1141                llvm_float_ty, llvm_float_ty], [],
1142               "llvm.nvvm.tex.1d.array.grad.v4u32.f32">;
1144 def int_nvvm_tex_2d_v4f32_s32
1145   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1146               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1147               "llvm.nvvm.tex.2d.v4f32.s32">;
1148 def int_nvvm_tex_2d_v4f32_f32
1149   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1150               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1151               "llvm.nvvm.tex.2d.v4f32.f32">;
1152 def int_nvvm_tex_2d_level_v4f32_f32
1153   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1154               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1155                llvm_float_ty], [],
1156               "llvm.nvvm.tex.2d.level.v4f32.f32">;
1157 def int_nvvm_tex_2d_grad_v4f32_f32
1158   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1159               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1160                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1161               "llvm.nvvm.tex.2d.grad.v4f32.f32">;
1162 def int_nvvm_tex_2d_v4s32_s32
1163   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1164               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1165               "llvm.nvvm.tex.2d.v4s32.s32">;
1166 def int_nvvm_tex_2d_v4s32_f32
1167   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1168               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1169               "llvm.nvvm.tex.2d.v4s32.f32">;
1170 def int_nvvm_tex_2d_level_v4s32_f32
1171   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1172               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1173                llvm_float_ty], [],
1174               "llvm.nvvm.tex.2d.level.v4s32.f32">;
1175 def int_nvvm_tex_2d_grad_v4s32_f32
1176   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1177               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1178                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1179               "llvm.nvvm.tex.2d.grad.v4s32.f32">;
1180 def int_nvvm_tex_2d_v4u32_s32
1181   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1182               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1183               "llvm.nvvm.tex.2d.v4u32.s32">;
1184 def int_nvvm_tex_2d_v4u32_f32
1185   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1186               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1187               "llvm.nvvm.tex.2d.v4u32.f32">;
1188 def int_nvvm_tex_2d_level_v4u32_f32
1189   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1190               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1191                llvm_float_ty], [],
1192               "llvm.nvvm.tex.2d.level.v4u32.f32">;
1193 def int_nvvm_tex_2d_grad_v4u32_f32
1194   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1195               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1196                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1197               "llvm.nvvm.tex.2d.grad.v4u32.f32">;
1199 def int_nvvm_tex_2d_array_v4f32_s32
1200   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1201               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
1202                llvm_i32_ty], [],
1203               "llvm.nvvm.tex.2d.array.v4f32.s32">;
1204 def int_nvvm_tex_2d_array_v4f32_f32
1205   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1206               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1207                llvm_float_ty], [],
1208               "llvm.nvvm.tex.2d.array.v4f32.f32">;
1209 def int_nvvm_tex_2d_array_level_v4f32_f32
1210   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1211               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1212                llvm_float_ty, llvm_float_ty], [],
1213               "llvm.nvvm.tex.2d.array.level.v4f32.f32">;
1214 def int_nvvm_tex_2d_array_grad_v4f32_f32
1215   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1216               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1217                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1218                llvm_float_ty], [],
1219               "llvm.nvvm.tex.2d.array.grad.v4f32.f32">;
1220 def int_nvvm_tex_2d_array_v4s32_s32
1221   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1222               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
1223                llvm_i32_ty], [],
1224               "llvm.nvvm.tex.2d.array.v4s32.s32">;
1225 def int_nvvm_tex_2d_array_v4s32_f32
1226   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1227               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1228                llvm_float_ty], [],
1229               "llvm.nvvm.tex.2d.array.v4s32.f32">;
1230 def int_nvvm_tex_2d_array_level_v4s32_f32
1231   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1232               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1233                llvm_float_ty, llvm_float_ty], [],
1234               "llvm.nvvm.tex.2d.array.level.v4s32.f32">;
1235 def int_nvvm_tex_2d_array_grad_v4s32_f32
1236   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1237               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1238                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1239                llvm_float_ty], [],
1240               "llvm.nvvm.tex.2d.array.grad.v4s32.f32">;
1241 def int_nvvm_tex_2d_array_v4u32_s32
1242   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1243               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
1244                llvm_i32_ty], [],
1245               "llvm.nvvm.tex.2d.array.v4u32.s32">;
1246 def int_nvvm_tex_2d_array_v4u32_f32
1247   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1248               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1249                llvm_float_ty], [],
1250               "llvm.nvvm.tex.2d.array.v4u32.f32">;
1251 def int_nvvm_tex_2d_array_level_v4u32_f32
1252   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1253               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1254                llvm_float_ty, llvm_float_ty], [],
1255               "llvm.nvvm.tex.2d.array.level.v4u32.f32">;
1256 def int_nvvm_tex_2d_array_grad_v4u32_f32
1257   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1258               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1259                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1260                llvm_float_ty], [],
1261               "llvm.nvvm.tex.2d.array.grad.v4u32.f32">;
1263 def int_nvvm_tex_3d_v4f32_s32
1264   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1265               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1266               [], "llvm.nvvm.tex.3d.v4f32.s32">;
1267 def int_nvvm_tex_3d_v4f32_f32
1268   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1269               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1270                llvm_float_ty], [],
1271               "llvm.nvvm.tex.3d.v4f32.f32">;
1272 def int_nvvm_tex_3d_level_v4f32_f32
1273   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1274               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1275                llvm_float_ty, llvm_float_ty], [],
1276               "llvm.nvvm.tex.3d.level.v4f32.f32">;
1277 def int_nvvm_tex_3d_grad_v4f32_f32
1278   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1279               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1280                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1281                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1282               "llvm.nvvm.tex.3d.grad.v4f32.f32">;
1283 def int_nvvm_tex_3d_v4s32_s32
1284   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1285               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1286               [], "llvm.nvvm.tex.3d.v4s32.s32">;
1287 def int_nvvm_tex_3d_v4s32_f32
1288   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1289               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1290                llvm_float_ty], [],
1291               "llvm.nvvm.tex.3d.v4s32.f32">;
1292 def int_nvvm_tex_3d_level_v4s32_f32
1293   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1294               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1295                llvm_float_ty, llvm_float_ty], [],
1296               "llvm.nvvm.tex.3d.level.v4s32.f32">;
1297 def int_nvvm_tex_3d_grad_v4s32_f32
1298   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1299               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1300                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1301                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1302               "llvm.nvvm.tex.3d.grad.v4s32.f32">;
1303 def int_nvvm_tex_3d_v4u32_s32
1304   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1305               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1306               [], "llvm.nvvm.tex.3d.v4u32.s32">;
1307 def int_nvvm_tex_3d_v4u32_f32
1308   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1309               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1310                llvm_float_ty], [],
1311               "llvm.nvvm.tex.3d.v4u32.f32">;
1312 def int_nvvm_tex_3d_level_v4u32_f32
1313   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1314               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1315                llvm_float_ty, llvm_float_ty], [],
1316               "llvm.nvvm.tex.3d.level.v4u32.f32">;
1317 def int_nvvm_tex_3d_grad_v4u32_f32
1318   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1319               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1320                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1321                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1322               "llvm.nvvm.tex.3d.grad.v4u32.f32">;
1324 def int_nvvm_tex_cube_v4f32_f32
1325   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1326               [llvm_i64_ty, llvm_i64_ty,
1327                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1328               "llvm.nvvm.tex.cube.v4f32.f32">;
1329 def int_nvvm_tex_cube_level_v4f32_f32
1330   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1331               [llvm_i64_ty, llvm_i64_ty,
1332                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1333               "llvm.nvvm.tex.cube.level.v4f32.f32">;
1334 def int_nvvm_tex_cube_v4s32_f32
1335   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1336               [llvm_i64_ty, llvm_i64_ty,
1337                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1338               "llvm.nvvm.tex.cube.v4s32.f32">;
1339 def int_nvvm_tex_cube_level_v4s32_f32
1340   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1341               [llvm_i64_ty, llvm_i64_ty,
1342                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1343               "llvm.nvvm.tex.cube.level.v4s32.f32">;
1344 def int_nvvm_tex_cube_v4u32_f32
1345   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1346               [llvm_i64_ty, llvm_i64_ty,
1347                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1348               "llvm.nvvm.tex.cube.v4u32.f32">;
1349 def int_nvvm_tex_cube_level_v4u32_f32
1350   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1351               [llvm_i64_ty, llvm_i64_ty,
1352                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1353               "llvm.nvvm.tex.cube.level.v4u32.f32">;
1355 def int_nvvm_tex_cube_array_v4f32_f32
1356   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1357               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty,
1358                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1359               "llvm.nvvm.tex.cube.array.v4f32.f32">;
1360 def int_nvvm_tex_cube_array_level_v4f32_f32
1361   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1362               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty,
1363                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1364               "llvm.nvvm.tex.cube.array.level.v4f32.f32">;
1365 def int_nvvm_tex_cube_array_v4s32_f32
1366   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1367               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty,
1368                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1369               "llvm.nvvm.tex.cube.array.v4s32.f32">;
1370 def int_nvvm_tex_cube_array_level_v4s32_f32
1371   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1372               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty,
1373                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1374               "llvm.nvvm.tex.cube.array.level.v4s32.f32">;
1375 def int_nvvm_tex_cube_array_v4u32_f32
1376   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1377               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty,
1378                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1379               "llvm.nvvm.tex.cube.array.v4u32.f32">;
1380 def int_nvvm_tex_cube_array_level_v4u32_f32
1381   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1382               [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty,
1383                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1384               "llvm.nvvm.tex.cube.array.level.v4u32.f32">;
1386 def int_nvvm_tld4_r_2d_v4f32_f32
1387   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1388               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1389               "llvm.nvvm.tld4.r.2d.v4f32.f32">;
1390 def int_nvvm_tld4_g_2d_v4f32_f32
1391   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1392               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1393               "llvm.nvvm.tld4.g.2d.v4f32.f32">;
1394 def int_nvvm_tld4_b_2d_v4f32_f32
1395   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1396               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1397               "llvm.nvvm.tld4.b.2d.v4f32.f32">;
1398 def int_nvvm_tld4_a_2d_v4f32_f32
1399   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1400               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1401               "llvm.nvvm.tld4.a.2d.v4f32.f32">;
1402 def int_nvvm_tld4_r_2d_v4s32_f32
1403   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1404               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1405               "llvm.nvvm.tld4.r.2d.v4s32.f32">;
1406 def int_nvvm_tld4_g_2d_v4s32_f32
1407   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1408               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1409               "llvm.nvvm.tld4.g.2d.v4s32.f32">;
1410 def int_nvvm_tld4_b_2d_v4s32_f32
1411   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1412               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1413               "llvm.nvvm.tld4.b.2d.v4s32.f32">;
1414 def int_nvvm_tld4_a_2d_v4s32_f32
1415   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1416               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1417               "llvm.nvvm.tld4.a.2d.v4s32.f32">;
1418 def int_nvvm_tld4_r_2d_v4u32_f32
1419   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1420               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1421               "llvm.nvvm.tld4.r.2d.v4u32.f32">;
1422 def int_nvvm_tld4_g_2d_v4u32_f32
1423   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1424               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1425               "llvm.nvvm.tld4.g.2d.v4u32.f32">;
1426 def int_nvvm_tld4_b_2d_v4u32_f32
1427   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1428               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1429               "llvm.nvvm.tld4.b.2d.v4u32.f32">;
1430 def int_nvvm_tld4_a_2d_v4u32_f32
1431   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1432               [llvm_i64_ty, llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1433               "llvm.nvvm.tld4.a.2d.v4u32.f32">;
1436 // texmode_unified
1437 def int_nvvm_tex_unified_1d_v4f32_s32
1438   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1439               [llvm_i64_ty, llvm_i32_ty], [],
1440               "llvm.nvvm.tex.unified.1d.v4f32.s32">;
1441 def int_nvvm_tex_unified_1d_v4f32_f32
1442   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1443               [llvm_i64_ty, llvm_float_ty], [],
1444               "llvm.nvvm.tex.unified.1d.v4f32.f32">;
1445 def int_nvvm_tex_unified_1d_level_v4f32_f32
1446   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1447               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1448               "llvm.nvvm.tex.unified.1d.level.v4f32.f32">;
1449 def int_nvvm_tex_unified_1d_grad_v4f32_f32
1450   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1451               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1452                llvm_float_ty], [],
1453               "llvm.nvvm.tex.unified.1d.grad.v4f32.f32">;
1454 def int_nvvm_tex_unified_1d_v4s32_s32
1455   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1456               [llvm_i64_ty, llvm_i32_ty], [],
1457               "llvm.nvvm.tex.unified.1d.v4s32.s32">;
1458 def int_nvvm_tex_unified_1d_v4s32_f32
1459   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1460               [llvm_i64_ty, llvm_float_ty], [],
1461               "llvm.nvvm.tex.unified.1d.v4s32.f32">;
1462 def int_nvvm_tex_unified_1d_level_v4s32_f32
1463   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1464               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1465               "llvm.nvvm.tex.unified.1d.level.v4s32.f32">;
1466 def int_nvvm_tex_unified_1d_grad_v4s32_f32
1467   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1468               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1469                llvm_float_ty], [],
1470               "llvm.nvvm.tex.unified.1d.grad.v4s32.f32">;
1471 def int_nvvm_tex_unified_1d_v4u32_s32
1472   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1473               [llvm_i64_ty, llvm_i32_ty], [],
1474               "llvm.nvvm.tex.unified.1d.v4u32.s32">;
1475 def int_nvvm_tex_unified_1d_v4u32_f32
1476   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1477               [llvm_i64_ty, llvm_float_ty], [],
1478               "llvm.nvvm.tex.unified.1d.v4u32.f32">;
1479 def int_nvvm_tex_unified_1d_level_v4u32_f32
1480   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1481               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1482               "llvm.nvvm.tex.unified.1d.level.v4u32.f32">;
1483 def int_nvvm_tex_unified_1d_grad_v4u32_f32
1484   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1485               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1486                llvm_float_ty], [],
1487               "llvm.nvvm.tex.unified.1d.grad.v4u32.f32">;
1489 def int_nvvm_tex_unified_1d_array_v4f32_s32
1490   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1491               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1492               "llvm.nvvm.tex.unified.1d.array.v4f32.s32">;
1493 def int_nvvm_tex_unified_1d_array_v4f32_f32
1494   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1495               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty], [],
1496               "llvm.nvvm.tex.unified.1d.array.v4f32.f32">;
1497 def int_nvvm_tex_unified_1d_array_level_v4f32_f32
1498   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1499               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1500                llvm_float_ty], [],
1501               "llvm.nvvm.tex.unified.1d.array.level.v4f32.f32">;
1502 def int_nvvm_tex_unified_1d_array_grad_v4f32_f32
1503   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1504               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1505                llvm_float_ty, llvm_float_ty], [],
1506               "llvm.nvvm.tex.unified.1d.array.grad.v4f32.f32">;
1507 def int_nvvm_tex_unified_1d_array_v4s32_s32
1508   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1509               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1510               "llvm.nvvm.tex.unified.1d.array.v4s32.s32">;
1511 def int_nvvm_tex_unified_1d_array_v4s32_f32
1512   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1513               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty], [],
1514               "llvm.nvvm.tex.unified.1d.array.v4s32.f32">;
1515 def int_nvvm_tex_unified_1d_array_level_v4s32_f32
1516   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1517               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1518                llvm_float_ty], [],
1519               "llvm.nvvm.tex.unified.1d.array.level.v4s32.f32">;
1520 def int_nvvm_tex_unified_1d_array_grad_v4s32_f32
1521   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1522               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1523                llvm_float_ty, llvm_float_ty], [],
1524               "llvm.nvvm.tex.unified.1d.array.grad.v4s32.f32">;
1525 def int_nvvm_tex_unified_1d_array_v4u32_s32
1526   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1527               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1528               "llvm.nvvm.tex.unified.1d.array.v4u32.s32">;
1529 def int_nvvm_tex_unified_1d_array_v4u32_f32
1530   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1531               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty], [],
1532               "llvm.nvvm.tex.unified.1d.array.v4u32.f32">;
1533 def int_nvvm_tex_unified_1d_array_level_v4u32_f32
1534   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1535               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1536                llvm_float_ty], [],
1537               "llvm.nvvm.tex.unified.1d.array.level.v4u32.f32">;
1538 def int_nvvm_tex_unified_1d_array_grad_v4u32_f32
1539   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1540               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1541                llvm_float_ty, llvm_float_ty], [],
1542               "llvm.nvvm.tex.unified.1d.array.grad.v4u32.f32">;
1544 def int_nvvm_tex_unified_2d_v4f32_s32
1545   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1546               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1547               "llvm.nvvm.tex.unified.2d.v4f32.s32">;
1548 def int_nvvm_tex_unified_2d_v4f32_f32
1549   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1550               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1551               "llvm.nvvm.tex.unified.2d.v4f32.f32">;
1552 def int_nvvm_tex_unified_2d_level_v4f32_f32
1553   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1554               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1555                llvm_float_ty], [],
1556               "llvm.nvvm.tex.unified.2d.level.v4f32.f32">;
1557 def int_nvvm_tex_unified_2d_grad_v4f32_f32
1558   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1559               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1560                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1561               "llvm.nvvm.tex.unified.2d.grad.v4f32.f32">;
1562 def int_nvvm_tex_unified_2d_v4s32_s32
1563   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1564               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1565               "llvm.nvvm.tex.unified.2d.v4s32.s32">;
1566 def int_nvvm_tex_unified_2d_v4s32_f32
1567   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1568               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1569               "llvm.nvvm.tex.unified.2d.v4s32.f32">;
1570 def int_nvvm_tex_unified_2d_level_v4s32_f32
1571   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1572               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1573                llvm_float_ty], [],
1574               "llvm.nvvm.tex.unified.2d.level.v4s32.f32">;
1575 def int_nvvm_tex_unified_2d_grad_v4s32_f32
1576   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1577               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1578                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1579               "llvm.nvvm.tex.unified.2d.grad.v4s32.f32">;
1580 def int_nvvm_tex_unified_2d_v4u32_s32
1581   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1582               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1583               "llvm.nvvm.tex.unified.2d.v4u32.s32">;
1584 def int_nvvm_tex_unified_2d_v4u32_f32
1585   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1586               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1587               "llvm.nvvm.tex.unified.2d.v4u32.f32">;
1588 def int_nvvm_tex_unified_2d_level_v4u32_f32
1589   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1590               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1591                llvm_float_ty], [],
1592               "llvm.nvvm.tex.unified.2d.level.v4u32.f32">;
1593 def int_nvvm_tex_unified_2d_grad_v4u32_f32
1594   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1595               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1596                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1597               "llvm.nvvm.tex.unified.2d.grad.v4u32.f32">;
1599 def int_nvvm_tex_unified_2d_array_v4f32_s32
1600   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1601               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
1602                llvm_i32_ty], [],
1603               "llvm.nvvm.tex.unified.2d.array.v4f32.s32">;
1604 def int_nvvm_tex_unified_2d_array_v4f32_f32
1605   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1606               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1607                llvm_float_ty], [],
1608               "llvm.nvvm.tex.unified.2d.array.v4f32.f32">;
1609 def int_nvvm_tex_unified_2d_array_level_v4f32_f32
1610   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1611               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1612                llvm_float_ty, llvm_float_ty], [],
1613               "llvm.nvvm.tex.unified.2d.array.level.v4f32.f32">;
1614 def int_nvvm_tex_unified_2d_array_grad_v4f32_f32
1615   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1616               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1617                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1618                llvm_float_ty], [],
1619               "llvm.nvvm.tex.unified.2d.array.grad.v4f32.f32">;
1620 def int_nvvm_tex_unified_2d_array_v4s32_s32
1621   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1622               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
1623                llvm_i32_ty], [],
1624               "llvm.nvvm.tex.unified.2d.array.v4s32.s32">;
1625 def int_nvvm_tex_unified_2d_array_v4s32_f32
1626   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1627               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1628                llvm_float_ty], [],
1629               "llvm.nvvm.tex.unified.2d.array.v4s32.f32">;
1630 def int_nvvm_tex_unified_2d_array_level_v4s32_f32
1631   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1632               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1633                llvm_float_ty, llvm_float_ty], [],
1634               "llvm.nvvm.tex.unified.2d.array.level.v4s32.f32">;
1635 def int_nvvm_tex_unified_2d_array_grad_v4s32_f32
1636   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1637               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1638                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1639                llvm_float_ty], [],
1640               "llvm.nvvm.tex.unified.2d.array.grad.v4s32.f32">;
1641 def int_nvvm_tex_unified_2d_array_v4u32_s32
1642   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1643               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
1644                llvm_i32_ty], [],
1645               "llvm.nvvm.tex.unified.2d.array.v4u32.s32">;
1646 def int_nvvm_tex_unified_2d_array_v4u32_f32
1647   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1648               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1649                llvm_float_ty], [],
1650               "llvm.nvvm.tex.unified.2d.array.v4u32.f32">;
1651 def int_nvvm_tex_unified_2d_array_level_v4u32_f32
1652   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1653               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1654                llvm_float_ty, llvm_float_ty], [],
1655               "llvm.nvvm.tex.unified.2d.array.level.v4u32.f32">;
1656 def int_nvvm_tex_unified_2d_array_grad_v4u32_f32
1657   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1658               [llvm_i64_ty, llvm_i32_ty, llvm_float_ty,
1659                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1660                llvm_float_ty], [],
1661               "llvm.nvvm.tex.unified.2d.array.grad.v4u32.f32">;
1663 def int_nvvm_tex_unified_3d_v4f32_s32
1664   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1665               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1666               [], "llvm.nvvm.tex.unified.3d.v4f32.s32">;
1667 def int_nvvm_tex_unified_3d_v4f32_f32
1668   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1669               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1670                llvm_float_ty], [],
1671               "llvm.nvvm.tex.unified.3d.v4f32.f32">;
1672 def int_nvvm_tex_unified_3d_level_v4f32_f32
1673   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1674               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1675                llvm_float_ty, llvm_float_ty], [],
1676               "llvm.nvvm.tex.unified.3d.level.v4f32.f32">;
1677 def int_nvvm_tex_unified_3d_grad_v4f32_f32
1678   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1679               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1680                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1681                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1682               "llvm.nvvm.tex.unified.3d.grad.v4f32.f32">;
1683 def int_nvvm_tex_unified_3d_v4s32_s32
1684   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1685               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1686               [], "llvm.nvvm.tex.unified.3d.v4s32.s32">;
1687 def int_nvvm_tex_unified_3d_v4s32_f32
1688   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1689               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1690                llvm_float_ty], [],
1691               "llvm.nvvm.tex.unified.3d.v4s32.f32">;
1692 def int_nvvm_tex_unified_3d_level_v4s32_f32
1693   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1694               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1695                llvm_float_ty, llvm_float_ty], [],
1696               "llvm.nvvm.tex.unified.3d.level.v4s32.f32">;
1697 def int_nvvm_tex_unified_3d_grad_v4s32_f32
1698   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1699               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1700                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1701                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1702               "llvm.nvvm.tex.unified.3d.grad.v4s32.f32">;
1703 def int_nvvm_tex_unified_3d_v4u32_s32
1704   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1705               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1706               [], "llvm.nvvm.tex.unified.3d.v4u32.s32">;
1707 def int_nvvm_tex_unified_3d_v4u32_f32
1708   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1709               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1710                llvm_float_ty], [],
1711               "llvm.nvvm.tex.unified.3d.v4u32.f32">;
1712 def int_nvvm_tex_unified_3d_level_v4u32_f32
1713   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1714               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1715                llvm_float_ty, llvm_float_ty], [],
1716               "llvm.nvvm.tex.unified.3d.level.v4u32.f32">;
1717 def int_nvvm_tex_unified_3d_grad_v4u32_f32
1718   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1719               [llvm_i64_ty, llvm_float_ty, llvm_float_ty,
1720                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty,
1721                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1722               "llvm.nvvm.tex.unified.3d.grad.v4u32.f32">;
1724 def int_nvvm_tex_unified_cube_v4f32_f32
1725   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1726               [llvm_i64_ty,
1727                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1728               "llvm.nvvm.tex.unified.cube.v4f32.f32">;
1729 def int_nvvm_tex_unified_cube_level_v4f32_f32
1730   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1731               [llvm_i64_ty,
1732                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1733               "llvm.nvvm.tex.unified.cube.level.v4f32.f32">;
1734 def int_nvvm_tex_unified_cube_v4s32_f32
1735   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1736               [llvm_i64_ty,
1737                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1738               "llvm.nvvm.tex.unified.cube.v4s32.f32">;
1739 def int_nvvm_tex_unified_cube_level_v4s32_f32
1740   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1741               [llvm_i64_ty,
1742                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1743               "llvm.nvvm.tex.unified.cube.level.v4s32.f32">;
1744 def int_nvvm_tex_unified_cube_v4u32_f32
1745   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1746               [llvm_i64_ty,
1747                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1748               "llvm.nvvm.tex.unified.cube.v4u32.f32">;
1749 def int_nvvm_tex_unified_cube_level_v4u32_f32
1750   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1751               [llvm_i64_ty,
1752                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1753               "llvm.nvvm.tex.unified.cube.level.v4u32.f32">;
1755 def int_nvvm_tex_unified_cube_array_v4f32_f32
1756   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1757               [llvm_i64_ty, llvm_i32_ty,
1758                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1759               "llvm.nvvm.tex.unified.cube.array.v4f32.f32">;
1760 def int_nvvm_tex_unified_cube_array_level_v4f32_f32
1761   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1762               [llvm_i64_ty, llvm_i32_ty,
1763                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1764               "llvm.nvvm.tex.unified.cube.array.level.v4f32.f32">;
1765 def int_nvvm_tex_unified_cube_array_v4s32_f32
1766   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1767               [llvm_i64_ty, llvm_i32_ty,
1768                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1769               "llvm.nvvm.tex.unified.cube.array.v4s32.f32">;
1770 def int_nvvm_tex_unified_cube_array_level_v4s32_f32
1771   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1772               [llvm_i64_ty, llvm_i32_ty,
1773                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1774               "llvm.nvvm.tex.unified.cube.array.level.v4s32.f32">;
1775 def int_nvvm_tex_unified_cube_array_v4u32_f32
1776   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1777               [llvm_i64_ty, llvm_i32_ty,
1778                llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1779               "llvm.nvvm.tex.unified.cube.array.v4u32.f32">;
1780 def int_nvvm_tex_unified_cube_array_level_v4u32_f32
1781   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1782               [llvm_i64_ty, llvm_i32_ty,
1783                llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty], [],
1784               "llvm.nvvm.tex.unified.cube.array.level.v4u32.f32">;
1786 def int_nvvm_tld4_unified_r_2d_v4f32_f32
1787   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1788               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1789               "llvm.nvvm.tld4.unified.r.2d.v4f32.f32">;
1790 def int_nvvm_tld4_unified_g_2d_v4f32_f32
1791   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1792               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1793               "llvm.nvvm.tld4.unified.g.2d.v4f32.f32">;
1794 def int_nvvm_tld4_unified_b_2d_v4f32_f32
1795   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1796               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1797               "llvm.nvvm.tld4.unified.b.2d.v4f32.f32">;
1798 def int_nvvm_tld4_unified_a_2d_v4f32_f32
1799   : Intrinsic<[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_float_ty],
1800               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1801               "llvm.nvvm.tld4.unified.a.2d.v4f32.f32">;
1802 def int_nvvm_tld4_unified_r_2d_v4s32_f32
1803   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1804               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1805               "llvm.nvvm.tld4.unified.r.2d.v4s32.f32">;
1806 def int_nvvm_tld4_unified_g_2d_v4s32_f32
1807   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1808               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1809               "llvm.nvvm.tld4.unified.g.2d.v4s32.f32">;
1810 def int_nvvm_tld4_unified_b_2d_v4s32_f32
1811   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1812               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1813               "llvm.nvvm.tld4.unified.b.2d.v4s32.f32">;
1814 def int_nvvm_tld4_unified_a_2d_v4s32_f32
1815   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1816               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1817               "llvm.nvvm.tld4.unified.a.2d.v4s32.f32">;
1818 def int_nvvm_tld4_unified_r_2d_v4u32_f32
1819   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1820               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1821               "llvm.nvvm.tld4.unified.r.2d.v4u32.f32">;
1822 def int_nvvm_tld4_unified_g_2d_v4u32_f32
1823   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1824               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1825               "llvm.nvvm.tld4.unified.g.2d.v4u32.f32">;
1826 def int_nvvm_tld4_unified_b_2d_v4u32_f32
1827   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1828               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1829               "llvm.nvvm.tld4.unified.b.2d.v4u32.f32">;
1830 def int_nvvm_tld4_unified_a_2d_v4u32_f32
1831   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1832               [llvm_i64_ty, llvm_float_ty, llvm_float_ty], [],
1833               "llvm.nvvm.tld4.unified.a.2d.v4u32.f32">;
1836 //=== Surface Load
1837 // .clamp variants
1838 def int_nvvm_suld_1d_i8_clamp
1839   : Intrinsic<[llvm_i16_ty],
1840               [llvm_i64_ty, llvm_i32_ty], [],
1841               "llvm.nvvm.suld.1d.i8.clamp">;
1842 def int_nvvm_suld_1d_i16_clamp
1843   : Intrinsic<[llvm_i16_ty],
1844               [llvm_i64_ty, llvm_i32_ty], [],
1845               "llvm.nvvm.suld.1d.i16.clamp">;
1846 def int_nvvm_suld_1d_i32_clamp
1847   : Intrinsic<[llvm_i32_ty],
1848               [llvm_i64_ty, llvm_i32_ty], [],
1849               "llvm.nvvm.suld.1d.i32.clamp">;
1850 def int_nvvm_suld_1d_i64_clamp
1851   : Intrinsic<[llvm_i64_ty],
1852               [llvm_i64_ty, llvm_i32_ty], [],
1853               "llvm.nvvm.suld.1d.i64.clamp">;
1854 def int_nvvm_suld_1d_v2i8_clamp
1855   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1856               [llvm_i64_ty, llvm_i32_ty], [],
1857               "llvm.nvvm.suld.1d.v2i8.clamp">;
1858 def int_nvvm_suld_1d_v2i16_clamp
1859   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1860               [llvm_i64_ty, llvm_i32_ty], [],
1861               "llvm.nvvm.suld.1d.v2i16.clamp">;
1862 def int_nvvm_suld_1d_v2i32_clamp
1863   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
1864               [llvm_i64_ty, llvm_i32_ty], [],
1865               "llvm.nvvm.suld.1d.v2i32.clamp">;
1866 def int_nvvm_suld_1d_v2i64_clamp
1867   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
1868               [llvm_i64_ty, llvm_i32_ty], [],
1869               "llvm.nvvm.suld.1d.v2i64.clamp">;
1870 def int_nvvm_suld_1d_v4i8_clamp
1871   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
1872               [llvm_i64_ty, llvm_i32_ty], [],
1873               "llvm.nvvm.suld.1d.v4i8.clamp">;
1874 def int_nvvm_suld_1d_v4i16_clamp
1875   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
1876               [llvm_i64_ty, llvm_i32_ty], [],
1877               "llvm.nvvm.suld.1d.v4i16.clamp">;
1878 def int_nvvm_suld_1d_v4i32_clamp
1879   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1880               [llvm_i64_ty, llvm_i32_ty], [],
1881               "llvm.nvvm.suld.1d.v4i32.clamp">;
1883 def int_nvvm_suld_1d_array_i8_clamp
1884   : Intrinsic<[llvm_i16_ty],
1885               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1886               "llvm.nvvm.suld.1d.array.i8.clamp">;
1887 def int_nvvm_suld_1d_array_i16_clamp
1888   : Intrinsic<[llvm_i16_ty],
1889               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1890               "llvm.nvvm.suld.1d.array.i16.clamp">;
1891 def int_nvvm_suld_1d_array_i32_clamp
1892   : Intrinsic<[llvm_i32_ty],
1893               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1894               "llvm.nvvm.suld.1d.array.i32.clamp">;
1895 def int_nvvm_suld_1d_array_i64_clamp
1896   : Intrinsic<[llvm_i64_ty],
1897               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1898               "llvm.nvvm.suld.1d.array.i64.clamp">;
1899 def int_nvvm_suld_1d_array_v2i8_clamp
1900   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1901               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1902               "llvm.nvvm.suld.1d.array.v2i8.clamp">;
1903 def int_nvvm_suld_1d_array_v2i16_clamp
1904   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1905               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1906               "llvm.nvvm.suld.1d.array.v2i16.clamp">;
1907 def int_nvvm_suld_1d_array_v2i32_clamp
1908   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
1909               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1910               "llvm.nvvm.suld.1d.array.v2i32.clamp">;
1911 def int_nvvm_suld_1d_array_v2i64_clamp
1912   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
1913               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1914               "llvm.nvvm.suld.1d.array.v2i64.clamp">;
1915 def int_nvvm_suld_1d_array_v4i8_clamp
1916   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
1917               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1918               "llvm.nvvm.suld.1d.array.v4i8.clamp">;
1919 def int_nvvm_suld_1d_array_v4i16_clamp
1920   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
1921               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1922               "llvm.nvvm.suld.1d.array.v4i16.clamp">;
1923 def int_nvvm_suld_1d_array_v4i32_clamp
1924   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1925               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1926               "llvm.nvvm.suld.1d.array.v4i32.clamp">;
1928 def int_nvvm_suld_2d_i8_clamp
1929   : Intrinsic<[llvm_i16_ty],
1930               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1931               "llvm.nvvm.suld.2d.i8.clamp">;
1932 def int_nvvm_suld_2d_i16_clamp
1933   : Intrinsic<[llvm_i16_ty],
1934               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1935               "llvm.nvvm.suld.2d.i16.clamp">;
1936 def int_nvvm_suld_2d_i32_clamp
1937   : Intrinsic<[llvm_i32_ty],
1938               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1939               "llvm.nvvm.suld.2d.i32.clamp">;
1940 def int_nvvm_suld_2d_i64_clamp
1941   : Intrinsic<[llvm_i64_ty],
1942               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1943               "llvm.nvvm.suld.2d.i64.clamp">;
1944 def int_nvvm_suld_2d_v2i8_clamp
1945   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1946               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1947               "llvm.nvvm.suld.2d.v2i8.clamp">;
1948 def int_nvvm_suld_2d_v2i16_clamp
1949   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1950               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1951               "llvm.nvvm.suld.2d.v2i16.clamp">;
1952 def int_nvvm_suld_2d_v2i32_clamp
1953   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
1954               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1955               "llvm.nvvm.suld.2d.v2i32.clamp">;
1956 def int_nvvm_suld_2d_v2i64_clamp
1957   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
1958               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1959               "llvm.nvvm.suld.2d.v2i64.clamp">;
1960 def int_nvvm_suld_2d_v4i8_clamp
1961   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
1962               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1963               "llvm.nvvm.suld.2d.v4i8.clamp">;
1964 def int_nvvm_suld_2d_v4i16_clamp
1965   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
1966               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1967               "llvm.nvvm.suld.2d.v4i16.clamp">;
1968 def int_nvvm_suld_2d_v4i32_clamp
1969   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
1970               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
1971               "llvm.nvvm.suld.2d.v4i32.clamp">;
1973 def int_nvvm_suld_2d_array_i8_clamp
1974   : Intrinsic<[llvm_i16_ty],
1975               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
1976               "llvm.nvvm.suld.2d.array.i8.clamp">;
1977 def int_nvvm_suld_2d_array_i16_clamp
1978   : Intrinsic<[llvm_i16_ty],
1979               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
1980               "llvm.nvvm.suld.2d.array.i16.clamp">;
1981 def int_nvvm_suld_2d_array_i32_clamp
1982   : Intrinsic<[llvm_i32_ty],
1983               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
1984               "llvm.nvvm.suld.2d.array.i32.clamp">;
1985 def int_nvvm_suld_2d_array_i64_clamp
1986   : Intrinsic<[llvm_i64_ty],
1987               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
1988               "llvm.nvvm.suld.2d.array.i64.clamp">;
1989 def int_nvvm_suld_2d_array_v2i8_clamp
1990   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1991               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
1992               "llvm.nvvm.suld.2d.array.v2i8.clamp">;
1993 def int_nvvm_suld_2d_array_v2i16_clamp
1994   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
1995               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
1996               "llvm.nvvm.suld.2d.array.v2i16.clamp">;
1997 def int_nvvm_suld_2d_array_v2i32_clamp
1998   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
1999               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2000               "llvm.nvvm.suld.2d.array.v2i32.clamp">;
2001 def int_nvvm_suld_2d_array_v2i64_clamp
2002   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2003               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2004               "llvm.nvvm.suld.2d.array.v2i64.clamp">;
2005 def int_nvvm_suld_2d_array_v4i8_clamp
2006   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2007               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2008               "llvm.nvvm.suld.2d.array.v4i8.clamp">;
2009 def int_nvvm_suld_2d_array_v4i16_clamp
2010   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2011               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2012               "llvm.nvvm.suld.2d.array.v4i16.clamp">;
2013 def int_nvvm_suld_2d_array_v4i32_clamp
2014   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2015               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2016               "llvm.nvvm.suld.2d.array.v4i32.clamp">;
2018 def int_nvvm_suld_3d_i8_clamp
2019   : Intrinsic<[llvm_i16_ty],
2020               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2021               "llvm.nvvm.suld.3d.i8.clamp">;
2022 def int_nvvm_suld_3d_i16_clamp
2023   : Intrinsic<[llvm_i16_ty],
2024               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2025               "llvm.nvvm.suld.3d.i16.clamp">;
2026 def int_nvvm_suld_3d_i32_clamp
2027   : Intrinsic<[llvm_i32_ty],
2028               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2029               "llvm.nvvm.suld.3d.i32.clamp">;
2030 def int_nvvm_suld_3d_i64_clamp
2031   : Intrinsic<[llvm_i64_ty],
2032               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2033               "llvm.nvvm.suld.3d.i64.clamp">;
2034 def int_nvvm_suld_3d_v2i8_clamp
2035   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2036               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2037               "llvm.nvvm.suld.3d.v2i8.clamp">;
2038 def int_nvvm_suld_3d_v2i16_clamp
2039   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2040               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2041               "llvm.nvvm.suld.3d.v2i16.clamp">;
2042 def int_nvvm_suld_3d_v2i32_clamp
2043   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2044               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2045               "llvm.nvvm.suld.3d.v2i32.clamp">;
2046 def int_nvvm_suld_3d_v2i64_clamp
2047   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2048               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2049               "llvm.nvvm.suld.3d.v2i64.clamp">;
2050 def int_nvvm_suld_3d_v4i8_clamp
2051   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2052               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2053               "llvm.nvvm.suld.3d.v4i8.clamp">;
2054 def int_nvvm_suld_3d_v4i16_clamp
2055   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2056               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2057               "llvm.nvvm.suld.3d.v4i16.clamp">;
2058 def int_nvvm_suld_3d_v4i32_clamp
2059   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2060               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2061               "llvm.nvvm.suld.3d.v4i32.clamp">;
2063 // .trap variants
2064 def int_nvvm_suld_1d_i8_trap
2065   : Intrinsic<[llvm_i16_ty],
2066               [llvm_i64_ty, llvm_i32_ty], [],
2067               "llvm.nvvm.suld.1d.i8.trap">;
2068 def int_nvvm_suld_1d_i16_trap
2069   : Intrinsic<[llvm_i16_ty],
2070               [llvm_i64_ty, llvm_i32_ty], [],
2071               "llvm.nvvm.suld.1d.i16.trap">;
2072 def int_nvvm_suld_1d_i32_trap
2073   : Intrinsic<[llvm_i32_ty],
2074               [llvm_i64_ty, llvm_i32_ty], [],
2075               "llvm.nvvm.suld.1d.i32.trap">;
2076 def int_nvvm_suld_1d_i64_trap
2077   : Intrinsic<[llvm_i64_ty],
2078               [llvm_i64_ty, llvm_i32_ty], [],
2079               "llvm.nvvm.suld.1d.i64.trap">;
2080 def int_nvvm_suld_1d_v2i8_trap
2081   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2082               [llvm_i64_ty, llvm_i32_ty], [],
2083               "llvm.nvvm.suld.1d.v2i8.trap">;
2084 def int_nvvm_suld_1d_v2i16_trap
2085   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2086               [llvm_i64_ty, llvm_i32_ty], [],
2087               "llvm.nvvm.suld.1d.v2i16.trap">;
2088 def int_nvvm_suld_1d_v2i32_trap
2089   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2090               [llvm_i64_ty, llvm_i32_ty], [],
2091               "llvm.nvvm.suld.1d.v2i32.trap">;
2092 def int_nvvm_suld_1d_v2i64_trap
2093   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2094               [llvm_i64_ty, llvm_i32_ty], [],
2095               "llvm.nvvm.suld.1d.v2i64.trap">;
2096 def int_nvvm_suld_1d_v4i8_trap
2097   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2098               [llvm_i64_ty, llvm_i32_ty], [],
2099               "llvm.nvvm.suld.1d.v4i8.trap">;
2100 def int_nvvm_suld_1d_v4i16_trap
2101   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2102               [llvm_i64_ty, llvm_i32_ty], [],
2103               "llvm.nvvm.suld.1d.v4i16.trap">;
2104 def int_nvvm_suld_1d_v4i32_trap
2105   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2106               [llvm_i64_ty, llvm_i32_ty], [],
2107               "llvm.nvvm.suld.1d.v4i32.trap">;
2109 def int_nvvm_suld_1d_array_i8_trap
2110   : Intrinsic<[llvm_i16_ty],
2111               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2112               "llvm.nvvm.suld.1d.array.i8.trap">;
2113 def int_nvvm_suld_1d_array_i16_trap
2114   : Intrinsic<[llvm_i16_ty],
2115               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2116               "llvm.nvvm.suld.1d.array.i16.trap">;
2117 def int_nvvm_suld_1d_array_i32_trap
2118   : Intrinsic<[llvm_i32_ty],
2119               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2120               "llvm.nvvm.suld.1d.array.i32.trap">;
2121 def int_nvvm_suld_1d_array_i64_trap
2122   : Intrinsic<[llvm_i64_ty],
2123               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2124               "llvm.nvvm.suld.1d.array.i64.trap">;
2125 def int_nvvm_suld_1d_array_v2i8_trap
2126   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2127               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2128               "llvm.nvvm.suld.1d.array.v2i8.trap">;
2129 def int_nvvm_suld_1d_array_v2i16_trap
2130   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2131               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2132               "llvm.nvvm.suld.1d.array.v2i16.trap">;
2133 def int_nvvm_suld_1d_array_v2i32_trap
2134   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2135               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2136               "llvm.nvvm.suld.1d.array.v2i32.trap">;
2137 def int_nvvm_suld_1d_array_v2i64_trap
2138   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2139               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2140               "llvm.nvvm.suld.1d.array.v2i64.trap">;
2141 def int_nvvm_suld_1d_array_v4i8_trap
2142   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2143               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2144               "llvm.nvvm.suld.1d.array.v4i8.trap">;
2145 def int_nvvm_suld_1d_array_v4i16_trap
2146   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2147               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2148               "llvm.nvvm.suld.1d.array.v4i16.trap">;
2149 def int_nvvm_suld_1d_array_v4i32_trap
2150   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2151               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2152               "llvm.nvvm.suld.1d.array.v4i32.trap">;
2154 def int_nvvm_suld_2d_i8_trap
2155   : Intrinsic<[llvm_i16_ty],
2156               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2157               "llvm.nvvm.suld.2d.i8.trap">;
2158 def int_nvvm_suld_2d_i16_trap
2159   : Intrinsic<[llvm_i16_ty],
2160               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2161               "llvm.nvvm.suld.2d.i16.trap">;
2162 def int_nvvm_suld_2d_i32_trap
2163   : Intrinsic<[llvm_i32_ty],
2164               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2165               "llvm.nvvm.suld.2d.i32.trap">;
2166 def int_nvvm_suld_2d_i64_trap
2167   : Intrinsic<[llvm_i64_ty],
2168               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2169               "llvm.nvvm.suld.2d.i64.trap">;
2170 def int_nvvm_suld_2d_v2i8_trap
2171   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2172               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2173               "llvm.nvvm.suld.2d.v2i8.trap">;
2174 def int_nvvm_suld_2d_v2i16_trap
2175   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2176               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2177               "llvm.nvvm.suld.2d.v2i16.trap">;
2178 def int_nvvm_suld_2d_v2i32_trap
2179   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2180               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2181               "llvm.nvvm.suld.2d.v2i32.trap">;
2182 def int_nvvm_suld_2d_v2i64_trap
2183   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2184               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2185               "llvm.nvvm.suld.2d.v2i64.trap">;
2186 def int_nvvm_suld_2d_v4i8_trap
2187   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2188               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2189               "llvm.nvvm.suld.2d.v4i8.trap">;
2190 def int_nvvm_suld_2d_v4i16_trap
2191   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2192               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2193               "llvm.nvvm.suld.2d.v4i16.trap">;
2194 def int_nvvm_suld_2d_v4i32_trap
2195   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2196               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2197               "llvm.nvvm.suld.2d.v4i32.trap">;
2199 def int_nvvm_suld_2d_array_i8_trap
2200   : Intrinsic<[llvm_i16_ty],
2201               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2202               "llvm.nvvm.suld.2d.array.i8.trap">;
2203 def int_nvvm_suld_2d_array_i16_trap
2204   : Intrinsic<[llvm_i16_ty],
2205               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2206               "llvm.nvvm.suld.2d.array.i16.trap">;
2207 def int_nvvm_suld_2d_array_i32_trap
2208   : Intrinsic<[llvm_i32_ty],
2209               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2210               "llvm.nvvm.suld.2d.array.i32.trap">;
2211 def int_nvvm_suld_2d_array_i64_trap
2212   : Intrinsic<[llvm_i64_ty],
2213               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2214               "llvm.nvvm.suld.2d.array.i64.trap">;
2215 def int_nvvm_suld_2d_array_v2i8_trap
2216   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2217               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2218               "llvm.nvvm.suld.2d.array.v2i8.trap">;
2219 def int_nvvm_suld_2d_array_v2i16_trap
2220   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2221               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2222               "llvm.nvvm.suld.2d.array.v2i16.trap">;
2223 def int_nvvm_suld_2d_array_v2i32_trap
2224   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2225               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2226               "llvm.nvvm.suld.2d.array.v2i32.trap">;
2227 def int_nvvm_suld_2d_array_v2i64_trap
2228   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2229               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2230               "llvm.nvvm.suld.2d.array.v2i64.trap">;
2231 def int_nvvm_suld_2d_array_v4i8_trap
2232   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2233               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2234               "llvm.nvvm.suld.2d.array.v4i8.trap">;
2235 def int_nvvm_suld_2d_array_v4i16_trap
2236   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2237               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2238               "llvm.nvvm.suld.2d.array.v4i16.trap">;
2239 def int_nvvm_suld_2d_array_v4i32_trap
2240   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2241               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2242               "llvm.nvvm.suld.2d.array.v4i32.trap">;
2244 def int_nvvm_suld_3d_i8_trap
2245   : Intrinsic<[llvm_i16_ty],
2246               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2247               "llvm.nvvm.suld.3d.i8.trap">;
2248 def int_nvvm_suld_3d_i16_trap
2249   : Intrinsic<[llvm_i16_ty],
2250               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2251               "llvm.nvvm.suld.3d.i16.trap">;
2252 def int_nvvm_suld_3d_i32_trap
2253   : Intrinsic<[llvm_i32_ty],
2254               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2255               "llvm.nvvm.suld.3d.i32.trap">;
2256 def int_nvvm_suld_3d_i64_trap
2257   : Intrinsic<[llvm_i64_ty],
2258               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2259               "llvm.nvvm.suld.3d.i64.trap">;
2260 def int_nvvm_suld_3d_v2i8_trap
2261   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2262               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2263               "llvm.nvvm.suld.3d.v2i8.trap">;
2264 def int_nvvm_suld_3d_v2i16_trap
2265   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2266               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2267               "llvm.nvvm.suld.3d.v2i16.trap">;
2268 def int_nvvm_suld_3d_v2i32_trap
2269   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2270               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2271               "llvm.nvvm.suld.3d.v2i32.trap">;
2272 def int_nvvm_suld_3d_v2i64_trap
2273   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2274               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2275               "llvm.nvvm.suld.3d.v2i64.trap">;
2276 def int_nvvm_suld_3d_v4i8_trap
2277   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2278               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2279               "llvm.nvvm.suld.3d.v4i8.trap">;
2280 def int_nvvm_suld_3d_v4i16_trap
2281   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2282               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2283               "llvm.nvvm.suld.3d.v4i16.trap">;
2284 def int_nvvm_suld_3d_v4i32_trap
2285   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2286               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2287               "llvm.nvvm.suld.3d.v4i32.trap">;
2289 // .zero variants
2290 def int_nvvm_suld_1d_i8_zero
2291   : Intrinsic<[llvm_i16_ty],
2292               [llvm_i64_ty, llvm_i32_ty], [],
2293               "llvm.nvvm.suld.1d.i8.zero">;
2294 def int_nvvm_suld_1d_i16_zero
2295   : Intrinsic<[llvm_i16_ty],
2296               [llvm_i64_ty, llvm_i32_ty], [],
2297               "llvm.nvvm.suld.1d.i16.zero">;
2298 def int_nvvm_suld_1d_i32_zero
2299   : Intrinsic<[llvm_i32_ty],
2300               [llvm_i64_ty, llvm_i32_ty], [],
2301               "llvm.nvvm.suld.1d.i32.zero">;
2302 def int_nvvm_suld_1d_i64_zero
2303   : Intrinsic<[llvm_i64_ty],
2304               [llvm_i64_ty, llvm_i32_ty], [],
2305               "llvm.nvvm.suld.1d.i64.zero">;
2306 def int_nvvm_suld_1d_v2i8_zero
2307   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2308               [llvm_i64_ty, llvm_i32_ty], [],
2309               "llvm.nvvm.suld.1d.v2i8.zero">;
2310 def int_nvvm_suld_1d_v2i16_zero
2311   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2312               [llvm_i64_ty, llvm_i32_ty], [],
2313               "llvm.nvvm.suld.1d.v2i16.zero">;
2314 def int_nvvm_suld_1d_v2i32_zero
2315   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2316               [llvm_i64_ty, llvm_i32_ty], [],
2317               "llvm.nvvm.suld.1d.v2i32.zero">;
2318 def int_nvvm_suld_1d_v2i64_zero
2319   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2320               [llvm_i64_ty, llvm_i32_ty], [],
2321               "llvm.nvvm.suld.1d.v2i64.zero">;
2322 def int_nvvm_suld_1d_v4i8_zero
2323   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2324               [llvm_i64_ty, llvm_i32_ty], [],
2325               "llvm.nvvm.suld.1d.v4i8.zero">;
2326 def int_nvvm_suld_1d_v4i16_zero
2327   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2328               [llvm_i64_ty, llvm_i32_ty], [],
2329               "llvm.nvvm.suld.1d.v4i16.zero">;
2330 def int_nvvm_suld_1d_v4i32_zero
2331   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2332               [llvm_i64_ty, llvm_i32_ty], [],
2333               "llvm.nvvm.suld.1d.v4i32.zero">;
2335 def int_nvvm_suld_1d_array_i8_zero
2336   : Intrinsic<[llvm_i16_ty],
2337               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2338               "llvm.nvvm.suld.1d.array.i8.zero">;
2339 def int_nvvm_suld_1d_array_i16_zero
2340   : Intrinsic<[llvm_i16_ty],
2341               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2342               "llvm.nvvm.suld.1d.array.i16.zero">;
2343 def int_nvvm_suld_1d_array_i32_zero
2344   : Intrinsic<[llvm_i32_ty],
2345               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2346               "llvm.nvvm.suld.1d.array.i32.zero">;
2347 def int_nvvm_suld_1d_array_i64_zero
2348   : Intrinsic<[llvm_i64_ty],
2349               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2350               "llvm.nvvm.suld.1d.array.i64.zero">;
2351 def int_nvvm_suld_1d_array_v2i8_zero
2352   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2353               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2354               "llvm.nvvm.suld.1d.array.v2i8.zero">;
2355 def int_nvvm_suld_1d_array_v2i16_zero
2356   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2357               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2358               "llvm.nvvm.suld.1d.array.v2i16.zero">;
2359 def int_nvvm_suld_1d_array_v2i32_zero
2360   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2361               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2362               "llvm.nvvm.suld.1d.array.v2i32.zero">;
2363 def int_nvvm_suld_1d_array_v2i64_zero
2364   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2365               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2366               "llvm.nvvm.suld.1d.array.v2i64.zero">;
2367 def int_nvvm_suld_1d_array_v4i8_zero
2368   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2369               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2370               "llvm.nvvm.suld.1d.array.v4i8.zero">;
2371 def int_nvvm_suld_1d_array_v4i16_zero
2372   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2373               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2374               "llvm.nvvm.suld.1d.array.v4i16.zero">;
2375 def int_nvvm_suld_1d_array_v4i32_zero
2376   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2377               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2378               "llvm.nvvm.suld.1d.array.v4i32.zero">;
2380 def int_nvvm_suld_2d_i8_zero
2381   : Intrinsic<[llvm_i16_ty],
2382               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2383               "llvm.nvvm.suld.2d.i8.zero">;
2384 def int_nvvm_suld_2d_i16_zero
2385   : Intrinsic<[llvm_i16_ty],
2386               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2387               "llvm.nvvm.suld.2d.i16.zero">;
2388 def int_nvvm_suld_2d_i32_zero
2389   : Intrinsic<[llvm_i32_ty],
2390               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2391               "llvm.nvvm.suld.2d.i32.zero">;
2392 def int_nvvm_suld_2d_i64_zero
2393   : Intrinsic<[llvm_i64_ty],
2394               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2395               "llvm.nvvm.suld.2d.i64.zero">;
2396 def int_nvvm_suld_2d_v2i8_zero
2397   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2398               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2399               "llvm.nvvm.suld.2d.v2i8.zero">;
2400 def int_nvvm_suld_2d_v2i16_zero
2401   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2402               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2403               "llvm.nvvm.suld.2d.v2i16.zero">;
2404 def int_nvvm_suld_2d_v2i32_zero
2405   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2406               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2407               "llvm.nvvm.suld.2d.v2i32.zero">;
2408 def int_nvvm_suld_2d_v2i64_zero
2409   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2410               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2411               "llvm.nvvm.suld.2d.v2i64.zero">;
2412 def int_nvvm_suld_2d_v4i8_zero
2413   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2414               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2415               "llvm.nvvm.suld.2d.v4i8.zero">;
2416 def int_nvvm_suld_2d_v4i16_zero
2417   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2418               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2419               "llvm.nvvm.suld.2d.v4i16.zero">;
2420 def int_nvvm_suld_2d_v4i32_zero
2421   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2422               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2423               "llvm.nvvm.suld.2d.v4i32.zero">;
2425 def int_nvvm_suld_2d_array_i8_zero
2426   : Intrinsic<[llvm_i16_ty],
2427               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2428               "llvm.nvvm.suld.2d.array.i8.zero">;
2429 def int_nvvm_suld_2d_array_i16_zero
2430   : Intrinsic<[llvm_i16_ty],
2431               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2432               "llvm.nvvm.suld.2d.array.i16.zero">;
2433 def int_nvvm_suld_2d_array_i32_zero
2434   : Intrinsic<[llvm_i32_ty],
2435               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2436               "llvm.nvvm.suld.2d.array.i32.zero">;
2437 def int_nvvm_suld_2d_array_i64_zero
2438   : Intrinsic<[llvm_i64_ty],
2439               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2440               "llvm.nvvm.suld.2d.array.i64.zero">;
2441 def int_nvvm_suld_2d_array_v2i8_zero
2442   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2443               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2444               "llvm.nvvm.suld.2d.array.v2i8.zero">;
2445 def int_nvvm_suld_2d_array_v2i16_zero
2446   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2447               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2448               "llvm.nvvm.suld.2d.array.v2i16.zero">;
2449 def int_nvvm_suld_2d_array_v2i32_zero
2450   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2451               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2452               "llvm.nvvm.suld.2d.array.v2i32.zero">;
2453 def int_nvvm_suld_2d_array_v2i64_zero
2454   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2455               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2456               "llvm.nvvm.suld.2d.array.v2i64.zero">;
2457 def int_nvvm_suld_2d_array_v4i8_zero
2458   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2459               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2460               "llvm.nvvm.suld.2d.array.v4i8.zero">;
2461 def int_nvvm_suld_2d_array_v4i16_zero
2462   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2463               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2464               "llvm.nvvm.suld.2d.array.v4i16.zero">;
2465 def int_nvvm_suld_2d_array_v4i32_zero
2466   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2467               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2468               "llvm.nvvm.suld.2d.array.v4i32.zero">;
2470 def int_nvvm_suld_3d_i8_zero
2471   : Intrinsic<[llvm_i16_ty],
2472               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2473               "llvm.nvvm.suld.3d.i8.zero">;
2474 def int_nvvm_suld_3d_i16_zero
2475   : Intrinsic<[llvm_i16_ty],
2476               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2477               "llvm.nvvm.suld.3d.i16.zero">;
2478 def int_nvvm_suld_3d_i32_zero
2479   : Intrinsic<[llvm_i32_ty],
2480               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2481               "llvm.nvvm.suld.3d.i32.zero">;
2482 def int_nvvm_suld_3d_i64_zero
2483   : Intrinsic<[llvm_i64_ty],
2484               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2485               "llvm.nvvm.suld.3d.i64.zero">;
2486 def int_nvvm_suld_3d_v2i8_zero
2487   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2488               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2489               "llvm.nvvm.suld.3d.v2i8.zero">;
2490 def int_nvvm_suld_3d_v2i16_zero
2491   : Intrinsic<[llvm_i16_ty, llvm_i16_ty],
2492               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2493               "llvm.nvvm.suld.3d.v2i16.zero">;
2494 def int_nvvm_suld_3d_v2i32_zero
2495   : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
2496               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2497               "llvm.nvvm.suld.3d.v2i32.zero">;
2498 def int_nvvm_suld_3d_v2i64_zero
2499   : Intrinsic<[llvm_i64_ty, llvm_i64_ty],
2500               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2501               "llvm.nvvm.suld.3d.v2i64.zero">;
2502 def int_nvvm_suld_3d_v4i8_zero
2503   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2504               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2505               "llvm.nvvm.suld.3d.v4i8.zero">;
2506 def int_nvvm_suld_3d_v4i16_zero
2507   : Intrinsic<[llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty],
2508               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2509               "llvm.nvvm.suld.3d.v4i16.zero">;
2510 def int_nvvm_suld_3d_v4i32_zero
2511   : Intrinsic<[llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
2512               [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2513               "llvm.nvvm.suld.3d.v4i32.zero">;
2515 //===- Texture Query ------------------------------------------------------===//
2517 def int_nvvm_txq_channel_order
2518   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2519               "llvm.nvvm.txq.channel.order">,
2520     GCCBuiltin<"__nvvm_txq_channel_order">;
2521 def int_nvvm_txq_channel_data_type
2522   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2523               "llvm.nvvm.txq.channel.data.type">,
2524     GCCBuiltin<"__nvvm_txq_channel_data_type">;
2525 def int_nvvm_txq_width
2526   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2527               "llvm.nvvm.txq.width">,
2528     GCCBuiltin<"__nvvm_txq_width">;
2529 def int_nvvm_txq_height
2530   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2531               "llvm.nvvm.txq.height">,
2532     GCCBuiltin<"__nvvm_txq_height">;
2533 def int_nvvm_txq_depth
2534   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2535               "llvm.nvvm.txq.depth">,
2536     GCCBuiltin<"__nvvm_txq_depth">;
2537 def int_nvvm_txq_array_size
2538   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2539               "llvm.nvvm.txq.array.size">,
2540     GCCBuiltin<"__nvvm_txq_array_size">;
2541 def int_nvvm_txq_num_samples
2542   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2543               "llvm.nvvm.txq.num.samples">,
2544     GCCBuiltin<"__nvvm_txq_num_samples">;
2545 def int_nvvm_txq_num_mipmap_levels
2546   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2547               "llvm.nvvm.txq.num.mipmap.levels">,
2548     GCCBuiltin<"__nvvm_txq_num_mipmap_levels">;
2550 //===- Surface Query ------------------------------------------------------===//
2552 def int_nvvm_suq_channel_order
2553   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2554               "llvm.nvvm.suq.channel.order">,
2555     GCCBuiltin<"__nvvm_suq_channel_order">;
2556 def int_nvvm_suq_channel_data_type
2557   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2558               "llvm.nvvm.suq.channel.data.type">,
2559     GCCBuiltin<"__nvvm_suq_channel_data_type">;
2560 def int_nvvm_suq_width
2561   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2562               "llvm.nvvm.suq.width">,
2563     GCCBuiltin<"__nvvm_suq_width">;
2564 def int_nvvm_suq_height
2565   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2566               "llvm.nvvm.suq.height">,
2567     GCCBuiltin<"__nvvm_suq_height">;
2568 def int_nvvm_suq_depth
2569   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2570               "llvm.nvvm.suq.depth">,
2571     GCCBuiltin<"__nvvm_suq_depth">;
2572 def int_nvvm_suq_array_size
2573   : Intrinsic<[llvm_i32_ty], [llvm_i64_ty], [IntrNoMem],
2574               "llvm.nvvm.suq.array.size">,
2575     GCCBuiltin<"__nvvm_suq_array_size">;
2578 //===- Handle Query -------------------------------------------------------===//
2580 def int_nvvm_istypep_sampler
2581   : Intrinsic<[llvm_i1_ty], [llvm_i64_ty], [IntrNoMem],
2582               "llvm.nvvm.istypep.sampler">,
2583     GCCBuiltin<"__nvvm_istypep_sampler">;
2584 def int_nvvm_istypep_surface
2585   : Intrinsic<[llvm_i1_ty], [llvm_i64_ty], [IntrNoMem],
2586               "llvm.nvvm.istypep.surface">,
2587     GCCBuiltin<"__nvvm_istypep_surface">;
2588 def int_nvvm_istypep_texture
2589   : Intrinsic<[llvm_i1_ty], [llvm_i64_ty], [IntrNoMem],
2590               "llvm.nvvm.istypep.texture">,
2591     GCCBuiltin<"__nvvm_istypep_texture">;
2595 //===- Surface Stores -----------------------------------------------------===//
2597 // Unformatted
2598 // .clamp variant
2599 def int_nvvm_sust_b_1d_i8_clamp
2600   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
2601               "llvm.nvvm.sust.b.1d.i8.clamp">,
2602     GCCBuiltin<"__nvvm_sust_b_1d_i8_clamp">;
2603 def int_nvvm_sust_b_1d_i16_clamp
2604   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
2605               "llvm.nvvm.sust.b.1d.i16.clamp">,
2606     GCCBuiltin<"__nvvm_sust_b_1d_i16_clamp">;
2607 def int_nvvm_sust_b_1d_i32_clamp
2608   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2609               "llvm.nvvm.sust.b.1d.i32.clamp">,
2610     GCCBuiltin<"__nvvm_sust_b_1d_i32_clamp">;
2611 def int_nvvm_sust_b_1d_i64_clamp
2612   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty], [],
2613               "llvm.nvvm.sust.b.1d.i64.clamp">,
2614     GCCBuiltin<"__nvvm_sust_b_1d_i64_clamp">;
2615 def int_nvvm_sust_b_1d_v2i8_clamp
2616   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
2617               "llvm.nvvm.sust.b.1d.v2i8.clamp">,
2618     GCCBuiltin<"__nvvm_sust_b_1d_v2i8_clamp">;
2619 def int_nvvm_sust_b_1d_v2i16_clamp
2620   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
2621               "llvm.nvvm.sust.b.1d.v2i16.clamp">,
2622     GCCBuiltin<"__nvvm_sust_b_1d_v2i16_clamp">;
2623 def int_nvvm_sust_b_1d_v2i32_clamp
2624   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2625               "llvm.nvvm.sust.b.1d.v2i32.clamp">,
2626     GCCBuiltin<"__nvvm_sust_b_1d_v2i32_clamp">;
2627 def int_nvvm_sust_b_1d_v2i64_clamp
2628   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty, llvm_i64_ty], [],
2629               "llvm.nvvm.sust.b.1d.v2i64.clamp">,
2630     GCCBuiltin<"__nvvm_sust_b_1d_v2i64_clamp">;
2631 def int_nvvm_sust_b_1d_v4i8_clamp
2632   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
2633                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2634               "llvm.nvvm.sust.b.1d.v4i8.clamp">,
2635     GCCBuiltin<"__nvvm_sust_b_1d_v4i8_clamp">;
2636 def int_nvvm_sust_b_1d_v4i16_clamp
2637   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
2638                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2639               "llvm.nvvm.sust.b.1d.v4i16.clamp">,
2640     GCCBuiltin<"__nvvm_sust_b_1d_v4i16_clamp">;
2641 def int_nvvm_sust_b_1d_v4i32_clamp
2642   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2643                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2644               "llvm.nvvm.sust.b.1d.v4i32.clamp">,
2645     GCCBuiltin<"__nvvm_sust_b_1d_v4i32_clamp">;
2648 def int_nvvm_sust_b_1d_array_i8_clamp
2649   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2650               "llvm.nvvm.sust.b.1d.array.i8.clamp">,
2651     GCCBuiltin<"__nvvm_sust_b_1d_array_i8_clamp">;
2652 def int_nvvm_sust_b_1d_array_i16_clamp
2653   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2654               "llvm.nvvm.sust.b.1d.array.i16.clamp">,
2655     GCCBuiltin<"__nvvm_sust_b_1d_array_i16_clamp">;
2656 def int_nvvm_sust_b_1d_array_i32_clamp
2657   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2658               "llvm.nvvm.sust.b.1d.array.i32.clamp">,
2659     GCCBuiltin<"__nvvm_sust_b_1d_array_i32_clamp">;
2660 def int_nvvm_sust_b_1d_array_i64_clamp
2661   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i64_ty], [],
2662               "llvm.nvvm.sust.b.1d.array.i64.clamp">,
2663     GCCBuiltin<"__nvvm_sust_b_1d_array_i64_clamp">;
2664 def int_nvvm_sust_b_1d_array_v2i8_clamp
2665   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2666                    llvm_i16_ty, llvm_i16_ty], [],
2667               "llvm.nvvm.sust.b.1d.array.v2i8.clamp">,
2668     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i8_clamp">;
2669 def int_nvvm_sust_b_1d_array_v2i16_clamp
2670   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2671                    llvm_i16_ty, llvm_i16_ty], [],
2672               "llvm.nvvm.sust.b.1d.array.v2i16.clamp">,
2673     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i16_clamp">;
2674 def int_nvvm_sust_b_1d_array_v2i32_clamp
2675   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2676                    llvm_i32_ty, llvm_i32_ty], [],
2677               "llvm.nvvm.sust.b.1d.array.v2i32.clamp">,
2678     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i32_clamp">;
2679 def int_nvvm_sust_b_1d_array_v2i64_clamp
2680   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2681                    llvm_i64_ty, llvm_i64_ty], [],
2682               "llvm.nvvm.sust.b.1d.array.v2i64.clamp">,
2683     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i64_clamp">;
2684 def int_nvvm_sust_b_1d_array_v4i8_clamp
2685   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
2686                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2687               "llvm.nvvm.sust.b.1d.array.v4i8.clamp">,
2688     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i8_clamp">;
2689 def int_nvvm_sust_b_1d_array_v4i16_clamp
2690   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
2691                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2692               "llvm.nvvm.sust.b.1d.array.v4i16.clamp">,
2693     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i16_clamp">;
2694 def int_nvvm_sust_b_1d_array_v4i32_clamp
2695   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2696                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2697               "llvm.nvvm.sust.b.1d.array.v4i32.clamp">,
2698     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i32_clamp">;
2701 def int_nvvm_sust_b_2d_i8_clamp
2702   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2703               "llvm.nvvm.sust.b.2d.i8.clamp">,
2704     GCCBuiltin<"__nvvm_sust_b_2d_i8_clamp">;
2705 def int_nvvm_sust_b_2d_i16_clamp
2706   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2707               "llvm.nvvm.sust.b.2d.i16.clamp">,
2708     GCCBuiltin<"__nvvm_sust_b_2d_i16_clamp">;
2709 def int_nvvm_sust_b_2d_i32_clamp
2710   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2711               "llvm.nvvm.sust.b.2d.i32.clamp">,
2712     GCCBuiltin<"__nvvm_sust_b_2d_i32_clamp">;
2713 def int_nvvm_sust_b_2d_i64_clamp
2714   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i64_ty], [],
2715               "llvm.nvvm.sust.b.2d.i64.clamp">,
2716     GCCBuiltin<"__nvvm_sust_b_2d_i64_clamp">;
2717 def int_nvvm_sust_b_2d_v2i8_clamp
2718   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2719                    llvm_i16_ty, llvm_i16_ty], [],
2720               "llvm.nvvm.sust.b.2d.v2i8.clamp">,
2721     GCCBuiltin<"__nvvm_sust_b_2d_v2i8_clamp">;
2722 def int_nvvm_sust_b_2d_v2i16_clamp
2723   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2724                    llvm_i16_ty, llvm_i16_ty], [],
2725               "llvm.nvvm.sust.b.2d.v2i16.clamp">,
2726     GCCBuiltin<"__nvvm_sust_b_2d_v2i16_clamp">;
2727 def int_nvvm_sust_b_2d_v2i32_clamp
2728   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2729                    llvm_i32_ty, llvm_i32_ty], [],
2730               "llvm.nvvm.sust.b.2d.v2i32.clamp">,
2731     GCCBuiltin<"__nvvm_sust_b_2d_v2i32_clamp">;
2732 def int_nvvm_sust_b_2d_v2i64_clamp
2733   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2734                    llvm_i64_ty, llvm_i64_ty], [],
2735               "llvm.nvvm.sust.b.2d.v2i64.clamp">,
2736     GCCBuiltin<"__nvvm_sust_b_2d_v2i64_clamp">;
2737 def int_nvvm_sust_b_2d_v4i8_clamp
2738   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
2739                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2740               "llvm.nvvm.sust.b.2d.v4i8.clamp">,
2741     GCCBuiltin<"__nvvm_sust_b_2d_v4i8_clamp">;
2742 def int_nvvm_sust_b_2d_v4i16_clamp
2743   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
2744                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2745               "llvm.nvvm.sust.b.2d.v4i16.clamp">,
2746     GCCBuiltin<"__nvvm_sust_b_2d_v4i16_clamp">;
2747 def int_nvvm_sust_b_2d_v4i32_clamp
2748   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2749                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2750               "llvm.nvvm.sust.b.2d.v4i32.clamp">,
2751     GCCBuiltin<"__nvvm_sust_b_2d_v4i32_clamp">;
2754 def int_nvvm_sust_b_2d_array_i8_clamp
2755   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2756                    llvm_i32_ty, llvm_i16_ty], [],
2757               "llvm.nvvm.sust.b.2d.array.i8.clamp">,
2758     GCCBuiltin<"__nvvm_sust_b_2d_array_i8_clamp">;
2759 def int_nvvm_sust_b_2d_array_i16_clamp
2760   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2761                    llvm_i32_ty, llvm_i16_ty], [],
2762               "llvm.nvvm.sust.b.2d.array.i16.clamp">,
2763     GCCBuiltin<"__nvvm_sust_b_2d_array_i16_clamp">;
2764 def int_nvvm_sust_b_2d_array_i32_clamp
2765   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2766                    llvm_i32_ty, llvm_i32_ty], [],
2767               "llvm.nvvm.sust.b.2d.array.i32.clamp">,
2768     GCCBuiltin<"__nvvm_sust_b_2d_array_i32_clamp">;
2769 def int_nvvm_sust_b_2d_array_i64_clamp
2770   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2771                    llvm_i32_ty, llvm_i64_ty], [],
2772               "llvm.nvvm.sust.b.2d.array.i64.clamp">,
2773     GCCBuiltin<"__nvvm_sust_b_2d_array_i64_clamp">;
2774 def int_nvvm_sust_b_2d_array_v2i8_clamp
2775   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2776                    llvm_i16_ty, llvm_i16_ty], [],
2777               "llvm.nvvm.sust.b.2d.array.v2i8.clamp">,
2778     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i8_clamp">;
2779 def int_nvvm_sust_b_2d_array_v2i16_clamp
2780   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2781                    llvm_i16_ty, llvm_i16_ty], [],
2782               "llvm.nvvm.sust.b.2d.array.v2i16.clamp">,
2783     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i16_clamp">;
2784 def int_nvvm_sust_b_2d_array_v2i32_clamp
2785   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2786                    llvm_i32_ty, llvm_i32_ty], [],
2787               "llvm.nvvm.sust.b.2d.array.v2i32.clamp">,
2788     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i32_clamp">;
2789 def int_nvvm_sust_b_2d_array_v2i64_clamp
2790   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2791                    llvm_i64_ty, llvm_i64_ty], [],
2792               "llvm.nvvm.sust.b.2d.array.v2i64.clamp">,
2793     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i64_clamp">;
2794 def int_nvvm_sust_b_2d_array_v4i8_clamp
2795   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2796                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2797               "llvm.nvvm.sust.b.2d.array.v4i8.clamp">,
2798     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i8_clamp">;
2799 def int_nvvm_sust_b_2d_array_v4i16_clamp
2800   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2801                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2802               "llvm.nvvm.sust.b.2d.array.v4i16.clamp">,
2803     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i16_clamp">;
2804 def int_nvvm_sust_b_2d_array_v4i32_clamp
2805   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2806                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2807               "llvm.nvvm.sust.b.2d.array.v4i32.clamp">,
2808     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i32_clamp">;
2811 def int_nvvm_sust_b_3d_i8_clamp
2812   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2813                    llvm_i32_ty, llvm_i16_ty], [],
2814               "llvm.nvvm.sust.b.3d.i8.clamp">,
2815     GCCBuiltin<"__nvvm_sust_b_3d_i8_clamp">;
2816 def int_nvvm_sust_b_3d_i16_clamp
2817   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2818                    llvm_i32_ty, llvm_i16_ty], [],
2819               "llvm.nvvm.sust.b.3d.i16.clamp">,
2820     GCCBuiltin<"__nvvm_sust_b_3d_i16_clamp">;
2821 def int_nvvm_sust_b_3d_i32_clamp
2822   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2823                    llvm_i32_ty, llvm_i32_ty], [],
2824               "llvm.nvvm.sust.b.3d.i32.clamp">,
2825     GCCBuiltin<"__nvvm_sust_b_3d_i32_clamp">;
2826 def int_nvvm_sust_b_3d_i64_clamp
2827   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2828                    llvm_i32_ty, llvm_i64_ty], [],
2829               "llvm.nvvm.sust.b.3d.i64.clamp">,
2830     GCCBuiltin<"__nvvm_sust_b_3d_i64_clamp">;
2831 def int_nvvm_sust_b_3d_v2i8_clamp
2832   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2833                    llvm_i16_ty, llvm_i16_ty], [],
2834               "llvm.nvvm.sust.b.3d.v2i8.clamp">,
2835     GCCBuiltin<"__nvvm_sust_b_3d_v2i8_clamp">;
2836 def int_nvvm_sust_b_3d_v2i16_clamp
2837   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2838                    llvm_i16_ty, llvm_i16_ty], [],
2839               "llvm.nvvm.sust.b.3d.v2i16.clamp">,
2840     GCCBuiltin<"__nvvm_sust_b_3d_v2i16_clamp">;
2841 def int_nvvm_sust_b_3d_v2i32_clamp
2842   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2843                    llvm_i32_ty, llvm_i32_ty], [],
2844               "llvm.nvvm.sust.b.3d.v2i32.clamp">,
2845     GCCBuiltin<"__nvvm_sust_b_3d_v2i32_clamp">;
2846 def int_nvvm_sust_b_3d_v2i64_clamp
2847   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2848                    llvm_i64_ty, llvm_i64_ty], [],
2849               "llvm.nvvm.sust.b.3d.v2i64.clamp">,
2850     GCCBuiltin<"__nvvm_sust_b_3d_v2i64_clamp">;
2851 def int_nvvm_sust_b_3d_v4i8_clamp
2852   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2853                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2854               "llvm.nvvm.sust.b.3d.v4i8.clamp">,
2855     GCCBuiltin<"__nvvm_sust_b_3d_v4i8_clamp">;
2856 def int_nvvm_sust_b_3d_v4i16_clamp
2857   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2858                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2859               "llvm.nvvm.sust.b.3d.v4i16.clamp">,
2860     GCCBuiltin<"__nvvm_sust_b_3d_v4i16_clamp">;
2861 def int_nvvm_sust_b_3d_v4i32_clamp
2862   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2863                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2864               "llvm.nvvm.sust.b.3d.v4i32.clamp">,
2865     GCCBuiltin<"__nvvm_sust_b_3d_v4i32_clamp">;
2868 // .trap variant
2869 def int_nvvm_sust_b_1d_i8_trap
2870   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
2871               "llvm.nvvm.sust.b.1d.i8.trap">,
2872     GCCBuiltin<"__nvvm_sust_b_1d_i8_trap">;
2873 def int_nvvm_sust_b_1d_i16_trap
2874   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
2875               "llvm.nvvm.sust.b.1d.i16.trap">,
2876     GCCBuiltin<"__nvvm_sust_b_1d_i16_trap">;
2877 def int_nvvm_sust_b_1d_i32_trap
2878   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
2879               "llvm.nvvm.sust.b.1d.i32.trap">,
2880     GCCBuiltin<"__nvvm_sust_b_1d_i32_trap">;
2881 def int_nvvm_sust_b_1d_i64_trap
2882   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty], [],
2883               "llvm.nvvm.sust.b.1d.i64.trap">,
2884     GCCBuiltin<"__nvvm_sust_b_1d_i64_trap">;
2885 def int_nvvm_sust_b_1d_v2i8_trap
2886   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
2887               "llvm.nvvm.sust.b.1d.v2i8.trap">,
2888     GCCBuiltin<"__nvvm_sust_b_1d_v2i8_trap">;
2889 def int_nvvm_sust_b_1d_v2i16_trap
2890   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
2891               "llvm.nvvm.sust.b.1d.v2i16.trap">,
2892     GCCBuiltin<"__nvvm_sust_b_1d_v2i16_trap">;
2893 def int_nvvm_sust_b_1d_v2i32_trap
2894   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2895               "llvm.nvvm.sust.b.1d.v2i32.trap">,
2896     GCCBuiltin<"__nvvm_sust_b_1d_v2i32_trap">;
2897 def int_nvvm_sust_b_1d_v2i64_trap
2898   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty, llvm_i64_ty], [],
2899               "llvm.nvvm.sust.b.1d.v2i64.trap">,
2900     GCCBuiltin<"__nvvm_sust_b_1d_v2i64_trap">;
2901 def int_nvvm_sust_b_1d_v4i8_trap
2902   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
2903                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2904               "llvm.nvvm.sust.b.1d.v4i8.trap">,
2905     GCCBuiltin<"__nvvm_sust_b_1d_v4i8_trap">;
2906 def int_nvvm_sust_b_1d_v4i16_trap
2907   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
2908                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2909               "llvm.nvvm.sust.b.1d.v4i16.trap">,
2910     GCCBuiltin<"__nvvm_sust_b_1d_v4i16_trap">;
2911 def int_nvvm_sust_b_1d_v4i32_trap
2912   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2913                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2914               "llvm.nvvm.sust.b.1d.v4i32.trap">,
2915     GCCBuiltin<"__nvvm_sust_b_1d_v4i32_trap">;
2918 def int_nvvm_sust_b_1d_array_i8_trap
2919   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2920               "llvm.nvvm.sust.b.1d.array.i8.trap">,
2921     GCCBuiltin<"__nvvm_sust_b_1d_array_i8_trap">;
2922 def int_nvvm_sust_b_1d_array_i16_trap
2923   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2924               "llvm.nvvm.sust.b.1d.array.i16.trap">,
2925     GCCBuiltin<"__nvvm_sust_b_1d_array_i16_trap">;
2926 def int_nvvm_sust_b_1d_array_i32_trap
2927   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2928               "llvm.nvvm.sust.b.1d.array.i32.trap">,
2929     GCCBuiltin<"__nvvm_sust_b_1d_array_i32_trap">;
2930 def int_nvvm_sust_b_1d_array_i64_trap
2931   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i64_ty], [],
2932               "llvm.nvvm.sust.b.1d.array.i64.trap">,
2933     GCCBuiltin<"__nvvm_sust_b_1d_array_i64_trap">;
2934 def int_nvvm_sust_b_1d_array_v2i8_trap
2935   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2936                    llvm_i16_ty, llvm_i16_ty], [],
2937               "llvm.nvvm.sust.b.1d.array.v2i8.trap">,
2938     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i8_trap">;
2939 def int_nvvm_sust_b_1d_array_v2i16_trap
2940   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2941                    llvm_i16_ty, llvm_i16_ty], [],
2942               "llvm.nvvm.sust.b.1d.array.v2i16.trap">,
2943     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i16_trap">;
2944 def int_nvvm_sust_b_1d_array_v2i32_trap
2945   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2946                    llvm_i32_ty, llvm_i32_ty], [],
2947               "llvm.nvvm.sust.b.1d.array.v2i32.trap">,
2948     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i32_trap">;
2949 def int_nvvm_sust_b_1d_array_v2i64_trap
2950   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2951                    llvm_i64_ty, llvm_i64_ty], [],
2952               "llvm.nvvm.sust.b.1d.array.v2i64.trap">,
2953     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i64_trap">;
2954 def int_nvvm_sust_b_1d_array_v4i8_trap
2955   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
2956                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2957               "llvm.nvvm.sust.b.1d.array.v4i8.trap">,
2958     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i8_trap">;
2959 def int_nvvm_sust_b_1d_array_v4i16_trap
2960   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
2961                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
2962               "llvm.nvvm.sust.b.1d.array.v4i16.trap">,
2963     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i16_trap">;
2964 def int_nvvm_sust_b_1d_array_v4i32_trap
2965   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
2966                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2967               "llvm.nvvm.sust.b.1d.array.v4i32.trap">,
2968     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i32_trap">;
2971 def int_nvvm_sust_b_2d_i8_trap
2972   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2973               "llvm.nvvm.sust.b.2d.i8.trap">,
2974     GCCBuiltin<"__nvvm_sust_b_2d_i8_trap">;
2975 def int_nvvm_sust_b_2d_i16_trap
2976   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
2977               "llvm.nvvm.sust.b.2d.i16.trap">,
2978     GCCBuiltin<"__nvvm_sust_b_2d_i16_trap">;
2979 def int_nvvm_sust_b_2d_i32_trap
2980   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
2981               "llvm.nvvm.sust.b.2d.i32.trap">,
2982     GCCBuiltin<"__nvvm_sust_b_2d_i32_trap">;
2983 def int_nvvm_sust_b_2d_i64_trap
2984   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i64_ty], [],
2985               "llvm.nvvm.sust.b.2d.i64.trap">,
2986     GCCBuiltin<"__nvvm_sust_b_2d_i64_trap">;
2987 def int_nvvm_sust_b_2d_v2i8_trap
2988   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2989                    llvm_i16_ty, llvm_i16_ty], [],
2990               "llvm.nvvm.sust.b.2d.v2i8.trap">,
2991     GCCBuiltin<"__nvvm_sust_b_2d_v2i8_trap">;
2992 def int_nvvm_sust_b_2d_v2i16_trap
2993   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2994                    llvm_i16_ty, llvm_i16_ty], [],
2995               "llvm.nvvm.sust.b.2d.v2i16.trap">,
2996     GCCBuiltin<"__nvvm_sust_b_2d_v2i16_trap">;
2997 def int_nvvm_sust_b_2d_v2i32_trap
2998   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
2999                    llvm_i32_ty, llvm_i32_ty], [],
3000               "llvm.nvvm.sust.b.2d.v2i32.trap">,
3001     GCCBuiltin<"__nvvm_sust_b_2d_v2i32_trap">;
3002 def int_nvvm_sust_b_2d_v2i64_trap
3003   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3004                    llvm_i64_ty, llvm_i64_ty], [],
3005               "llvm.nvvm.sust.b.2d.v2i64.trap">,
3006     GCCBuiltin<"__nvvm_sust_b_2d_v2i64_trap">;
3007 def int_nvvm_sust_b_2d_v4i8_trap
3008   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3009                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3010               "llvm.nvvm.sust.b.2d.v4i8.trap">,
3011     GCCBuiltin<"__nvvm_sust_b_2d_v4i8_trap">;
3012 def int_nvvm_sust_b_2d_v4i16_trap
3013   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3014                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3015               "llvm.nvvm.sust.b.2d.v4i16.trap">,
3016     GCCBuiltin<"__nvvm_sust_b_2d_v4i16_trap">;
3017 def int_nvvm_sust_b_2d_v4i32_trap
3018   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3019                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3020               "llvm.nvvm.sust.b.2d.v4i32.trap">,
3021     GCCBuiltin<"__nvvm_sust_b_2d_v4i32_trap">;
3024 def int_nvvm_sust_b_2d_array_i8_trap
3025   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3026                    llvm_i32_ty, llvm_i16_ty], [],
3027               "llvm.nvvm.sust.b.2d.array.i8.trap">,
3028     GCCBuiltin<"__nvvm_sust_b_2d_array_i8_trap">;
3029 def int_nvvm_sust_b_2d_array_i16_trap
3030   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3031                    llvm_i32_ty, llvm_i16_ty], [],
3032               "llvm.nvvm.sust.b.2d.array.i16.trap">,
3033     GCCBuiltin<"__nvvm_sust_b_2d_array_i16_trap">;
3034 def int_nvvm_sust_b_2d_array_i32_trap
3035   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3036                    llvm_i32_ty, llvm_i32_ty], [],
3037               "llvm.nvvm.sust.b.2d.array.i32.trap">,
3038     GCCBuiltin<"__nvvm_sust_b_2d_array_i32_trap">;
3039 def int_nvvm_sust_b_2d_array_i64_trap
3040   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3041                    llvm_i32_ty, llvm_i64_ty], [],
3042               "llvm.nvvm.sust.b.2d.array.i64.trap">,
3043     GCCBuiltin<"__nvvm_sust_b_2d_array_i64_trap">;
3044 def int_nvvm_sust_b_2d_array_v2i8_trap
3045   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3046                    llvm_i16_ty, llvm_i16_ty], [],
3047               "llvm.nvvm.sust.b.2d.array.v2i8.trap">,
3048     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i8_trap">;
3049 def int_nvvm_sust_b_2d_array_v2i16_trap
3050   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3051                    llvm_i16_ty, llvm_i16_ty], [],
3052               "llvm.nvvm.sust.b.2d.array.v2i16.trap">,
3053     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i16_trap">;
3054 def int_nvvm_sust_b_2d_array_v2i32_trap
3055   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3056                    llvm_i32_ty, llvm_i32_ty], [],
3057               "llvm.nvvm.sust.b.2d.array.v2i32.trap">,
3058     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i32_trap">;
3059 def int_nvvm_sust_b_2d_array_v2i64_trap
3060   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3061                    llvm_i64_ty, llvm_i64_ty], [],
3062               "llvm.nvvm.sust.b.2d.array.v2i64.trap">,
3063     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i64_trap">;
3064 def int_nvvm_sust_b_2d_array_v4i8_trap
3065   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3066                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3067               "llvm.nvvm.sust.b.2d.array.v4i8.trap">,
3068     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i8_trap">;
3069 def int_nvvm_sust_b_2d_array_v4i16_trap
3070   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3071                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3072               "llvm.nvvm.sust.b.2d.array.v4i16.trap">,
3073     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i16_trap">;
3074 def int_nvvm_sust_b_2d_array_v4i32_trap
3075   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3076                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3077               "llvm.nvvm.sust.b.2d.array.v4i32.trap">,
3078     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i32_trap">;
3081 def int_nvvm_sust_b_3d_i8_trap
3082   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3083                    llvm_i32_ty, llvm_i16_ty], [],
3084               "llvm.nvvm.sust.b.3d.i8.trap">,
3085     GCCBuiltin<"__nvvm_sust_b_3d_i8_trap">;
3086 def int_nvvm_sust_b_3d_i16_trap
3087   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3088                    llvm_i32_ty, llvm_i16_ty], [],
3089               "llvm.nvvm.sust.b.3d.i16.trap">,
3090     GCCBuiltin<"__nvvm_sust_b_3d_i16_trap">;
3091 def int_nvvm_sust_b_3d_i32_trap
3092   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3093                    llvm_i32_ty, llvm_i32_ty], [],
3094               "llvm.nvvm.sust.b.3d.i32.trap">,
3095     GCCBuiltin<"__nvvm_sust_b_3d_i32_trap">;
3096 def int_nvvm_sust_b_3d_i64_trap
3097   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3098                    llvm_i32_ty, llvm_i64_ty], [],
3099               "llvm.nvvm.sust.b.3d.i64.trap">,
3100     GCCBuiltin<"__nvvm_sust_b_3d_i64_trap">;
3101 def int_nvvm_sust_b_3d_v2i8_trap
3102   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3103                    llvm_i16_ty, llvm_i16_ty], [],
3104               "llvm.nvvm.sust.b.3d.v2i8.trap">,
3105     GCCBuiltin<"__nvvm_sust_b_3d_v2i8_trap">;
3106 def int_nvvm_sust_b_3d_v2i16_trap
3107   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3108                    llvm_i16_ty, llvm_i16_ty], [],
3109               "llvm.nvvm.sust.b.3d.v2i16.trap">,
3110     GCCBuiltin<"__nvvm_sust_b_3d_v2i16_trap">;
3111 def int_nvvm_sust_b_3d_v2i32_trap
3112   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3113                    llvm_i32_ty, llvm_i32_ty], [],
3114               "llvm.nvvm.sust.b.3d.v2i32.trap">,
3115     GCCBuiltin<"__nvvm_sust_b_3d_v2i32_trap">;
3116 def int_nvvm_sust_b_3d_v2i64_trap
3117   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3118                    llvm_i64_ty, llvm_i64_ty], [],
3119               "llvm.nvvm.sust.b.3d.v2i64.trap">,
3120     GCCBuiltin<"__nvvm_sust_b_3d_v2i64_trap">;
3121 def int_nvvm_sust_b_3d_v4i8_trap
3122   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3123                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3124               "llvm.nvvm.sust.b.3d.v4i8.trap">,
3125     GCCBuiltin<"__nvvm_sust_b_3d_v4i8_trap">;
3126 def int_nvvm_sust_b_3d_v4i16_trap
3127   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3128                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3129               "llvm.nvvm.sust.b.3d.v4i16.trap">,
3130     GCCBuiltin<"__nvvm_sust_b_3d_v4i16_trap">;
3131 def int_nvvm_sust_b_3d_v4i32_trap
3132   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3133                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3134               "llvm.nvvm.sust.b.3d.v4i32.trap">,
3135     GCCBuiltin<"__nvvm_sust_b_3d_v4i32_trap">;
3138 // .zero variant
3139 def int_nvvm_sust_b_1d_i8_zero
3140   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
3141               "llvm.nvvm.sust.b.1d.i8.zero">,
3142     GCCBuiltin<"__nvvm_sust_b_1d_i8_zero">;
3143 def int_nvvm_sust_b_1d_i16_zero
3144   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
3145               "llvm.nvvm.sust.b.1d.i16.zero">,
3146     GCCBuiltin<"__nvvm_sust_b_1d_i16_zero">;
3147 def int_nvvm_sust_b_1d_i32_zero
3148   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
3149               "llvm.nvvm.sust.b.1d.i32.zero">,
3150     GCCBuiltin<"__nvvm_sust_b_1d_i32_zero">;
3151 def int_nvvm_sust_b_1d_i64_zero
3152   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty], [],
3153               "llvm.nvvm.sust.b.1d.i64.zero">,
3154     GCCBuiltin<"__nvvm_sust_b_1d_i64_zero">;
3155 def int_nvvm_sust_b_1d_v2i8_zero
3156   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
3157               "llvm.nvvm.sust.b.1d.v2i8.zero">,
3158     GCCBuiltin<"__nvvm_sust_b_1d_v2i8_zero">;
3159 def int_nvvm_sust_b_1d_v2i16_zero
3160   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
3161               "llvm.nvvm.sust.b.1d.v2i16.zero">,
3162     GCCBuiltin<"__nvvm_sust_b_1d_v2i16_zero">;
3163 def int_nvvm_sust_b_1d_v2i32_zero
3164   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3165               "llvm.nvvm.sust.b.1d.v2i32.zero">,
3166     GCCBuiltin<"__nvvm_sust_b_1d_v2i32_zero">;
3167 def int_nvvm_sust_b_1d_v2i64_zero
3168   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i64_ty, llvm_i64_ty], [],
3169               "llvm.nvvm.sust.b.1d.v2i64.zero">,
3170     GCCBuiltin<"__nvvm_sust_b_1d_v2i64_zero">;
3171 def int_nvvm_sust_b_1d_v4i8_zero
3172   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
3173                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3174               "llvm.nvvm.sust.b.1d.v4i8.zero">,
3175     GCCBuiltin<"__nvvm_sust_b_1d_v4i8_zero">;
3176 def int_nvvm_sust_b_1d_v4i16_zero
3177   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
3178                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3179               "llvm.nvvm.sust.b.1d.v4i16.zero">,
3180     GCCBuiltin<"__nvvm_sust_b_1d_v4i16_zero">;
3181 def int_nvvm_sust_b_1d_v4i32_zero
3182   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3183                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3184               "llvm.nvvm.sust.b.1d.v4i32.zero">,
3185     GCCBuiltin<"__nvvm_sust_b_1d_v4i32_zero">;
3188 def int_nvvm_sust_b_1d_array_i8_zero
3189   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3190               "llvm.nvvm.sust.b.1d.array.i8.zero">,
3191     GCCBuiltin<"__nvvm_sust_b_1d_array_i8_zero">;
3192 def int_nvvm_sust_b_1d_array_i16_zero
3193   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3194               "llvm.nvvm.sust.b.1d.array.i16.zero">,
3195     GCCBuiltin<"__nvvm_sust_b_1d_array_i16_zero">;
3196 def int_nvvm_sust_b_1d_array_i32_zero
3197   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3198               "llvm.nvvm.sust.b.1d.array.i32.zero">,
3199     GCCBuiltin<"__nvvm_sust_b_1d_array_i32_zero">;
3200 def int_nvvm_sust_b_1d_array_i64_zero
3201   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i64_ty], [],
3202               "llvm.nvvm.sust.b.1d.array.i64.zero">,
3203     GCCBuiltin<"__nvvm_sust_b_1d_array_i64_zero">;
3204 def int_nvvm_sust_b_1d_array_v2i8_zero
3205   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3206                    llvm_i16_ty, llvm_i16_ty], [],
3207               "llvm.nvvm.sust.b.1d.array.v2i8.zero">,
3208     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i8_zero">;
3209 def int_nvvm_sust_b_1d_array_v2i16_zero
3210   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3211                    llvm_i16_ty, llvm_i16_ty], [],
3212               "llvm.nvvm.sust.b.1d.array.v2i16.zero">,
3213     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i16_zero">;
3214 def int_nvvm_sust_b_1d_array_v2i32_zero
3215   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3216                    llvm_i32_ty, llvm_i32_ty], [],
3217               "llvm.nvvm.sust.b.1d.array.v2i32.zero">,
3218     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i32_zero">;
3219 def int_nvvm_sust_b_1d_array_v2i64_zero
3220   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3221                    llvm_i64_ty, llvm_i64_ty], [],
3222               "llvm.nvvm.sust.b.1d.array.v2i64.zero">,
3223     GCCBuiltin<"__nvvm_sust_b_1d_array_v2i64_zero">;
3224 def int_nvvm_sust_b_1d_array_v4i8_zero
3225   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3226                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3227               "llvm.nvvm.sust.b.1d.array.v4i8.zero">,
3228     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i8_zero">;
3229 def int_nvvm_sust_b_1d_array_v4i16_zero
3230   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3231                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3232               "llvm.nvvm.sust.b.1d.array.v4i16.zero">,
3233     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i16_zero">;
3234 def int_nvvm_sust_b_1d_array_v4i32_zero
3235   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3236                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3237               "llvm.nvvm.sust.b.1d.array.v4i32.zero">,
3238     GCCBuiltin<"__nvvm_sust_b_1d_array_v4i32_zero">;
3241 def int_nvvm_sust_b_2d_i8_zero
3242   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3243               "llvm.nvvm.sust.b.2d.i8.zero">,
3244     GCCBuiltin<"__nvvm_sust_b_2d_i8_zero">;
3245 def int_nvvm_sust_b_2d_i16_zero
3246   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3247               "llvm.nvvm.sust.b.2d.i16.zero">,
3248     GCCBuiltin<"__nvvm_sust_b_2d_i16_zero">;
3249 def int_nvvm_sust_b_2d_i32_zero
3250   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3251               "llvm.nvvm.sust.b.2d.i32.zero">,
3252     GCCBuiltin<"__nvvm_sust_b_2d_i32_zero">;
3253 def int_nvvm_sust_b_2d_i64_zero
3254   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i64_ty], [],
3255               "llvm.nvvm.sust.b.2d.i64.zero">,
3256     GCCBuiltin<"__nvvm_sust_b_2d_i64_zero">;
3257 def int_nvvm_sust_b_2d_v2i8_zero
3258   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3259                    llvm_i16_ty, llvm_i16_ty], [],
3260               "llvm.nvvm.sust.b.2d.v2i8.zero">,
3261     GCCBuiltin<"__nvvm_sust_b_2d_v2i8_zero">;
3262 def int_nvvm_sust_b_2d_v2i16_zero
3263   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3264                    llvm_i16_ty, llvm_i16_ty], [],
3265               "llvm.nvvm.sust.b.2d.v2i16.zero">,
3266     GCCBuiltin<"__nvvm_sust_b_2d_v2i16_zero">;
3267 def int_nvvm_sust_b_2d_v2i32_zero
3268   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3269                    llvm_i32_ty, llvm_i32_ty], [],
3270               "llvm.nvvm.sust.b.2d.v2i32.zero">,
3271     GCCBuiltin<"__nvvm_sust_b_2d_v2i32_zero">;
3272 def int_nvvm_sust_b_2d_v2i64_zero
3273   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3274                    llvm_i64_ty, llvm_i64_ty], [],
3275               "llvm.nvvm.sust.b.2d.v2i64.zero">,
3276     GCCBuiltin<"__nvvm_sust_b_2d_v2i64_zero">;
3277 def int_nvvm_sust_b_2d_v4i8_zero
3278   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3279                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3280               "llvm.nvvm.sust.b.2d.v4i8.zero">,
3281     GCCBuiltin<"__nvvm_sust_b_2d_v4i8_zero">;
3282 def int_nvvm_sust_b_2d_v4i16_zero
3283   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3284                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3285               "llvm.nvvm.sust.b.2d.v4i16.zero">,
3286     GCCBuiltin<"__nvvm_sust_b_2d_v4i16_zero">;
3287 def int_nvvm_sust_b_2d_v4i32_zero
3288   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3289                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3290               "llvm.nvvm.sust.b.2d.v4i32.zero">,
3291     GCCBuiltin<"__nvvm_sust_b_2d_v4i32_zero">;
3294 def int_nvvm_sust_b_2d_array_i8_zero
3295   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3296                    llvm_i32_ty, llvm_i16_ty], [],
3297               "llvm.nvvm.sust.b.2d.array.i8.zero">,
3298     GCCBuiltin<"__nvvm_sust_b_2d_array_i8_zero">;
3299 def int_nvvm_sust_b_2d_array_i16_zero
3300   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3301                    llvm_i32_ty, llvm_i16_ty], [],
3302               "llvm.nvvm.sust.b.2d.array.i16.zero">,
3303     GCCBuiltin<"__nvvm_sust_b_2d_array_i16_zero">;
3304 def int_nvvm_sust_b_2d_array_i32_zero
3305   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3306                    llvm_i32_ty, llvm_i32_ty], [],
3307               "llvm.nvvm.sust.b.2d.array.i32.zero">,
3308     GCCBuiltin<"__nvvm_sust_b_2d_array_i32_zero">;
3309 def int_nvvm_sust_b_2d_array_i64_zero
3310   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3311                    llvm_i32_ty, llvm_i64_ty], [],
3312               "llvm.nvvm.sust.b.2d.array.i64.zero">,
3313     GCCBuiltin<"__nvvm_sust_b_2d_array_i64_zero">;
3314 def int_nvvm_sust_b_2d_array_v2i8_zero
3315   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3316                    llvm_i16_ty, llvm_i16_ty], [],
3317               "llvm.nvvm.sust.b.2d.array.v2i8.zero">,
3318     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i8_zero">;
3319 def int_nvvm_sust_b_2d_array_v2i16_zero
3320   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3321                    llvm_i16_ty, llvm_i16_ty], [],
3322               "llvm.nvvm.sust.b.2d.array.v2i16.zero">,
3323     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i16_zero">;
3324 def int_nvvm_sust_b_2d_array_v2i32_zero
3325   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3326                    llvm_i32_ty, llvm_i32_ty], [],
3327               "llvm.nvvm.sust.b.2d.array.v2i32.zero">,
3328     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i32_zero">;
3329 def int_nvvm_sust_b_2d_array_v2i64_zero
3330   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3331                    llvm_i64_ty, llvm_i64_ty], [],
3332               "llvm.nvvm.sust.b.2d.array.v2i64.zero">,
3333     GCCBuiltin<"__nvvm_sust_b_2d_array_v2i64_zero">;
3334 def int_nvvm_sust_b_2d_array_v4i8_zero
3335   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3336                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3337               "llvm.nvvm.sust.b.2d.array.v4i8.zero">,
3338     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i8_zero">;
3339 def int_nvvm_sust_b_2d_array_v4i16_zero
3340   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3341                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3342               "llvm.nvvm.sust.b.2d.array.v4i16.zero">,
3343     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i16_zero">;
3344 def int_nvvm_sust_b_2d_array_v4i32_zero
3345   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3346                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3347               "llvm.nvvm.sust.b.2d.array.v4i32.zero">,
3348     GCCBuiltin<"__nvvm_sust_b_2d_array_v4i32_zero">;
3351 def int_nvvm_sust_b_3d_i8_zero
3352   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3353                    llvm_i32_ty, llvm_i16_ty], [],
3354               "llvm.nvvm.sust.b.3d.i8.zero">,
3355     GCCBuiltin<"__nvvm_sust_b_3d_i8_zero">;
3356 def int_nvvm_sust_b_3d_i16_zero
3357   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3358                    llvm_i32_ty, llvm_i16_ty], [],
3359               "llvm.nvvm.sust.b.3d.i16.zero">,
3360     GCCBuiltin<"__nvvm_sust_b_3d_i16_zero">;
3361 def int_nvvm_sust_b_3d_i32_zero
3362   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3363                    llvm_i32_ty, llvm_i32_ty], [],
3364               "llvm.nvvm.sust.b.3d.i32.zero">,
3365     GCCBuiltin<"__nvvm_sust_b_3d_i32_zero">;
3366 def int_nvvm_sust_b_3d_i64_zero
3367   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3368                    llvm_i32_ty, llvm_i64_ty], [],
3369               "llvm.nvvm.sust.b.3d.i64.zero">,
3370     GCCBuiltin<"__nvvm_sust_b_3d_i64_zero">;
3371 def int_nvvm_sust_b_3d_v2i8_zero
3372   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3373                    llvm_i16_ty, llvm_i16_ty], [],
3374               "llvm.nvvm.sust.b.3d.v2i8.zero">,
3375     GCCBuiltin<"__nvvm_sust_b_3d_v2i8_zero">;
3376 def int_nvvm_sust_b_3d_v2i16_zero
3377   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3378                    llvm_i16_ty, llvm_i16_ty], [],
3379               "llvm.nvvm.sust.b.3d.v2i16.zero">,
3380     GCCBuiltin<"__nvvm_sust_b_3d_v2i16_zero">;
3381 def int_nvvm_sust_b_3d_v2i32_zero
3382   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3383                    llvm_i32_ty, llvm_i32_ty], [],
3384               "llvm.nvvm.sust.b.3d.v2i32.zero">,
3385     GCCBuiltin<"__nvvm_sust_b_3d_v2i32_zero">;
3386 def int_nvvm_sust_b_3d_v2i64_zero
3387   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3388                    llvm_i64_ty, llvm_i64_ty], [],
3389               "llvm.nvvm.sust.b.3d.v2i64.zero">,
3390     GCCBuiltin<"__nvvm_sust_b_3d_v2i64_zero">;
3391 def int_nvvm_sust_b_3d_v4i8_zero
3392   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3393                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3394               "llvm.nvvm.sust.b.3d.v4i8.zero">,
3395     GCCBuiltin<"__nvvm_sust_b_3d_v4i8_zero">;
3396 def int_nvvm_sust_b_3d_v4i16_zero
3397   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3398                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3399               "llvm.nvvm.sust.b.3d.v4i16.zero">,
3400     GCCBuiltin<"__nvvm_sust_b_3d_v4i16_zero">;
3401 def int_nvvm_sust_b_3d_v4i32_zero
3402   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3403                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3404               "llvm.nvvm.sust.b.3d.v4i32.zero">,
3405     GCCBuiltin<"__nvvm_sust_b_3d_v4i32_zero">;
3409 // Formatted
3411 def int_nvvm_sust_p_1d_i8_trap
3412   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
3413               "llvm.nvvm.sust.p.1d.i8.trap">,
3414     GCCBuiltin<"__nvvm_sust_p_1d_i8_trap">;
3415 def int_nvvm_sust_p_1d_i16_trap
3416   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty], [],
3417               "llvm.nvvm.sust.p.1d.i16.trap">,
3418     GCCBuiltin<"__nvvm_sust_p_1d_i16_trap">;
3419 def int_nvvm_sust_p_1d_i32_trap
3420   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], [],
3421               "llvm.nvvm.sust.p.1d.i32.trap">,
3422     GCCBuiltin<"__nvvm_sust_p_1d_i32_trap">;
3423 def int_nvvm_sust_p_1d_v2i8_trap
3424   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
3425               "llvm.nvvm.sust.p.1d.v2i8.trap">,
3426     GCCBuiltin<"__nvvm_sust_p_1d_v2i8_trap">;
3427 def int_nvvm_sust_p_1d_v2i16_trap
3428   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty, llvm_i16_ty], [],
3429               "llvm.nvvm.sust.p.1d.v2i16.trap">,
3430     GCCBuiltin<"__nvvm_sust_p_1d_v2i16_trap">;
3431 def int_nvvm_sust_p_1d_v2i32_trap
3432   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3433               "llvm.nvvm.sust.p.1d.v2i32.trap">,
3434     GCCBuiltin<"__nvvm_sust_p_1d_v2i32_trap">;
3435 def int_nvvm_sust_p_1d_v4i8_trap
3436   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
3437                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3438               "llvm.nvvm.sust.p.1d.v4i8.trap">,
3439     GCCBuiltin<"__nvvm_sust_p_1d_v4i8_trap">;
3440 def int_nvvm_sust_p_1d_v4i16_trap
3441   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i16_ty,
3442                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3443               "llvm.nvvm.sust.p.1d.v4i16.trap">,
3444     GCCBuiltin<"__nvvm_sust_p_1d_v4i16_trap">;
3445 def int_nvvm_sust_p_1d_v4i32_trap
3446   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3447                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3448               "llvm.nvvm.sust.p.1d.v4i32.trap">,
3449     GCCBuiltin<"__nvvm_sust_p_1d_v4i32_trap">;
3452 def int_nvvm_sust_p_1d_array_i8_trap
3453   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3454               "llvm.nvvm.sust.p.1d.array.i8.trap">,
3455     GCCBuiltin<"__nvvm_sust_p_1d_array_i8_trap">;
3456 def int_nvvm_sust_p_1d_array_i16_trap
3457   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3458               "llvm.nvvm.sust.p.1d.array.i16.trap">,
3459     GCCBuiltin<"__nvvm_sust_p_1d_array_i16_trap">;
3460 def int_nvvm_sust_p_1d_array_i32_trap
3461   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3462               "llvm.nvvm.sust.p.1d.array.i32.trap">,
3463     GCCBuiltin<"__nvvm_sust_p_1d_array_i32_trap">;
3464 def int_nvvm_sust_p_1d_array_v2i8_trap
3465   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3466                    llvm_i16_ty, llvm_i16_ty], [],
3467               "llvm.nvvm.sust.p.1d.array.v2i8.trap">,
3468     GCCBuiltin<"__nvvm_sust_p_1d_array_v2i8_trap">;
3469 def int_nvvm_sust_p_1d_array_v2i16_trap
3470   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3471                    llvm_i16_ty, llvm_i16_ty], [],
3472               "llvm.nvvm.sust.p.1d.array.v2i16.trap">,
3473     GCCBuiltin<"__nvvm_sust_p_1d_array_v2i16_trap">;
3474 def int_nvvm_sust_p_1d_array_v2i32_trap
3475   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3476                    llvm_i32_ty, llvm_i32_ty], [],
3477               "llvm.nvvm.sust.p.1d.array.v2i32.trap">,
3478     GCCBuiltin<"__nvvm_sust_p_1d_array_v2i32_trap">;
3479 def int_nvvm_sust_p_1d_array_v4i8_trap
3480   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3481                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3482               "llvm.nvvm.sust.p.1d.array.v4i8.trap">,
3483     GCCBuiltin<"__nvvm_sust_p_1d_array_v4i8_trap">;
3484 def int_nvvm_sust_p_1d_array_v4i16_trap
3485   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3486                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3487               "llvm.nvvm.sust.p.1d.array.v4i16.trap">,
3488     GCCBuiltin<"__nvvm_sust_p_1d_array_v4i16_trap">;
3489 def int_nvvm_sust_p_1d_array_v4i32_trap
3490   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3491                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3492               "llvm.nvvm.sust.p.1d.array.v4i32.trap">,
3493     GCCBuiltin<"__nvvm_sust_p_1d_array_v4i32_trap">;
3496 def int_nvvm_sust_p_2d_i8_trap
3497   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3498               "llvm.nvvm.sust.p.2d.i8.trap">,
3499     GCCBuiltin<"__nvvm_sust_p_2d_i8_trap">;
3500 def int_nvvm_sust_p_2d_i16_trap
3501   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty], [],
3502               "llvm.nvvm.sust.p.2d.i16.trap">,
3503     GCCBuiltin<"__nvvm_sust_p_2d_i16_trap">;
3504 def int_nvvm_sust_p_2d_i32_trap
3505   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3506               "llvm.nvvm.sust.p.2d.i32.trap">,
3507     GCCBuiltin<"__nvvm_sust_p_2d_i32_trap">;
3508 def int_nvvm_sust_p_2d_v2i8_trap
3509   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3510                    llvm_i16_ty, llvm_i16_ty], [],
3511               "llvm.nvvm.sust.p.2d.v2i8.trap">,
3512     GCCBuiltin<"__nvvm_sust_p_2d_v2i8_trap">;
3513 def int_nvvm_sust_p_2d_v2i16_trap
3514   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3515                    llvm_i16_ty, llvm_i16_ty], [],
3516               "llvm.nvvm.sust.p.2d.v2i16.trap">,
3517     GCCBuiltin<"__nvvm_sust_p_2d_v2i16_trap">;
3518 def int_nvvm_sust_p_2d_v2i32_trap
3519   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3520                    llvm_i32_ty, llvm_i32_ty], [],
3521               "llvm.nvvm.sust.p.2d.v2i32.trap">,
3522     GCCBuiltin<"__nvvm_sust_p_2d_v2i32_trap">;
3523 def int_nvvm_sust_p_2d_v4i8_trap
3524   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3525                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3526               "llvm.nvvm.sust.p.2d.v4i8.trap">,
3527     GCCBuiltin<"__nvvm_sust_p_2d_v4i8_trap">;
3528 def int_nvvm_sust_p_2d_v4i16_trap
3529   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i16_ty,
3530                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3531               "llvm.nvvm.sust.p.2d.v4i16.trap">,
3532     GCCBuiltin<"__nvvm_sust_p_2d_v4i16_trap">;
3533 def int_nvvm_sust_p_2d_v4i32_trap
3534   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3535                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3536               "llvm.nvvm.sust.p.2d.v4i32.trap">,
3537     GCCBuiltin<"__nvvm_sust_p_2d_v4i32_trap">;
3540 def int_nvvm_sust_p_2d_array_i8_trap
3541   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3542                    llvm_i32_ty, llvm_i16_ty], [],
3543               "llvm.nvvm.sust.p.2d.array.i8.trap">,
3544     GCCBuiltin<"__nvvm_sust_p_2d_array_i8_trap">;
3545 def int_nvvm_sust_p_2d_array_i16_trap
3546   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3547                    llvm_i32_ty, llvm_i16_ty], [],
3548               "llvm.nvvm.sust.p.2d.array.i16.trap">,
3549     GCCBuiltin<"__nvvm_sust_p_2d_array_i16_trap">;
3550 def int_nvvm_sust_p_2d_array_i32_trap
3551   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3552                    llvm_i32_ty, llvm_i32_ty], [],
3553               "llvm.nvvm.sust.p.2d.array.i32.trap">,
3554     GCCBuiltin<"__nvvm_sust_p_2d_array_i32_trap">;
3555 def int_nvvm_sust_p_2d_array_v2i8_trap
3556   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3557                    llvm_i16_ty, llvm_i16_ty], [],
3558               "llvm.nvvm.sust.p.2d.array.v2i8.trap">,
3559     GCCBuiltin<"__nvvm_sust_p_2d_array_v2i8_trap">;
3560 def int_nvvm_sust_p_2d_array_v2i16_trap
3561   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3562                    llvm_i16_ty, llvm_i16_ty], [],
3563               "llvm.nvvm.sust.p.2d.array.v2i16.trap">,
3564     GCCBuiltin<"__nvvm_sust_p_2d_array_v2i16_trap">;
3565 def int_nvvm_sust_p_2d_array_v2i32_trap
3566   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3567                    llvm_i32_ty, llvm_i32_ty], [],
3568               "llvm.nvvm.sust.p.2d.array.v2i32.trap">,
3569     GCCBuiltin<"__nvvm_sust_p_2d_array_v2i32_trap">;
3570 def int_nvvm_sust_p_2d_array_v4i8_trap
3571   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3572                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3573               "llvm.nvvm.sust.p.2d.array.v4i8.trap">,
3574     GCCBuiltin<"__nvvm_sust_p_2d_array_v4i8_trap">;
3575 def int_nvvm_sust_p_2d_array_v4i16_trap
3576   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3577                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3578               "llvm.nvvm.sust.p.2d.array.v4i16.trap">,
3579     GCCBuiltin<"__nvvm_sust_p_2d_array_v4i16_trap">;
3580 def int_nvvm_sust_p_2d_array_v4i32_trap
3581   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3582                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3583               "llvm.nvvm.sust.p.2d.array.v4i32.trap">,
3584     GCCBuiltin<"__nvvm_sust_p_2d_array_v4i32_trap">;
3587 def int_nvvm_sust_p_3d_i8_trap
3588   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3589                    llvm_i32_ty, llvm_i16_ty], [],
3590               "llvm.nvvm.sust.p.3d.i8.trap">,
3591     GCCBuiltin<"__nvvm_sust_p_3d_i8_trap">;
3592 def int_nvvm_sust_p_3d_i16_trap
3593   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3594                    llvm_i32_ty, llvm_i16_ty], [],
3595               "llvm.nvvm.sust.p.3d.i16.trap">,
3596     GCCBuiltin<"__nvvm_sust_p_3d_i16_trap">;
3597 def int_nvvm_sust_p_3d_i32_trap
3598   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty,
3599                    llvm_i32_ty, llvm_i32_ty], [],
3600               "llvm.nvvm.sust.p.3d.i32.trap">,
3601     GCCBuiltin<"__nvvm_sust_p_3d_i32_trap">;
3602 def int_nvvm_sust_p_3d_v2i8_trap
3603   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3604                    llvm_i16_ty, llvm_i16_ty], [],
3605               "llvm.nvvm.sust.p.3d.v2i8.trap">,
3606     GCCBuiltin<"__nvvm_sust_p_3d_v2i8_trap">;
3607 def int_nvvm_sust_p_3d_v2i16_trap
3608   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3609                    llvm_i16_ty, llvm_i16_ty], [],
3610               "llvm.nvvm.sust.p.3d.v2i16.trap">,
3611     GCCBuiltin<"__nvvm_sust_p_3d_v2i16_trap">;
3612 def int_nvvm_sust_p_3d_v2i32_trap
3613   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3614                    llvm_i32_ty, llvm_i32_ty], [],
3615               "llvm.nvvm.sust.p.3d.v2i32.trap">,
3616     GCCBuiltin<"__nvvm_sust_p_3d_v2i32_trap">;
3617 def int_nvvm_sust_p_3d_v4i8_trap
3618   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3619                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3620               "llvm.nvvm.sust.p.3d.v4i8.trap">,
3621     GCCBuiltin<"__nvvm_sust_p_3d_v4i8_trap">;
3622 def int_nvvm_sust_p_3d_v4i16_trap
3623   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3624                    llvm_i16_ty, llvm_i16_ty, llvm_i16_ty, llvm_i16_ty], [],
3625               "llvm.nvvm.sust.p.3d.v4i16.trap">,
3626     GCCBuiltin<"__nvvm_sust_p_3d_v4i16_trap">;
3627 def int_nvvm_sust_p_3d_v4i32_trap
3628   : Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
3629                    llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [],
3630               "llvm.nvvm.sust.p.3d.v4i32.trap">,
3631     GCCBuiltin<"__nvvm_sust_p_3d_v4i32_trap">;
3634 def int_nvvm_rotate_b32
3635   : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
3636               [IntrNoMem], "llvm.nvvm.rotate.b32">,
3637               GCCBuiltin<"__nvvm_rotate_b32">;
3639 def int_nvvm_rotate_b64
3640   :Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty],
3641              [IntrNoMem], "llvm.nvvm.rotate.b64">,
3642              GCCBuiltin<"__nvvm_rotate_b64">;
3644 def int_nvvm_rotate_right_b64
3645   : Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty],
3646               [IntrNoMem], "llvm.nvvm.rotate.right.b64">,
3647               GCCBuiltin<"__nvvm_rotate_right_b64">;
3649 def int_nvvm_swap_lo_hi_b64
3650   : Intrinsic<[llvm_i64_ty], [llvm_i64_ty],
3651               [IntrNoMem], "llvm.nvvm.swap.lo.hi.b64">,
3652               GCCBuiltin<"__nvvm_swap_lo_hi_b64">;
3655 // Accessing special registers.
3656 multiclass PTXReadSRegIntrinsic_v4i32<string regname> {
3657 // FIXME: Do we need the 128-bit integer type version?
3658 //    def _r64   : Intrinsic<[llvm_i128_ty],   [], [IntrNoMem]>;
3660 // FIXME: Enable this once v4i32 support is enabled in back-end.
3661 //    def _v4i16 : Intrinsic<[llvm_v4i32_ty], [], [IntrNoMem]>;
3663   def _x     : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>,
3664                GCCBuiltin<"__nvvm_read_ptx_sreg_" # regname # "_x">;
3665   def _y     : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>,
3666                GCCBuiltin<"__nvvm_read_ptx_sreg_" # regname # "_y">;
3667   def _z     : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>,
3668                GCCBuiltin<"__nvvm_read_ptx_sreg_" # regname # "_z">;
3669   def _w     : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>,
3670                GCCBuiltin<"__nvvm_read_ptx_sreg_" # regname # "_w">;
3673 class PTXReadSRegIntrinsic_r32<string name>
3674   : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>,
3675     GCCBuiltin<"__nvvm_read_ptx_sreg_" # name>;
3676 class PTXReadSRegIntrinsic_r64<string name>
3677   : Intrinsic<[llvm_i64_ty], [], [IntrNoMem]>,
3678     GCCBuiltin<"__nvvm_read_ptx_sreg_" # name>;
3680 // Intrinsics to read registers with non-constant values. E.g. the values that
3681 // do change over the kernel lifetime. Such reads should not be CSE'd.
3682 class PTXReadNCSRegIntrinsic_r32<string name>
3683   : Intrinsic<[llvm_i32_ty], [], [IntrInaccessibleMemOnly]>,
3684     GCCBuiltin<"__nvvm_read_ptx_sreg_" # name>;
3685 class PTXReadNCSRegIntrinsic_r64<string name>
3686   : Intrinsic<[llvm_i64_ty], [], [IntrInaccessibleMemOnly]>,
3687     GCCBuiltin<"__nvvm_read_ptx_sreg_" # name>;
3689 defm int_nvvm_read_ptx_sreg_tid : PTXReadSRegIntrinsic_v4i32<"tid">;
3690 defm int_nvvm_read_ptx_sreg_ntid : PTXReadSRegIntrinsic_v4i32<"ntid">;
3692 def int_nvvm_read_ptx_sreg_laneid : PTXReadSRegIntrinsic_r32<"laneid">;
3693 def int_nvvm_read_ptx_sreg_warpid : PTXReadSRegIntrinsic_r32<"warpid">;
3694 def int_nvvm_read_ptx_sreg_nwarpid : PTXReadSRegIntrinsic_r32<"nwarpid">;
3696 defm int_nvvm_read_ptx_sreg_ctaid : PTXReadSRegIntrinsic_v4i32<"ctaid">;
3697 defm int_nvvm_read_ptx_sreg_nctaid : PTXReadSRegIntrinsic_v4i32<"nctaid">;
3699 def int_nvvm_read_ptx_sreg_smid : PTXReadSRegIntrinsic_r32<"smid">;
3700 def int_nvvm_read_ptx_sreg_nsmid : PTXReadSRegIntrinsic_r32<"nsmid">;
3701 def int_nvvm_read_ptx_sreg_gridid : PTXReadSRegIntrinsic_r32<"gridid">;
3703 def int_nvvm_read_ptx_sreg_lanemask_eq :
3704     PTXReadSRegIntrinsic_r32<"lanemask_eq">;
3705 def int_nvvm_read_ptx_sreg_lanemask_le :
3706     PTXReadSRegIntrinsic_r32<"lanemask_le">;
3707 def int_nvvm_read_ptx_sreg_lanemask_lt :
3708     PTXReadSRegIntrinsic_r32<"lanemask_lt">;
3709 def int_nvvm_read_ptx_sreg_lanemask_ge :
3710     PTXReadSRegIntrinsic_r32<"lanemask_ge">;
3711 def int_nvvm_read_ptx_sreg_lanemask_gt :
3712     PTXReadSRegIntrinsic_r32<"lanemask_gt">;
3714 def int_nvvm_read_ptx_sreg_clock : PTXReadNCSRegIntrinsic_r32<"clock">;
3715 def int_nvvm_read_ptx_sreg_clock64 : PTXReadNCSRegIntrinsic_r64<"clock64">;
3717 def int_nvvm_read_ptx_sreg_pm0 : PTXReadNCSRegIntrinsic_r32<"pm0">;
3718 def int_nvvm_read_ptx_sreg_pm1 : PTXReadNCSRegIntrinsic_r32<"pm1">;
3719 def int_nvvm_read_ptx_sreg_pm2 : PTXReadNCSRegIntrinsic_r32<"pm2">;
3720 def int_nvvm_read_ptx_sreg_pm3 : PTXReadNCSRegIntrinsic_r32<"pm3">;
3722 def int_nvvm_read_ptx_sreg_warpsize : PTXReadSRegIntrinsic_r32<"warpsize">;
3725 // SHUFFLE
3728 // shfl.down.b32 dest, val, offset, mask_and_clamp
3729 def int_nvvm_shfl_down_i32 :
3730   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3731             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.down.i32">,
3732   GCCBuiltin<"__nvvm_shfl_down_i32">;
3733 def int_nvvm_shfl_down_f32 :
3734   Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3735             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.down.f32">,
3736   GCCBuiltin<"__nvvm_shfl_down_f32">;
3738 // shfl.up.b32 dest, val, offset, mask_and_clamp
3739 def int_nvvm_shfl_up_i32 :
3740   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3741             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.up.i32">,
3742   GCCBuiltin<"__nvvm_shfl_up_i32">;
3743 def int_nvvm_shfl_up_f32 :
3744   Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3745             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.up.f32">,
3746   GCCBuiltin<"__nvvm_shfl_up_f32">;
3748 // shfl.bfly.b32 dest, val, offset, mask_and_clamp
3749 def int_nvvm_shfl_bfly_i32 :
3750   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3751             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.bfly.i32">,
3752   GCCBuiltin<"__nvvm_shfl_bfly_i32">;
3753 def int_nvvm_shfl_bfly_f32 :
3754   Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3755             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.bfly.f32">,
3756   GCCBuiltin<"__nvvm_shfl_bfly_f32">;
3758 // shfl.idx.b32 dest, val, lane, mask_and_clamp
3759 def int_nvvm_shfl_idx_i32 :
3760   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3761             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.idx.i32">,
3762   GCCBuiltin<"__nvvm_shfl_idx_i32">;
3763 def int_nvvm_shfl_idx_f32 :
3764   Intrinsic<[llvm_float_ty], [llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3765             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.idx.f32">,
3766   GCCBuiltin<"__nvvm_shfl_idx_f32">;
3768 // Synchronizing shfl variants available in CUDA-9.
3769 // On sm_70 these don't have to be convergent, so we may eventually want to
3770 // implement non-convergent variant of this intrinsic.
3772 // shfl.sync.down.b32 dest, threadmask, val, offset , mask_and_clamp
3773 def int_nvvm_shfl_sync_down_i32 :
3774   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3775             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.down.i32">,
3776   GCCBuiltin<"__nvvm_shfl_sync_down_i32">;
3777 def int_nvvm_shfl_sync_down_f32 :
3778   Intrinsic<[llvm_float_ty], [llvm_i32_ty, llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3779             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.down.f32">,
3780   GCCBuiltin<"__nvvm_shfl_sync_down_f32">;
3782 // shfl.sync.up.b32 dest, threadmask, val, offset, mask_and_clamp
3783 def int_nvvm_shfl_sync_up_i32 :
3784   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3785             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.up.i32">,
3786   GCCBuiltin<"__nvvm_shfl_sync_up_i32">;
3787 def int_nvvm_shfl_sync_up_f32 :
3788   Intrinsic<[llvm_float_ty], [llvm_i32_ty, llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3789             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.up.f32">,
3790   GCCBuiltin<"__nvvm_shfl_sync_up_f32">;
3792 // shfl.sync.bfly.b32 dest, threadmask, val, offset, mask_and_clamp
3793 def int_nvvm_shfl_sync_bfly_i32 :
3794   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3795             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.bfly.i32">,
3796   GCCBuiltin<"__nvvm_shfl_sync_bfly_i32">;
3797 def int_nvvm_shfl_sync_bfly_f32 :
3798   Intrinsic<[llvm_float_ty], [llvm_i32_ty, llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3799             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.bfly.f32">,
3800   GCCBuiltin<"__nvvm_shfl_sync_bfly_f32">;
3802 // shfl.sync.idx.b32 dest, threadmask, val, lane, mask_and_clamp
3803 def int_nvvm_shfl_sync_idx_i32 :
3804   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
3805             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.idx.i32">,
3806   GCCBuiltin<"__nvvm_shfl_sync_idx_i32">;
3807 def int_nvvm_shfl_sync_idx_f32 :
3808   Intrinsic<[llvm_float_ty], [llvm_i32_ty, llvm_float_ty, llvm_i32_ty, llvm_i32_ty],
3809             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.shfl.sync.idx.f32">,
3810   GCCBuiltin<"__nvvm_shfl_sync_idx_f32">;
3813 // VOTE
3816 // vote.all pred
3817 def int_nvvm_vote_all :
3818   Intrinsic<[llvm_i1_ty], [llvm_i1_ty],
3819             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.all">,
3820   GCCBuiltin<"__nvvm_vote_all">;
3821 // vote.any pred
3822 def int_nvvm_vote_any :
3823   Intrinsic<[llvm_i1_ty], [llvm_i1_ty],
3824             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.any">,
3825   GCCBuiltin<"__nvvm_vote_any">;
3826 // vote.uni pred
3827 def int_nvvm_vote_uni :
3828   Intrinsic<[llvm_i1_ty], [llvm_i1_ty],
3829             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.uni">,
3830   GCCBuiltin<"__nvvm_vote_uni">;
3831 // vote.ballot pred
3832 def int_nvvm_vote_ballot :
3833   Intrinsic<[llvm_i32_ty], [llvm_i1_ty],
3834             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.ballot">,
3835   GCCBuiltin<"__nvvm_vote_ballot">;
3838 // VOTE.SYNC
3841 // vote.sync.all mask, pred
3842 def int_nvvm_vote_all_sync :
3843   Intrinsic<[llvm_i1_ty], [llvm_i32_ty, llvm_i1_ty],
3844             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.all.sync">,
3845   GCCBuiltin<"__nvvm_vote_all_sync">;
3846 // vote.sync.any mask, pred
3847 def int_nvvm_vote_any_sync :
3848   Intrinsic<[llvm_i1_ty], [llvm_i32_ty, llvm_i1_ty],
3849             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.any.sync">,
3850   GCCBuiltin<"__nvvm_vote_any_sync">;
3851 // vote.sync.uni mask, pred
3852 def int_nvvm_vote_uni_sync :
3853   Intrinsic<[llvm_i1_ty], [llvm_i32_ty, llvm_i1_ty],
3854             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.uni.sync">,
3855   GCCBuiltin<"__nvvm_vote_uni_sync">;
3856 // vote.sync.ballot mask, pred
3857 def int_nvvm_vote_ballot_sync :
3858   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i1_ty],
3859             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.vote.ballot.sync">,
3860   GCCBuiltin<"__nvvm_vote_ballot_sync">;
3863 // MATCH.SYNC
3865 // match.any.sync.b32 mask, value
3866 def int_nvvm_match_any_sync_i32 :
3867   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
3868             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.match.any.sync.i32">,
3869   GCCBuiltin<"__nvvm_match_any_sync_i32">;
3870 // match.any.sync.b64 mask, value
3871 def int_nvvm_match_any_sync_i64 :
3872   Intrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i64_ty],
3873             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.match.any.sync.i64">,
3874   GCCBuiltin<"__nvvm_match_any_sync_i64">;
3876 // match.all instruction have two variants -- one returns a single value, another
3877 // returns a pair {value, predicate}. We currently only implement the latter as
3878 // that's the variant exposed by CUDA API.
3880 // match.all.sync.b32p mask, value
3881 def int_nvvm_match_all_sync_i32p :
3882   Intrinsic<[llvm_i32_ty, llvm_i1_ty], [llvm_i32_ty, llvm_i32_ty],
3883             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.match.all.sync.i32p">;
3884 // match.all.sync.b64p mask, value
3885 def int_nvvm_match_all_sync_i64p :
3886   Intrinsic<[llvm_i64_ty, llvm_i1_ty], [llvm_i32_ty, llvm_i64_ty],
3887             [IntrInaccessibleMemOnly, IntrConvergent], "llvm.nvvm.match.all.sync.i64p">;
3890 // WMMA instructions
3893 // WMMA.LOAD
3894 class NVVM_WMMA_LD_GALSTS<string Geometry, string Abc, string Layout,
3895                           string Type, LLVMType regty, int WithStride>
3896   : Intrinsic<!if(!eq(Abc#Type,"cf16"),
3897                   [regty, regty, regty, regty],
3898                   [regty, regty, regty, regty,
3899                    regty, regty, regty, regty]),
3900               !if(WithStride, [llvm_anyptr_ty, llvm_i32_ty], [llvm_anyptr_ty]),
3901               [IntrReadMem, IntrArgMemOnly, ReadOnly<0>, NoCapture<0>],
3902               "llvm.nvvm.wmma."
3903                 # Geometry
3904                 # ".load"
3905                 # "." # Abc
3906                 # "." # Layout
3907                 # !if(WithStride, ".stride", "")
3908                 # "." # Type>;
3910 multiclass NVVM_WMMA_LD_GALT<string Geometry, string Abc, string Layout,
3911                              string Type, LLVMType regty> {
3912   def _stride: NVVM_WMMA_LD_GALSTS<Geometry, Abc, Layout, Type, regty, 1>;
3913   def NAME   : NVVM_WMMA_LD_GALSTS<Geometry, Abc, Layout, Type, regty, 0>;
3916 multiclass NVVM_WMMA_LD_GAT<string Geometry, string Abc,
3917                            string Type, LLVMType regty> {
3918   defm _row: NVVM_WMMA_LD_GALT<Geometry, Abc, "row", Type, regty>;
3919   defm _col: NVVM_WMMA_LD_GALT<Geometry, Abc, "col", Type, regty>;
3922 multiclass NVVM_WMMA_LD_G<string Geometry> {
3923   defm _a_f16: NVVM_WMMA_LD_GAT<Geometry, "a", "f16", llvm_v2f16_ty>;
3924   defm _b_f16: NVVM_WMMA_LD_GAT<Geometry, "b", "f16", llvm_v2f16_ty>;
3925   defm _c_f16: NVVM_WMMA_LD_GAT<Geometry, "c", "f16", llvm_v2f16_ty>;
3926   defm _c_f32: NVVM_WMMA_LD_GAT<Geometry, "c", "f32", llvm_float_ty>;
3929 multiclass NVVM_WMMA_LD {
3930   defm _m32n8k16_load: NVVM_WMMA_LD_G<"m32n8k16">;
3931   defm _m16n16k16_load: NVVM_WMMA_LD_G<"m16n16k16">;
3932   defm _m8n32k16_load: NVVM_WMMA_LD_G<"m8n32k16">;
3935 defm int_nvvm_wmma: NVVM_WMMA_LD;
3937 // WMMA.STORE.D
3938 class NVVM_WMMA_STD_GLSTS<string Geometry, string Layout,
3939                           string Type, LLVMType regty, int WithStride,
3940                           // This is only used to create a typed empty array we
3941                           // need to pass to !if below.
3942                           list<LLVMType>Empty=[]>
3943   : Intrinsic<[],
3944               !listconcat(
3945                 [llvm_anyptr_ty],
3946                 !if(!eq(Type,"f16"),
3947                     [regty, regty, regty, regty],
3948                     [regty, regty, regty, regty,
3949                      regty, regty, regty, regty]),
3950                 !if(WithStride, [llvm_i32_ty], Empty)),
3951               [IntrWriteMem, IntrArgMemOnly, WriteOnly<0>, NoCapture<0>],
3952               "llvm.nvvm.wmma."
3953                    # Geometry
3954                    # ".store.d"
3955                    # "." # Layout
3956                    # !if(WithStride, ".stride", "")
3957                    # "." # Type>;
3959 multiclass NVVM_WMMA_STD_GLT<string Geometry, string Layout,
3960                              string Type, LLVMType regty> {
3961   def _stride: NVVM_WMMA_STD_GLSTS<Geometry, Layout, Type, regty, 1>;
3962   def NAME:    NVVM_WMMA_STD_GLSTS<Geometry, Layout, Type, regty, 0>;
3965 multiclass NVVM_WMMA_STD_GT<string Geometry, string Type, LLVMType regty> {
3966   defm _row: NVVM_WMMA_STD_GLT<Geometry, "row", Type, regty>;
3967   defm _col: NVVM_WMMA_STD_GLT<Geometry, "col", Type, regty>;
3969 multiclass NVVM_WMMA_STD_G<string Geometry> {
3970   defm _d_f16: NVVM_WMMA_STD_GT<Geometry, "f16", llvm_v2f16_ty>;
3971   defm _d_f32: NVVM_WMMA_STD_GT<Geometry, "f32", llvm_float_ty>;
3974 multiclass NVVM_WMMA_STD {
3975   defm _m32n8k16_store:  NVVM_WMMA_STD_G<"m32n8k16">;
3976   defm _m16n16k16_store: NVVM_WMMA_STD_G<"m16n16k16">;
3977   defm _m8n32k16_store:  NVVM_WMMA_STD_G<"m8n32k16">;
3980 defm int_nvvm_wmma: NVVM_WMMA_STD;
3982 // WMMA.MMA
3983 class NVVM_WMMA_MMA_GABDCS<string Geometry,
3984                            string ALayout, string BLayout,
3985                            string DType, LLVMType d_regty,
3986                            string CType, LLVMType c_regty,
3987                            string Satfinite = "">
3988   : Intrinsic<!if(!eq(DType,"f16"),
3989                       [d_regty, d_regty, d_regty, d_regty],
3990                       [d_regty, d_regty, d_regty, d_regty,
3991                        d_regty, d_regty, d_regty, d_regty]),
3992               !listconcat(
3993                 [// A
3994                 llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty,
3995                 llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty,
3996                 // B
3997                 llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty,
3998                 llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty, llvm_v2f16_ty],
3999                 !if(!eq(CType,"f16"),
4000                       [c_regty, c_regty, c_regty, c_regty],
4001                       [c_regty, c_regty, c_regty, c_regty,
4002                        c_regty, c_regty, c_regty, c_regty])),
4003               [IntrNoMem],
4004               "llvm.nvvm.wmma."
4005                 # Geometry
4006                 # ".mma"
4007                 # "." # ALayout
4008                 # "." # BLayout
4009                 # "." # DType
4010                 # "." # CType
4011                 # Satfinite> {
4014 multiclass NVVM_WMMA_MMA_GABDC<string Geometry, string ALayout, string BLayout,
4015                                string DType, LLVMType d_regty,
4016                                string CType, LLVMType c_regty> {
4017   def NAME : NVVM_WMMA_MMA_GABDCS<Geometry, ALayout, BLayout,
4018                                   DType, d_regty, CType, c_regty>;
4019   def _satfinite: NVVM_WMMA_MMA_GABDCS<Geometry, ALayout, BLayout,
4020                                        DType, d_regty, CType, c_regty,".satfinite">;
4023 multiclass NVVM_WMMA_MMA_GABD<string Geometry, string ALayout, string BLayout,
4024                               string DType, LLVMType d_regty> {
4025   defm _f16: NVVM_WMMA_MMA_GABDC<Geometry, ALayout, BLayout, DType, d_regty,
4026                                 "f16", llvm_v2f16_ty>;
4027   defm _f32: NVVM_WMMA_MMA_GABDC<Geometry, ALayout, BLayout, DType, d_regty,
4028                                 "f32", llvm_float_ty>;
4031 multiclass NVVM_WMMA_MMA_GAB<string Geometry, string ALayout, string BLayout> {
4032   defm _f16: NVVM_WMMA_MMA_GABD<Geometry, ALayout, BLayout, "f16", llvm_v2f16_ty>;
4033   defm _f32: NVVM_WMMA_MMA_GABD<Geometry, ALayout, BLayout, "f32", llvm_float_ty>;
4036 multiclass NVVM_WMMA_MMA_GA<string Geometry, string ALayout> {
4037   defm _col: NVVM_WMMA_MMA_GAB<Geometry, ALayout, "col">;
4038   defm _row: NVVM_WMMA_MMA_GAB<Geometry, ALayout, "row">;
4041 multiclass NVVM_WMMA_MMA_G<string Geometry> {
4042   defm _col: NVVM_WMMA_MMA_GA<Geometry, "col">;
4043   defm _row: NVVM_WMMA_MMA_GA<Geometry, "row">;
4046 multiclass NVVM_WMMA_MMA {
4047   defm _m32n8k16_mma : NVVM_WMMA_MMA_G<"m32n8k16">;
4048   defm _m16n16k16_mma : NVVM_WMMA_MMA_G<"m16n16k16">;
4049   defm _m8n32k16_mma : NVVM_WMMA_MMA_G<"m8n32k16">;
4052 defm int_nvvm_wmma : NVVM_WMMA_MMA;
4054 } // let TargetPrefix = "nvvm"