//===--- BuiltinsPTX.def - PTX Builtin function database ----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the PTX-specific builtin function database.  Users of
// this file must define the BUILTIN macro to make use of this information.
//
//===----------------------------------------------------------------------===//

// The format of this database matches clang/Basic/Builtins.def.

// Builtins retained from previous PTX back-end
BUILTIN(__builtin_ptx_read_tid_x, "i", "nc")
BUILTIN(__builtin_ptx_read_tid_y, "i", "nc")
BUILTIN(__builtin_ptx_read_tid_z, "i", "nc")
BUILTIN(__builtin_ptx_read_tid_w, "i", "nc")

BUILTIN(__builtin_ptx_read_ntid_x, "i", "nc")
BUILTIN(__builtin_ptx_read_ntid_y, "i", "nc")
BUILTIN(__builtin_ptx_read_ntid_z, "i", "nc")
BUILTIN(__builtin_ptx_read_ntid_w, "i", "nc")

BUILTIN(__builtin_ptx_read_ctaid_x, "i", "nc")
BUILTIN(__builtin_ptx_read_ctaid_y, "i", "nc")
BUILTIN(__builtin_ptx_read_ctaid_z, "i", "nc")
BUILTIN(__builtin_ptx_read_ctaid_w, "i", "nc")

BUILTIN(__builtin_ptx_read_nctaid_x, "i", "nc")
BUILTIN(__builtin_ptx_read_nctaid_y, "i", "nc")
BUILTIN(__builtin_ptx_read_nctaid_z, "i", "nc")
BUILTIN(__builtin_ptx_read_nctaid_w, "i", "nc")

BUILTIN(__builtin_ptx_read_laneid, "i", "nc")
BUILTIN(__builtin_ptx_read_warpid, "i", "nc")
BUILTIN(__builtin_ptx_read_nwarpid, "i", "nc")

BUILTIN(__builtin_ptx_read_smid, "i", "nc")
BUILTIN(__builtin_ptx_read_nsmid, "i", "nc")
BUILTIN(__builtin_ptx_read_gridid, "i", "nc")

BUILTIN(__builtin_ptx_read_lanemask_eq, "i", "nc")
BUILTIN(__builtin_ptx_read_lanemask_le, "i", "nc")
BUILTIN(__builtin_ptx_read_lanemask_lt, "i", "nc")
BUILTIN(__builtin_ptx_read_lanemask_ge, "i", "nc")
BUILTIN(__builtin_ptx_read_lanemask_gt, "i", "nc")

BUILTIN(__builtin_ptx_read_clock, "i", "n")
BUILTIN(__builtin_ptx_read_clock64, "Li", "n")

BUILTIN(__builtin_ptx_read_pm0, "i", "n")
BUILTIN(__builtin_ptx_read_pm1, "i", "n")
BUILTIN(__builtin_ptx_read_pm2, "i", "n")
BUILTIN(__builtin_ptx_read_pm3, "i", "n")

BUILTIN(__builtin_ptx_bar_sync, "vi", "n")


