BuiltinsNVPTX.def revision 309124
1//===--- BuiltinsPTX.def - PTX Builtin function database ----*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the PTX-specific builtin function database.  Users of
11// this file must define the BUILTIN macro to make use of this information.
12//
13//===----------------------------------------------------------------------===//
14
15// The format of this database matches clang/Basic/Builtins.def.
16
17// Special Registers
18
19BUILTIN(__nvvm_read_ptx_sreg_tid_x, "i", "nc")
20BUILTIN(__nvvm_read_ptx_sreg_tid_y, "i", "nc")
21BUILTIN(__nvvm_read_ptx_sreg_tid_z, "i", "nc")
22BUILTIN(__nvvm_read_ptx_sreg_tid_w, "i", "nc")
23
24BUILTIN(__nvvm_read_ptx_sreg_ntid_x, "i", "nc")
25BUILTIN(__nvvm_read_ptx_sreg_ntid_y, "i", "nc")
26BUILTIN(__nvvm_read_ptx_sreg_ntid_z, "i", "nc")
27BUILTIN(__nvvm_read_ptx_sreg_ntid_w, "i", "nc")
28
29BUILTIN(__nvvm_read_ptx_sreg_ctaid_x, "i", "nc")
30BUILTIN(__nvvm_read_ptx_sreg_ctaid_y, "i", "nc")
31BUILTIN(__nvvm_read_ptx_sreg_ctaid_z, "i", "nc")
32BUILTIN(__nvvm_read_ptx_sreg_ctaid_w, "i", "nc")
33
34BUILTIN(__nvvm_read_ptx_sreg_nctaid_x, "i", "nc")
35BUILTIN(__nvvm_read_ptx_sreg_nctaid_y, "i", "nc")
36BUILTIN(__nvvm_read_ptx_sreg_nctaid_z, "i", "nc")
37BUILTIN(__nvvm_read_ptx_sreg_nctaid_w, "i", "nc")
38
39BUILTIN(__nvvm_read_ptx_sreg_laneid, "i", "nc")
40BUILTIN(__nvvm_read_ptx_sreg_warpid, "i", "nc")
41BUILTIN(__nvvm_read_ptx_sreg_nwarpid, "i", "nc")
42
43BUILTIN(__nvvm_read_ptx_sreg_smid, "i", "nc")
44BUILTIN(__nvvm_read_ptx_sreg_nsmid, "i", "nc")
45BUILTIN(__nvvm_read_ptx_sreg_gridid, "i", "nc")
46
47BUILTIN(__nvvm_read_ptx_sreg_lanemask_eq, "i", "nc")
48BUILTIN(__nvvm_read_ptx_sreg_lanemask_le, "i", "nc")
49BUILTIN(__nvvm_read_ptx_sreg_lanemask_lt, "i", "nc")
50BUILTIN(__nvvm_read_ptx_sreg_lanemask_ge, "i", "nc")
51BUILTIN(__nvvm_read_ptx_sreg_lanemask_gt, "i", "nc")
52
53BUILTIN(__nvvm_read_ptx_sreg_clock, "i", "n")
54BUILTIN(__nvvm_read_ptx_sreg_clock64, "LLi", "n")
55
56BUILTIN(__nvvm_read_ptx_sreg_pm0, "i", "n")
57BUILTIN(__nvvm_read_ptx_sreg_pm1, "i", "n")
58BUILTIN(__nvvm_read_ptx_sreg_pm2, "i", "n")
59BUILTIN(__nvvm_read_ptx_sreg_pm3, "i", "n")
60
61// MISC
62
63BUILTIN(__nvvm_clz_i, "ii", "")
64BUILTIN(__nvvm_clz_ll, "iLLi", "")
65BUILTIN(__nvvm_popc_i, "ii", "")
66BUILTIN(__nvvm_popc_ll, "iLLi", "")
67BUILTIN(__nvvm_prmt, "UiUiUiUi", "")
68
69// Min Max
70
71BUILTIN(__nvvm_min_i, "iii", "")
72BUILTIN(__nvvm_min_ui, "UiUiUi", "")
73BUILTIN(__nvvm_min_ll, "LLiLLiLLi", "")
74BUILTIN(__nvvm_min_ull, "ULLiULLiULLi", "")
75
76BUILTIN(__nvvm_max_i, "iii", "")
77BUILTIN(__nvvm_max_ui, "UiUiUi", "")
78BUILTIN(__nvvm_max_ll, "LLiLLiLLi", "")
79BUILTIN(__nvvm_max_ull, "ULLiULLiULLi", "")
80
81BUILTIN(__nvvm_fmax_ftz_f, "fff",  "")
82BUILTIN(__nvvm_fmax_f, "fff",  "")
83BUILTIN(__nvvm_fmin_ftz_f, "fff",  "")
84BUILTIN(__nvvm_fmin_f, "fff",  "")
85
86BUILTIN(__nvvm_fmax_d, "ddd", "")
87BUILTIN(__nvvm_fmin_d, "ddd", "")
88
89// Multiplication
90
91BUILTIN(__nvvm_mulhi_i, "iii", "")
92BUILTIN(__nvvm_mulhi_ui, "UiUiUi", "")
93BUILTIN(__nvvm_mulhi_ll, "LLiLLiLLi", "")
94BUILTIN(__nvvm_mulhi_ull, "ULLiULLiULLi", "")
95
96BUILTIN(__nvvm_mul_rn_ftz_f,  "fff", "")
97BUILTIN(__nvvm_mul_rn_f,  "fff", "")
98BUILTIN(__nvvm_mul_rz_ftz_f,  "fff", "")
99BUILTIN(__nvvm_mul_rz_f,  "fff", "")
100BUILTIN(__nvvm_mul_rm_ftz_f,  "fff", "")
101BUILTIN(__nvvm_mul_rm_f,  "fff", "")
102BUILTIN(__nvvm_mul_rp_ftz_f,  "fff", "")
103BUILTIN(__nvvm_mul_rp_f,  "fff", "")
104
105BUILTIN(__nvvm_mul_rn_d,  "ddd", "")
106BUILTIN(__nvvm_mul_rz_d,  "ddd", "")
107BUILTIN(__nvvm_mul_rm_d,  "ddd", "")
108BUILTIN(__nvvm_mul_rp_d,  "ddd", "")
109
110BUILTIN(__nvvm_mul24_i,  "iii", "")
111BUILTIN(__nvvm_mul24_ui,  "UiUiUi", "")
112
113// Div
114
115BUILTIN(__nvvm_div_approx_ftz_f,  "fff", "")
116BUILTIN(__nvvm_div_approx_f,  "fff", "")
117
118BUILTIN(__nvvm_div_rn_ftz_f,  "fff", "")
119BUILTIN(__nvvm_div_rn_f,  "fff", "")
120BUILTIN(__nvvm_div_rz_ftz_f,  "fff", "")
121BUILTIN(__nvvm_div_rz_f,  "fff", "")
122BUILTIN(__nvvm_div_rm_ftz_f,  "fff", "")
123BUILTIN(__nvvm_div_rm_f,  "fff", "")
124BUILTIN(__nvvm_div_rp_ftz_f,  "fff", "")
125BUILTIN(__nvvm_div_rp_f,  "fff", "")
126
127BUILTIN(__nvvm_div_rn_d,  "ddd", "")
128BUILTIN(__nvvm_div_rz_d,  "ddd", "")
129BUILTIN(__nvvm_div_rm_d,  "ddd", "")
130BUILTIN(__nvvm_div_rp_d,  "ddd", "")
131
132// Brev
133
134BUILTIN(__nvvm_brev32, "UiUi", "")
135BUILTIN(__nvvm_brev64, "ULLiULLi", "")
136
137// Sad
138
139BUILTIN(__nvvm_sad_i, "iiii", "")
140BUILTIN(__nvvm_sad_ui, "UiUiUiUi", "")
141
142// Floor, Ceil
143
144BUILTIN(__nvvm_floor_ftz_f, "ff", "")
145BUILTIN(__nvvm_floor_f, "ff", "")
146BUILTIN(__nvvm_floor_d, "dd", "")
147
148BUILTIN(__nvvm_ceil_ftz_f, "ff", "")
149BUILTIN(__nvvm_ceil_f, "ff", "")
150BUILTIN(__nvvm_ceil_d, "dd", "")
151
152// Abs
153
154BUILTIN(__nvvm_abs_i, "ii", "")
155BUILTIN(__nvvm_abs_ll, "LLiLLi", "")
156
157BUILTIN(__nvvm_fabs_ftz_f, "ff", "")
158BUILTIN(__nvvm_fabs_f, "ff", "")
159BUILTIN(__nvvm_fabs_d, "dd", "")
160
161// Round
162
163BUILTIN(__nvvm_round_ftz_f, "ff", "")
164BUILTIN(__nvvm_round_f, "ff", "")
165BUILTIN(__nvvm_round_d, "dd", "")
166
167// Trunc
168
169BUILTIN(__nvvm_trunc_ftz_f, "ff", "")
170BUILTIN(__nvvm_trunc_f, "ff", "")
171BUILTIN(__nvvm_trunc_d, "dd", "")
172
173// Saturate
174
175BUILTIN(__nvvm_saturate_ftz_f, "ff", "")
176BUILTIN(__nvvm_saturate_f, "ff", "")
177BUILTIN(__nvvm_saturate_d, "dd", "")
178
179// Exp2, Log2
180
181BUILTIN(__nvvm_ex2_approx_ftz_f, "ff", "")
182BUILTIN(__nvvm_ex2_approx_f, "ff", "")
183BUILTIN(__nvvm_ex2_approx_d, "dd", "")
184
185BUILTIN(__nvvm_lg2_approx_ftz_f, "ff", "")
186BUILTIN(__nvvm_lg2_approx_f, "ff", "")
187BUILTIN(__nvvm_lg2_approx_d, "dd", "")
188
189// Sin, Cos
190
191BUILTIN(__nvvm_sin_approx_ftz_f, "ff", "")
192BUILTIN(__nvvm_sin_approx_f, "ff", "")
193
194BUILTIN(__nvvm_cos_approx_ftz_f, "ff", "")
195BUILTIN(__nvvm_cos_approx_f, "ff", "")
196
197// Fma
198
199BUILTIN(__nvvm_fma_rn_ftz_f, "ffff", "")
200BUILTIN(__nvvm_fma_rn_f, "ffff", "")
201BUILTIN(__nvvm_fma_rz_ftz_f, "ffff", "")
202BUILTIN(__nvvm_fma_rz_f, "ffff", "")
203BUILTIN(__nvvm_fma_rm_ftz_f, "ffff", "")
204BUILTIN(__nvvm_fma_rm_f, "ffff", "")
205BUILTIN(__nvvm_fma_rp_ftz_f, "ffff", "")
206BUILTIN(__nvvm_fma_rp_f, "ffff", "")
207BUILTIN(__nvvm_fma_rn_d, "dddd", "")
208BUILTIN(__nvvm_fma_rz_d, "dddd", "")
209BUILTIN(__nvvm_fma_rm_d, "dddd", "")
210BUILTIN(__nvvm_fma_rp_d, "dddd", "")
211
212// Rcp
213
214BUILTIN(__nvvm_rcp_rn_ftz_f, "ff", "")
215BUILTIN(__nvvm_rcp_rn_f, "ff", "")
216BUILTIN(__nvvm_rcp_rz_ftz_f, "ff", "")
217BUILTIN(__nvvm_rcp_rz_f, "ff", "")
218BUILTIN(__nvvm_rcp_rm_ftz_f, "ff", "")
219BUILTIN(__nvvm_rcp_rm_f, "ff", "")
220BUILTIN(__nvvm_rcp_rp_ftz_f, "ff", "")
221BUILTIN(__nvvm_rcp_rp_f, "ff", "")
222
223BUILTIN(__nvvm_rcp_rn_d, "dd", "")
224BUILTIN(__nvvm_rcp_rz_d, "dd", "")
225BUILTIN(__nvvm_rcp_rm_d, "dd", "")
226BUILTIN(__nvvm_rcp_rp_d, "dd", "")
227BUILTIN(__nvvm_rcp_approx_ftz_d, "dd", "")
228
229// Sqrt
230
231BUILTIN(__nvvm_sqrt_rn_ftz_f, "ff", "")
232BUILTIN(__nvvm_sqrt_rn_f, "ff", "")
233BUILTIN(__nvvm_sqrt_rz_ftz_f, "ff", "")
234BUILTIN(__nvvm_sqrt_rz_f, "ff", "")
235BUILTIN(__nvvm_sqrt_rm_ftz_f, "ff", "")
236BUILTIN(__nvvm_sqrt_rm_f, "ff", "")
237BUILTIN(__nvvm_sqrt_rp_ftz_f, "ff", "")
238BUILTIN(__nvvm_sqrt_rp_f, "ff", "")
239BUILTIN(__nvvm_sqrt_approx_ftz_f, "ff", "")
240BUILTIN(__nvvm_sqrt_approx_f, "ff", "")
241
242BUILTIN(__nvvm_sqrt_rn_d, "dd", "")
243BUILTIN(__nvvm_sqrt_rz_d, "dd", "")
244BUILTIN(__nvvm_sqrt_rm_d, "dd", "")
245BUILTIN(__nvvm_sqrt_rp_d, "dd", "")
246
247// Rsqrt
248
249BUILTIN(__nvvm_rsqrt_approx_ftz_f, "ff", "")
250BUILTIN(__nvvm_rsqrt_approx_f, "ff", "")
251BUILTIN(__nvvm_rsqrt_approx_d, "dd", "")
252
253// Add
254
255BUILTIN(__nvvm_add_rn_ftz_f, "fff", "")
256BUILTIN(__nvvm_add_rn_f, "fff", "")
257BUILTIN(__nvvm_add_rz_ftz_f, "fff", "")
258BUILTIN(__nvvm_add_rz_f, "fff", "")
259BUILTIN(__nvvm_add_rm_ftz_f, "fff", "")
260BUILTIN(__nvvm_add_rm_f, "fff", "")
261BUILTIN(__nvvm_add_rp_ftz_f, "fff", "")
262BUILTIN(__nvvm_add_rp_f, "fff", "")
263
264BUILTIN(__nvvm_add_rn_d, "ddd", "")
265BUILTIN(__nvvm_add_rz_d, "ddd", "")
266BUILTIN(__nvvm_add_rm_d, "ddd", "")
267BUILTIN(__nvvm_add_rp_d, "ddd", "")
268
269// Convert
270
271BUILTIN(__nvvm_d2f_rn_ftz, "fd", "")
272BUILTIN(__nvvm_d2f_rn, "fd", "")
273BUILTIN(__nvvm_d2f_rz_ftz, "fd", "")
274BUILTIN(__nvvm_d2f_rz, "fd", "")
275BUILTIN(__nvvm_d2f_rm_ftz, "fd", "")
276BUILTIN(__nvvm_d2f_rm, "fd", "")
277BUILTIN(__nvvm_d2f_rp_ftz, "fd", "")
278BUILTIN(__nvvm_d2f_rp, "fd", "")
279
280BUILTIN(__nvvm_d2i_rn, "id", "")
281BUILTIN(__nvvm_d2i_rz, "id", "")
282BUILTIN(__nvvm_d2i_rm, "id", "")
283BUILTIN(__nvvm_d2i_rp, "id", "")
284
285BUILTIN(__nvvm_d2ui_rn, "Uid", "")
286BUILTIN(__nvvm_d2ui_rz, "Uid", "")
287BUILTIN(__nvvm_d2ui_rm, "Uid", "")
288BUILTIN(__nvvm_d2ui_rp, "Uid", "")
289
290BUILTIN(__nvvm_i2d_rn, "di", "")
291BUILTIN(__nvvm_i2d_rz, "di", "")
292BUILTIN(__nvvm_i2d_rm, "di", "")
293BUILTIN(__nvvm_i2d_rp, "di", "")
294
295BUILTIN(__nvvm_ui2d_rn, "dUi", "")
296BUILTIN(__nvvm_ui2d_rz, "dUi", "")
297BUILTIN(__nvvm_ui2d_rm, "dUi", "")
298BUILTIN(__nvvm_ui2d_rp, "dUi", "")
299
300BUILTIN(__nvvm_f2i_rn_ftz, "if", "")
301BUILTIN(__nvvm_f2i_rn, "if", "")
302BUILTIN(__nvvm_f2i_rz_ftz, "if", "")
303BUILTIN(__nvvm_f2i_rz, "if", "")
304BUILTIN(__nvvm_f2i_rm_ftz, "if", "")
305BUILTIN(__nvvm_f2i_rm, "if", "")
306BUILTIN(__nvvm_f2i_rp_ftz, "if", "")
307BUILTIN(__nvvm_f2i_rp, "if", "")
308
309BUILTIN(__nvvm_f2ui_rn_ftz, "Uif", "")
310BUILTIN(__nvvm_f2ui_rn, "Uif", "")
311BUILTIN(__nvvm_f2ui_rz_ftz, "Uif", "")
312BUILTIN(__nvvm_f2ui_rz, "Uif", "")
313BUILTIN(__nvvm_f2ui_rm_ftz, "Uif", "")
314BUILTIN(__nvvm_f2ui_rm, "Uif", "")
315BUILTIN(__nvvm_f2ui_rp_ftz, "Uif", "")
316BUILTIN(__nvvm_f2ui_rp, "Uif", "")
317
318BUILTIN(__nvvm_i2f_rn, "fi", "")
319BUILTIN(__nvvm_i2f_rz, "fi", "")
320BUILTIN(__nvvm_i2f_rm, "fi", "")
321BUILTIN(__nvvm_i2f_rp, "fi", "")
322
323BUILTIN(__nvvm_ui2f_rn, "fUi", "")
324BUILTIN(__nvvm_ui2f_rz, "fUi", "")
325BUILTIN(__nvvm_ui2f_rm, "fUi", "")
326BUILTIN(__nvvm_ui2f_rp, "fUi", "")
327
328BUILTIN(__nvvm_lohi_i2d, "dii", "")
329
330BUILTIN(__nvvm_d2i_lo, "id", "")
331BUILTIN(__nvvm_d2i_hi, "id", "")
332
333BUILTIN(__nvvm_f2ll_rn_ftz, "LLif", "")
334BUILTIN(__nvvm_f2ll_rn, "LLif", "")
335BUILTIN(__nvvm_f2ll_rz_ftz, "LLif", "")
336BUILTIN(__nvvm_f2ll_rz, "LLif", "")
337BUILTIN(__nvvm_f2ll_rm_ftz, "LLif", "")
338BUILTIN(__nvvm_f2ll_rm, "LLif", "")
339BUILTIN(__nvvm_f2ll_rp_ftz, "LLif", "")
340BUILTIN(__nvvm_f2ll_rp, "LLif", "")
341
342BUILTIN(__nvvm_f2ull_rn_ftz, "ULLif", "")
343BUILTIN(__nvvm_f2ull_rn, "ULLif", "")
344BUILTIN(__nvvm_f2ull_rz_ftz, "ULLif", "")
345BUILTIN(__nvvm_f2ull_rz, "ULLif", "")
346BUILTIN(__nvvm_f2ull_rm_ftz, "ULLif", "")
347BUILTIN(__nvvm_f2ull_rm, "ULLif", "")
348BUILTIN(__nvvm_f2ull_rp_ftz, "ULLif", "")
349BUILTIN(__nvvm_f2ull_rp, "ULLif", "")
350
351BUILTIN(__nvvm_d2ll_rn, "LLid", "")
352BUILTIN(__nvvm_d2ll_rz, "LLid", "")
353BUILTIN(__nvvm_d2ll_rm, "LLid", "")
354BUILTIN(__nvvm_d2ll_rp, "LLid", "")
355
356BUILTIN(__nvvm_d2ull_rn, "ULLid", "")
357BUILTIN(__nvvm_d2ull_rz, "ULLid", "")
358BUILTIN(__nvvm_d2ull_rm, "ULLid", "")
359BUILTIN(__nvvm_d2ull_rp, "ULLid", "")
360
361BUILTIN(__nvvm_ll2f_rn, "fLLi", "")
362BUILTIN(__nvvm_ll2f_rz, "fLLi", "")
363BUILTIN(__nvvm_ll2f_rm, "fLLi", "")
364BUILTIN(__nvvm_ll2f_rp, "fLLi", "")
365
366BUILTIN(__nvvm_ull2f_rn, "fULLi", "")
367BUILTIN(__nvvm_ull2f_rz, "fULLi", "")
368BUILTIN(__nvvm_ull2f_rm, "fULLi", "")
369BUILTIN(__nvvm_ull2f_rp, "fULLi", "")
370
371BUILTIN(__nvvm_ll2d_rn, "dLLi", "")
372BUILTIN(__nvvm_ll2d_rz, "dLLi", "")
373BUILTIN(__nvvm_ll2d_rm, "dLLi", "")
374BUILTIN(__nvvm_ll2d_rp, "dLLi", "")
375
376BUILTIN(__nvvm_ull2d_rn, "dULLi", "")
377BUILTIN(__nvvm_ull2d_rz, "dULLi", "")
378BUILTIN(__nvvm_ull2d_rm, "dULLi", "")
379BUILTIN(__nvvm_ull2d_rp, "dULLi", "")
380
381BUILTIN(__nvvm_f2h_rn_ftz, "Usf", "")
382BUILTIN(__nvvm_f2h_rn, "Usf", "")
383
384BUILTIN(__nvvm_h2f, "fUs", "")
385
386// Bitcast
387
388BUILTIN(__nvvm_bitcast_f2i, "if", "")
389BUILTIN(__nvvm_bitcast_i2f, "fi", "")
390
391BUILTIN(__nvvm_bitcast_ll2d, "dLLi", "")
392BUILTIN(__nvvm_bitcast_d2ll, "LLid", "")
393
394// Sync
395
396BUILTIN(__syncthreads, "v", "")
397BUILTIN(__nvvm_bar0_popc, "ii", "")
398BUILTIN(__nvvm_bar0_and, "ii", "")
399BUILTIN(__nvvm_bar0_or, "ii", "")
400BUILTIN(__nvvm_bar_sync, "vi", "n")
401
402// Shuffle
403
404BUILTIN(__nvvm_shfl_down_i32, "iiii", "")
405BUILTIN(__nvvm_shfl_down_f32, "ffii", "")
406BUILTIN(__nvvm_shfl_up_i32, "iiii", "")
407BUILTIN(__nvvm_shfl_up_f32, "ffii", "")
408BUILTIN(__nvvm_shfl_bfly_i32, "iiii", "")
409BUILTIN(__nvvm_shfl_bfly_f32, "ffii", "")
410BUILTIN(__nvvm_shfl_idx_i32, "iiii", "")
411BUILTIN(__nvvm_shfl_idx_f32, "ffii", "")
412
413// Membar
414
415BUILTIN(__nvvm_membar_cta, "v", "")
416BUILTIN(__nvvm_membar_gl, "v", "")
417BUILTIN(__nvvm_membar_sys, "v", "")
418
419// Memcpy, Memset
420
421BUILTIN(__nvvm_memcpy, "vUc*Uc*zi","")
422BUILTIN(__nvvm_memset, "vUc*Uczi","")
423
424// Image
425
426BUILTIN(__builtin_ptx_read_image2Dfi_, "V4fiiii", "")
427BUILTIN(__builtin_ptx_read_image2Dff_, "V4fiiff", "")
428BUILTIN(__builtin_ptx_read_image2Dii_, "V4iiiii", "")
429BUILTIN(__builtin_ptx_read_image2Dif_, "V4iiiff", "")
430
431BUILTIN(__builtin_ptx_read_image3Dfi_, "V4fiiiiii", "")
432BUILTIN(__builtin_ptx_read_image3Dff_, "V4fiiffff", "")
433BUILTIN(__builtin_ptx_read_image3Dii_, "V4iiiiiii", "")
434BUILTIN(__builtin_ptx_read_image3Dif_, "V4iiiffff", "")
435
436BUILTIN(__builtin_ptx_write_image2Df_, "viiiffff", "")
437BUILTIN(__builtin_ptx_write_image2Di_, "viiiiiii", "")
438BUILTIN(__builtin_ptx_write_image2Dui_, "viiiUiUiUiUi", "")
439BUILTIN(__builtin_ptx_get_image_depthi_, "ii", "")
440BUILTIN(__builtin_ptx_get_image_heighti_, "ii", "")
441BUILTIN(__builtin_ptx_get_image_widthi_, "ii", "")
442BUILTIN(__builtin_ptx_get_image_channel_data_typei_, "ii", "")
443BUILTIN(__builtin_ptx_get_image_channel_orderi_, "ii", "")
444
445// Atomic
446//
447// We need the atom intrinsics because
448// - they are used in converging analysis
449// - they are used in address space analysis and optimization
450// So it does not hurt to expose them as builtins.
451//
452BUILTIN(__nvvm_atom_add_g_i, "iiD*1i", "n")
453BUILTIN(__nvvm_atom_add_s_i, "iiD*3i", "n")
454BUILTIN(__nvvm_atom_add_gen_i, "iiD*i", "n")
455BUILTIN(__nvvm_atom_add_g_l, "LiLiD*1Li", "n")
456BUILTIN(__nvvm_atom_add_s_l, "LiLiD*3Li", "n")
457BUILTIN(__nvvm_atom_add_gen_l, "LiLiD*Li", "n")
458BUILTIN(__nvvm_atom_add_g_ll, "LLiLLiD*1LLi", "n")
459BUILTIN(__nvvm_atom_add_s_ll, "LLiLLiD*3LLi", "n")
460BUILTIN(__nvvm_atom_add_gen_ll, "LLiLLiD*LLi", "n")
461BUILTIN(__nvvm_atom_add_g_f, "ffD*1f", "n")
462BUILTIN(__nvvm_atom_add_s_f, "ffD*3f", "n")
463BUILTIN(__nvvm_atom_add_gen_f, "ffD*f", "n")
464BUILTIN(__nvvm_atom_add_g_d, "ddD*1d", "n")
465BUILTIN(__nvvm_atom_add_s_d, "ddD*3d", "n")
466BUILTIN(__nvvm_atom_add_gen_d, "ddD*d", "n")
467
468BUILTIN(__nvvm_atom_sub_g_i, "iiD*1i", "n")
469BUILTIN(__nvvm_atom_sub_s_i, "iiD*3i", "n")
470BUILTIN(__nvvm_atom_sub_gen_i, "iiD*i", "n")
471BUILTIN(__nvvm_atom_sub_g_l, "LiLiD*1Li", "n")
472BUILTIN(__nvvm_atom_sub_s_l, "LiLiD*3Li", "n")
473BUILTIN(__nvvm_atom_sub_gen_l, "LiLiD*Li", "n")
474BUILTIN(__nvvm_atom_sub_g_ll, "LLiLLiD*1LLi", "n")
475BUILTIN(__nvvm_atom_sub_s_ll, "LLiLLiD*3LLi", "n")
476BUILTIN(__nvvm_atom_sub_gen_ll, "LLiLLiD*LLi", "n")
477
478BUILTIN(__nvvm_atom_xchg_g_i, "iiD*1i", "n")
479BUILTIN(__nvvm_atom_xchg_s_i, "iiD*3i", "n")
480BUILTIN(__nvvm_atom_xchg_gen_i, "iiD*i", "n")
481BUILTIN(__nvvm_atom_xchg_g_l, "LiLiD*1Li", "n")
482BUILTIN(__nvvm_atom_xchg_s_l, "LiLiD*3Li", "n")
483BUILTIN(__nvvm_atom_xchg_gen_l, "LiLiD*Li", "n")
484BUILTIN(__nvvm_atom_xchg_g_ll, "LLiLLiD*1LLi", "n")
485BUILTIN(__nvvm_atom_xchg_s_ll, "LLiLLiD*3LLi", "n")
486BUILTIN(__nvvm_atom_xchg_gen_ll, "LLiLLiD*LLi", "n")
487
488BUILTIN(__nvvm_atom_max_g_i, "iiD*1i", "n")
489BUILTIN(__nvvm_atom_max_s_i, "iiD*3i", "n")
490BUILTIN(__nvvm_atom_max_gen_i, "iiD*i", "n")
491BUILTIN(__nvvm_atom_max_g_ui, "UiUiD*1Ui", "n")
492BUILTIN(__nvvm_atom_max_s_ui, "UiUiD*3Ui", "n")
493BUILTIN(__nvvm_atom_max_gen_ui, "UiUiD*Ui", "n")
494BUILTIN(__nvvm_atom_max_g_l, "LiLiD*1Li", "n")
495BUILTIN(__nvvm_atom_max_s_l, "LiLiD*3Li", "n")
496BUILTIN(__nvvm_atom_max_gen_l, "LiLiD*Li", "n")
497BUILTIN(__nvvm_atom_max_g_ul, "ULiULiD*1ULi", "n")
498BUILTIN(__nvvm_atom_max_s_ul, "ULiULiD*3ULi", "n")
499BUILTIN(__nvvm_atom_max_gen_ul, "ULiULiD*ULi", "n")
500BUILTIN(__nvvm_atom_max_g_ll, "LLiLLiD*1LLi", "n")
501BUILTIN(__nvvm_atom_max_s_ll, "LLiLLiD*3LLi", "n")
502BUILTIN(__nvvm_atom_max_gen_ll, "LLiLLiD*LLi", "n")
503BUILTIN(__nvvm_atom_max_g_ull, "ULLiULLiD*1ULLi", "n")
504BUILTIN(__nvvm_atom_max_s_ull, "ULLiULLiD*3ULLi", "n")
505BUILTIN(__nvvm_atom_max_gen_ull, "ULLiULLiD*ULLi", "n")
506
507BUILTIN(__nvvm_atom_min_g_i, "iiD*1i", "n")
508BUILTIN(__nvvm_atom_min_s_i, "iiD*3i", "n")
509BUILTIN(__nvvm_atom_min_gen_i, "iiD*i", "n")
510BUILTIN(__nvvm_atom_min_g_ui, "UiUiD*1Ui", "n")
511BUILTIN(__nvvm_atom_min_s_ui, "UiUiD*3Ui", "n")
512BUILTIN(__nvvm_atom_min_gen_ui, "UiUiD*Ui", "n")
513BUILTIN(__nvvm_atom_min_g_l, "LiLiD*1Li", "n")
514BUILTIN(__nvvm_atom_min_s_l, "LiLiD*3Li", "n")
515BUILTIN(__nvvm_atom_min_gen_l, "LiLiD*Li", "n")
516BUILTIN(__nvvm_atom_min_g_ul, "ULiULiD*1ULi", "n")
517BUILTIN(__nvvm_atom_min_s_ul, "ULiULiD*3ULi", "n")
518BUILTIN(__nvvm_atom_min_gen_ul, "ULiULiD*ULi", "n")
519BUILTIN(__nvvm_atom_min_g_ll, "LLiLLiD*1LLi", "n")
520BUILTIN(__nvvm_atom_min_s_ll, "LLiLLiD*3LLi", "n")
521BUILTIN(__nvvm_atom_min_gen_ll, "LLiLLiD*LLi", "n")
522BUILTIN(__nvvm_atom_min_g_ull, "ULLiULLiD*1ULLi", "n")
523BUILTIN(__nvvm_atom_min_s_ull, "ULLiULLiD*3ULLi", "n")
524BUILTIN(__nvvm_atom_min_gen_ull, "ULLiULLiD*ULLi", "n")
525
526BUILTIN(__nvvm_atom_inc_g_ui, "UiUiD*1Ui", "n")
527BUILTIN(__nvvm_atom_inc_s_ui, "UiUiD*3Ui", "n")
528BUILTIN(__nvvm_atom_inc_gen_ui, "UiUiD*Ui", "n")
529BUILTIN(__nvvm_atom_dec_g_ui, "UiUiD*1Ui", "n")
530BUILTIN(__nvvm_atom_dec_s_ui, "UiUiD*3Ui", "n")
531BUILTIN(__nvvm_atom_dec_gen_ui, "UiUiD*Ui", "n")
532
533BUILTIN(__nvvm_atom_and_g_i, "iiD*1i", "n")
534BUILTIN(__nvvm_atom_and_s_i, "iiD*3i", "n")
535BUILTIN(__nvvm_atom_and_gen_i, "iiD*i", "n")
536BUILTIN(__nvvm_atom_and_g_l, "LiLiD*1Li", "n")
537BUILTIN(__nvvm_atom_and_s_l, "LiLiD*3Li", "n")
538BUILTIN(__nvvm_atom_and_gen_l, "LiLiD*Li", "n")
539BUILTIN(__nvvm_atom_and_g_ll, "LLiLLiD*1LLi", "n")
540BUILTIN(__nvvm_atom_and_s_ll, "LLiLLiD*3LLi", "n")
541BUILTIN(__nvvm_atom_and_gen_ll, "LLiLLiD*LLi", "n")
542
543BUILTIN(__nvvm_atom_or_g_i, "iiD*1i", "n")
544BUILTIN(__nvvm_atom_or_s_i, "iiD*3i", "n")
545BUILTIN(__nvvm_atom_or_gen_i, "iiD*i", "n")
546BUILTIN(__nvvm_atom_or_g_l, "LiLiD*1Li", "n")
547BUILTIN(__nvvm_atom_or_s_l, "LiLiD*3Li", "n")
548BUILTIN(__nvvm_atom_or_gen_l, "LiLiD*Li", "n")
549BUILTIN(__nvvm_atom_or_g_ll, "LLiLLiD*1LLi", "n")
550BUILTIN(__nvvm_atom_or_s_ll, "LLiLLiD*3LLi", "n")
551BUILTIN(__nvvm_atom_or_gen_ll, "LLiLLiD*LLi", "n")
552
553BUILTIN(__nvvm_atom_xor_g_i, "iiD*1i", "n")
554BUILTIN(__nvvm_atom_xor_s_i, "iiD*3i", "n")
555BUILTIN(__nvvm_atom_xor_gen_i, "iiD*i", "n")
556BUILTIN(__nvvm_atom_xor_g_l, "LiLiD*1Li", "n")
557BUILTIN(__nvvm_atom_xor_s_l, "LiLiD*3Li", "n")
558BUILTIN(__nvvm_atom_xor_gen_l, "LiLiD*Li", "n")
559BUILTIN(__nvvm_atom_xor_g_ll, "LLiLLiD*1LLi", "n")
560BUILTIN(__nvvm_atom_xor_s_ll, "LLiLLiD*3LLi", "n")
561BUILTIN(__nvvm_atom_xor_gen_ll, "LLiLLiD*LLi", "n")
562
563BUILTIN(__nvvm_atom_cas_g_i, "iiD*1ii", "n")
564BUILTIN(__nvvm_atom_cas_s_i, "iiD*3ii", "n")
565BUILTIN(__nvvm_atom_cas_gen_i, "iiD*ii", "n")
566BUILTIN(__nvvm_atom_cas_g_l, "LiLiD*1LiLi", "n")
567BUILTIN(__nvvm_atom_cas_s_l, "LiLiD*3LiLi", "n")
568BUILTIN(__nvvm_atom_cas_gen_l, "LiLiD*LiLi", "n")
569BUILTIN(__nvvm_atom_cas_g_ll, "LLiLLiD*1LLiLLi", "n")
570BUILTIN(__nvvm_atom_cas_s_ll, "LLiLLiD*3LLiLLi", "n")
571BUILTIN(__nvvm_atom_cas_gen_ll, "LLiLLiD*LLiLLi", "n")
572
573// Compiler Error Warn
574BUILTIN(__nvvm_compiler_error, "vcC*4", "n")
575BUILTIN(__nvvm_compiler_warn, "vcC*4", "n")
576
577// __ldg.  This is not implemented as a builtin by nvcc.
578BUILTIN(__nvvm_ldg_c, "ccC*", "")
579BUILTIN(__nvvm_ldg_s, "ssC*", "")
580BUILTIN(__nvvm_ldg_i, "iiC*", "")
581BUILTIN(__nvvm_ldg_l, "LiLiC*", "")
582BUILTIN(__nvvm_ldg_ll, "LLiLLiC*", "")
583
584BUILTIN(__nvvm_ldg_uc, "UcUcC*", "")
585BUILTIN(__nvvm_ldg_us, "UsUsC*", "")
586BUILTIN(__nvvm_ldg_ui, "UiUiC*", "")
587BUILTIN(__nvvm_ldg_ul, "ULiULiC*", "")
588BUILTIN(__nvvm_ldg_ull, "ULLiULLiC*", "")
589
590BUILTIN(__nvvm_ldg_f, "ffC*", "")
591BUILTIN(__nvvm_ldg_d, "ddC*", "")
592
593BUILTIN(__nvvm_ldg_c2, "E2cE2cC*", "")
594BUILTIN(__nvvm_ldg_c4, "E4cE4cC*", "")
595BUILTIN(__nvvm_ldg_s2, "E2sE2sC*", "")
596BUILTIN(__nvvm_ldg_s4, "E4sE4sC*", "")
597BUILTIN(__nvvm_ldg_i2, "E2iE2iC*", "")
598BUILTIN(__nvvm_ldg_i4, "E4iE4iC*", "")
599BUILTIN(__nvvm_ldg_ll2, "E2LLiE2LLiC*", "")
600
601BUILTIN(__nvvm_ldg_uc2, "E2UcE2UcC*", "")
602BUILTIN(__nvvm_ldg_uc4, "E4UcE4UcC*", "")
603BUILTIN(__nvvm_ldg_us2, "E2UsE2UsC*", "")
604BUILTIN(__nvvm_ldg_us4, "E4UsE4UsC*", "")
605BUILTIN(__nvvm_ldg_ui2, "E2UiE2UiC*", "")
606BUILTIN(__nvvm_ldg_ui4, "E4UiE4UiC*", "")
607BUILTIN(__nvvm_ldg_ull2, "E2ULLiE2ULLiC*", "")
608
609BUILTIN(__nvvm_ldg_f2, "E2fE2fC*", "")
610BUILTIN(__nvvm_ldg_f4, "E4fE4fC*", "")
611BUILTIN(__nvvm_ldg_d2, "E2dE2dC*", "")
612
613#undef BUILTIN
614