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