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