// Builtins exposed as part of NVVM
BUILTIN(__syncthreads, "v", "n")
BUILTIN(__nvvm_bar0, "v", "n")
BUILTIN(__nvvm_bar0_popc, "ii", "n")
BUILTIN(__nvvm_bar0_and, "ii", "n")
BUILTIN(__nvvm_bar0_or, "ii", "n")
BUILTIN(__nvvm_membar_cta, "v", "n")
BUILTIN(__nvvm_membar_gl, "v", "n")
BUILTIN(__nvvm_membar_sys, "v", "n")
BUILTIN(__nvvm_popc_i, "ii", "nc")
BUILTIN(__nvvm_popc_ll, "LiLi", "nc")
BUILTIN(__nvvm_prmt, "UiUiUiUi", "nc")
BUILTIN(__nvvm_min_i, "iii", "nc")
BUILTIN(__nvvm_min_ui, "UiUiUi", "nc")
BUILTIN(__nvvm_min_ll, "LLiLLiLLi", "nc")
BUILTIN(__nvvm_min_ull, "ULLiULLiULLi", "nc")
BUILTIN(__nvvm_max_i, "iii", "nc")
BUILTIN(__nvvm_max_ui, "UiUiUi", "nc")
BUILTIN(__nvvm_max_ll, "LLiLLiLLi", "nc")
BUILTIN(__nvvm_max_ull, "ULLiULLiULLi", "nc")
BUILTIN(__nvvm_mulhi_i, "iii", "nc")
BUILTIN(__nvvm_mulhi_ui, "UiUiUi", "nc")
BUILTIN(__nvvm_mulhi_ll, "LLiLLiLLi", "nc")
BUILTIN(__nvvm_mulhi_ull, "ULLiULLiULLi", "nc")
BUILTIN(__nvvm_mul24_i, "iii", "nc")
BUILTIN(__nvvm_mul24_ui, "UiUiUi", "nc")
BUILTIN(__nvvm_brev32, "UiUi", "nc")
BUILTIN(__nvvm_brev64, "ULLiULLi", "nc")
BUILTIN(__nvvm_sad_i, "iiii", "nc")
BUILTIN(__nvvm_sad_ui, "UiUiUiUi", "nc")
BUILTIN(__nvvm_abs_i, "ii", "nc")
BUILTIN(__nvvm_abs_ll, "LiLi", "nc")
BUILTIN(__nvvm_floor_ftz_f, "ff", "nc")
BUILTIN(__nvvm_floor_f, "ff", "nc")
BUILTIN(__nvvm_floor_d, "dd", "nc")
BUILTIN(__nvvm_fabs_ftz_f, "ff", "nc")
BUILTIN(__nvvm_fabs_f, "ff", "nc")
BUILTIN(__nvvm_fabs_d, "dd", "nc")
BUILTIN(__nvvm_rcp_approx_ftz_d, "dd", "nc")
BUILTIN(__nvvm_fmin_ftz_f, "fff", "nc")
BUILTIN(__nvvm_fmin_f, "fff", "nc")
BUILTIN(__nvvm_fmax_ftz_f, "fff", "nc")
BUILTIN(__nvvm_fmax_f, "fff", "nc")
BUILTIN(__nvvm_rsqrt_approx_ftz_f, "ff", "nc")
BUILTIN(__nvvm_rsqrt_approx_f, "ff", "nc")
BUILTIN(__nvvm_fmin_d, "ddd", "nc")
BUILTIN(__nvvm_fmax_d, "ddd", "nc")
BUILTIN(__nvvm_rsqrt_approx_d, "dd", "nc")
BUILTIN(__nvvm_ceil_d, "dd", "nc")
BUILTIN(__nvvm_trunc_d, "dd", "nc")
BUILTIN(__nvvm_round_d, "dd", "nc")
BUILTIN(__nvvm_ex2_approx_d, "dd", "nc")
BUILTIN(__nvvm_lg2_approx_d, "dd", "nc")
BUILTIN(__nvvm_round_ftz_f, "ff", "nc")
BUILTIN(__nvvm_round_f, "ff", "nc")
BUILTIN(__nvvm_ex2_approx_ftz_f, "ff", "nc")
BUILTIN(__nvvm_ex2_approx_f, "ff", "nc")
BUILTIN(__nvvm_lg2_approx_ftz_f, "ff", "nc")
BUILTIN(__nvvm_lg2_approx_f, "ff", "nc")
BUILTIN(__nvvm_sin_approx_ftz_f, "ff", "nc")
BUILTIN(__nvvm_sin_approx_f, "ff", "nc")
BUILTIN(__nvvm_cos_approx_ftz_f, "ff", "nc")
BUILTIN(__nvvm_cos_approx_f, "ff", "nc")
BUILTIN(__nvvm_trunc_ftz_f, "ff", "nc")
BUILTIN(__nvvm_trunc_f, "ff", "nc")
BUILTIN(__nvvm_ceil_ftz_f, "ff", "nc")
BUILTIN(__nvvm_ceil_f, "ff", "nc")
BUILTIN(__nvvm_saturate_d, "dd", "nc")
BUILTIN(__nvvm_saturate_ftz_f, "ff", "nc")
BUILTIN(__nvvm_saturate_f, "ff", "nc")
BUILTIN(__nvvm_fma_rn_ftz_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rn_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rz_ftz_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rz_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rm_ftz_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rm_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rp_ftz_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rp_f, "ffff", "nc")
BUILTIN(__nvvm_fma_rn_d, "dddd", "nc")
BUILTIN(__nvvm_fma_rz_d, "dddd", "nc")
BUILTIN(__nvvm_fma_rm_d, "dddd", "nc")
BUILTIN(__nvvm_fma_rp_d, "dddd", "nc")
BUILTIN(__nvvm_div_approx_ftz_f, "fff", "nc")
BUILTIN(__nvvm_div_approx_f, "fff", "nc")
BUILTIN(__nvvm_div_rn_ftz_f, "fff", "nc")
BUILTIN(__nvvm_div_rn_f, "fff", "nc")
BUILTIN(__nvvm_div_rz_ftz_f, "fff", "nc")
BUILTIN(__nvvm_div_rz_f, "fff", "nc")
BUILTIN(__nvvm_div_rm_ftz_f, "fff", "nc")
BUILTIN(__nvvm_div_rm_f, "fff", "nc")
BUILTIN(__nvvm_div_rp_ftz_f, "fff", "nc")
BUILTIN(__nvvm_div_rp_f, "fff", "nc")
BUILTIN(__nvvm_rcp_rn_ftz_f, "ff", "nc")
BUILTIN(__nvvm_rcp_rn_f, "ff", "nc")
BUILTIN(__nvvm_rcp_rz_ftz_f, "ff", "nc")
BUILTIN(__nvvm_rcp_rz_f, "ff", "nc")
BUILTIN(__nvvm_rcp_rm_ftz_f, "ff", "nc")
BUILTIN(__nvvm_rcp_rm_f, "ff", "nc")
BUILTIN(__nvvm_rcp_rp_ftz_f, "ff", "nc")
BUILTIN(__nvvm_rcp_rp_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rn_ftz_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rn_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rz_ftz_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rz_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rm_ftz_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rm_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rp_ftz_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_rp_f, "ff", "nc")
BUILTIN(__nvvm_div_rn_d, "ddd", "nc")
BUILTIN(__nvvm_div_rz_d, "ddd", "nc")
BUILTIN(__nvvm_div_rm_d, "ddd", "nc")
BUILTIN(__nvvm_div_rp_d, "ddd", "nc")
BUILTIN(__nvvm_rcp_rn_d, "dd", "nc")
BUILTIN(__nvvm_rcp_rz_d, "dd", "nc")
BUILTIN(__nvvm_rcp_rm_d, "dd", "nc")
BUILTIN(__nvvm_rcp_rp_d, "dd", "nc")
BUILTIN(__nvvm_sqrt_rn_d, "dd", "nc")
BUILTIN(__nvvm_sqrt_rz_d, "dd", "nc")
BUILTIN(__nvvm_sqrt_rm_d, "dd", "nc")
BUILTIN(__nvvm_sqrt_rp_d, "dd", "nc")
BUILTIN(__nvvm_sqrt_approx_ftz_f, "ff", "nc")
BUILTIN(__nvvm_sqrt_approx_f, "ff", "nc")
BUILTIN(__nvvm_add_rn_d, "ddd", "nc")
BUILTIN(__nvvm_add_rz_d, "ddd", "nc")
BUILTIN(__nvvm_add_rm_d, "ddd", "nc")
BUILTIN(__nvvm_add_rp_d, "ddd", "nc")
BUILTIN(__nvvm_mul_rn_d, "ddd", "nc")
BUILTIN(__nvvm_mul_rz_d, "ddd", "nc")
BUILTIN(__nvvm_mul_rm_d, "ddd", "nc")
BUILTIN(__nvvm_mul_rp_d, "ddd", "nc")
BUILTIN(__nvvm_add_rm_ftz_f, "fff", "nc")
BUILTIN(__nvvm_add_rm_f, "fff", "nc")
BUILTIN(__nvvm_add_rp_ftz_f, "fff", "nc")
BUILTIN(__nvvm_add_rp_f, "fff", "nc")
BUILTIN(__nvvm_mul_rm_ftz_f, "fff", "nc")
BUILTIN(__nvvm_mul_rm_f, "fff", "nc")
BUILTIN(__nvvm_mul_rp_ftz_f, "fff", "nc")
BUILTIN(__nvvm_mul_rp_f, "fff", "nc")
BUILTIN(__nvvm_add_rn_ftz_f, "fff", "nc")
BUILTIN(__nvvm_add_rn_f, "fff", "nc")
BUILTIN(__nvvm_add_rz_ftz_f, "fff", "nc")
BUILTIN(__nvvm_add_rz_f, "fff", "nc")
BUILTIN(__nvvm_mul_rn_ftz_f, "fff", "nc")
BUILTIN(__nvvm_mul_rn_f, "fff", "nc")
BUILTIN(__nvvm_mul_rz_ftz_f, "fff", "nc")
BUILTIN(__nvvm_mul_rz_f, "fff", "nc")
BUILTIN(__nvvm_d2f_rn_ftz, "fd", "nc")
BUILTIN(__nvvm_d2f_rn, "fd", "nc")
BUILTIN(__nvvm_d2f_rz_ftz, "fd", "nc")
BUILTIN(__nvvm_d2f_rz, "fd", "nc")
BUILTIN(__nvvm_d2f_rm_ftz, "fd", "nc")
BUILTIN(__nvvm_d2f_rm, "fd", "nc")
BUILTIN(__nvvm_d2f_rp_ftz, "fd", "nc")
BUILTIN(__nvvm_d2f_rp, "fd", "nc")
BUILTIN(__nvvm_d2i_rn, "id", "nc")
BUILTIN(__nvvm_d2i_rz, "id", "nc")
BUILTIN(__nvvm_d2i_rm, "id", "nc")
BUILTIN(__nvvm_d2i_rp, "id", "nc")
BUILTIN(__nvvm_d2ui_rn, "Uid", "nc")
BUILTIN(__nvvm_d2ui_rz, "Uid", "nc")
BUILTIN(__nvvm_d2ui_rm, "Uid", "nc")
BUILTIN(__nvvm_d2ui_rp, "Uid", "nc")
BUILTIN(__nvvm_i2d_rn, "di", "nc")
BUILTIN(__nvvm_i2d_rz, "di", "nc")
BUILTIN(__nvvm_i2d_rm, "di", "nc")
BUILTIN(__nvvm_i2d_rp, "di", "nc")
BUILTIN(__nvvm_ui2d_rn, "dUi", "nc")
BUILTIN(__nvvm_ui2d_rz, "dUi", "nc")
BUILTIN(__nvvm_ui2d_rm, "dUi", "nc")
BUILTIN(__nvvm_ui2d_rp, "dUi", "nc")
BUILTIN(__nvvm_f2i_rn_ftz, "if", "nc")
BUILTIN(__nvvm_f2i_rn, "if", "nc")
BUILTIN(__nvvm_f2i_rz_ftz, "if", "nc")
BUILTIN(__nvvm_f2i_rz, "if", "nc")
BUILTIN(__nvvm_f2i_rm_ftz, "if", "nc")
BUILTIN(__nvvm_f2i_rm, "if", "nc")
BUILTIN(__nvvm_f2i_rp_ftz, "if", "nc")
BUILTIN(__nvvm_f2i_rp, "if", "nc")
BUILTIN(__nvvm_f2ui_rn_ftz, "Uif", "nc")
BUILTIN(__nvvm_f2ui_rn, "Uif", "nc")
BUILTIN(__nvvm_f2ui_rz_ftz, "Uif", "nc")
BUILTIN(__nvvm_f2ui_rz, "Uif", "nc")
BUILTIN(__nvvm_f2ui_rm_ftz, "Uif", "nc")
BUILTIN(__nvvm_f2ui_rm, "Uif", "nc")
BUILTIN(__nvvm_f2ui_rp_ftz, "Uif", "nc")
BUILTIN(__nvvm_f2ui_rp, "Uif", "nc")
BUILTIN(__nvvm_i2f_rn, "fi", "nc")
BUILTIN(__nvvm_i2f_rz, "fi", "nc")
BUILTIN(__nvvm_i2f_rm, "fi", "nc")
BUILTIN(__nvvm_i2f_rp, "fi", "nc")
BUILTIN(__nvvm_ui2f_rn, "fUi", "nc")
BUILTIN(__nvvm_ui2f_rz, "fUi", "nc")
BUILTIN(__nvvm_ui2f_rm, "fUi", "nc")
BUILTIN(__nvvm_ui2f_rp, "fUi", "nc")
BUILTIN(__nvvm_lohi_i2d, "dii", "nc")
BUILTIN(__nvvm_d2i_lo, "id", "nc")
BUILTIN(__nvvm_d2i_hi, "id", "nc")
BUILTIN(__nvvm_f2ll_rn_ftz, "LLif", "nc")
BUILTIN(__nvvm_f2ll_rn, "LLif", "nc")
BUILTIN(__nvvm_f2ll_rz_ftz, "LLif", "nc")
BUILTIN(__nvvm_f2ll_rz, "LLif", "nc")
BUILTIN(__nvvm_f2ll_rm_ftz, "LLif", "nc")
BUILTIN(__nvvm_f2ll_rm, "LLif", "nc")
BUILTIN(__nvvm_f2ll_rp_ftz, "LLif", "nc")
BUILTIN(__nvvm_f2ll_rp, "LLif", "nc")
BUILTIN(__nvvm_f2ull_rn_ftz, "ULLif", "nc")
BUILTIN(__nvvm_f2ull_rn, "ULLif", "nc")
BUILTIN(__nvvm_f2ull_rz_ftz, "ULLif", "nc")
BUILTIN(__nvvm_f2ull_rz, "ULLif", "nc")
BUILTIN(__nvvm_f2ull_rm_ftz, "ULLif", "nc")
BUILTIN(__nvvm_f2ull_rm, "ULLif", "nc")
BUILTIN(__nvvm_f2ull_rp_ftz, "ULLif", "nc")
BUILTIN(__nvvm_f2ull_rp, "ULLif", "nc")
BUILTIN(__nvvm_d2ll_rn, "LLid", "nc")
BUILTIN(__nvvm_d2ll_rz, "LLid", "nc")
BUILTIN(__nvvm_d2ll_rm, "LLid", "nc")
BUILTIN(__nvvm_d2ll_rp, "LLid", "nc")
BUILTIN(__nvvm_d2ull_rn, "ULLid", "nc")
BUILTIN(__nvvm_d2ull_rz, "ULLid", "nc")
BUILTIN(__nvvm_d2ull_rm, "ULLid", "nc")
BUILTIN(__nvvm_d2ull_rp, "ULLid", "nc")
BUILTIN(__nvvm_ll2f_rn, "fLLi", "nc")
BUILTIN(__nvvm_ll2f_rz, "fLLi", "nc")
BUILTIN(__nvvm_ll2f_rm, "fLLi", "nc")
BUILTIN(__nvvm_ll2f_rp, "fLLi", "nc")
BUILTIN(__nvvm_ull2f_rn, "fULLi", "nc")
BUILTIN(__nvvm_ull2f_rz, "fULLi", "nc")
BUILTIN(__nvvm_ull2f_rm, "fULLi", "nc")
BUILTIN(__nvvm_ull2f_rp, "fULLi", "nc")
BUILTIN(__nvvm_ll2d_rn, "dLLi", "nc")
BUILTIN(__nvvm_ll2d_rz, "dLLi", "nc")
BUILTIN(__nvvm_ll2d_rm, "dLLi", "nc")
BUILTIN(__nvvm_ll2d_rp, "dLLi", "nc")
BUILTIN(__nvvm_ull2d_rn, "dULLi", "nc")
BUILTIN(__nvvm_ull2d_rz, "dULLi", "nc")
BUILTIN(__nvvm_ull2d_rm, "dULLi", "nc")
BUILTIN(__nvvm_ull2d_rp, "dULLi", "nc")
BUILTIN(__nvvm_f2h_rn_ftz, "Usf", "nc")
BUILTIN(__nvvm_f2h_rn, "Usf", "nc")
BUILTIN(__nvvm_h2f, "fUs", "nc")
BUILTIN(__nvvm_bitcast_i2f, "fi", "nc")
BUILTIN(__nvvm_bitcast_f2i, "if", "nc")
BUILTIN(__nvvm_bitcast_ll2d, "dLLi", "nc")
BUILTIN(__nvvm_bitcast_d2ll, "LLid", "nc")

#undef BUILTIN
