1*0bfacb9bSmrg/* Copyright (C) 2016-2020 Free Software Foundation, Inc. 2760c2415Smrg 3760c2415Smrg This file is free software; you can redistribute it and/or modify it under 4760c2415Smrg the terms of the GNU General Public License as published by the Free 5760c2415Smrg Software Foundation; either version 3 of the License, or (at your option) 6760c2415Smrg any later version. 7760c2415Smrg 8760c2415Smrg This file is distributed in the hope that it will be useful, but WITHOUT 9760c2415Smrg ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10760c2415Smrg FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11760c2415Smrg for more details. 12760c2415Smrg 13760c2415Smrg You should have received a copy of the GNU General Public License 14760c2415Smrg along with GCC; see the file COPYING3. If not see 15760c2415Smrg <http://www.gnu.org/licenses/>. */ 16760c2415Smrg 17760c2415Smrg/* The first argument to these macros is the return type of the builtin, 18760c2415Smrg the rest are arguments of the builtin. */ 19760c2415Smrg#define _A1(a) {a, GCN_BTI_END_OF_PARAMS} 20760c2415Smrg#define _A2(a,b) {a, b, GCN_BTI_END_OF_PARAMS} 21760c2415Smrg#define _A3(a,b,c) {a, b, c, GCN_BTI_END_OF_PARAMS} 22760c2415Smrg#define _A4(a,b,c,d) {a, b, c, d, GCN_BTI_END_OF_PARAMS} 23760c2415Smrg#define _A5(a,b,c,d,e) {a, b, c, d, e, GCN_BTI_END_OF_PARAMS} 24760c2415Smrg 25760c2415SmrgDEF_BUILTIN (FLAT_LOAD_INT32, 1 /*CODE_FOR_flat_load_v64si*/, 26760c2415Smrg "flat_load_int32", B_INSN, 27760c2415Smrg _A3 (GCN_BTI_V64SI, GCN_BTI_EXEC, GCN_BTI_V64SI), 28760c2415Smrg gcn_expand_builtin_1) 29760c2415Smrg 30760c2415SmrgDEF_BUILTIN (FLAT_LOAD_PTR_INT32, 2 /*CODE_FOR_flat_load_ptr_v64si */, 31760c2415Smrg "flat_load_ptr_int32", B_INSN, 32760c2415Smrg _A4 (GCN_BTI_V64SI, GCN_BTI_EXEC, GCN_BTI_SIPTR, GCN_BTI_V64SI), 33760c2415Smrg gcn_expand_builtin_1) 34760c2415Smrg 35760c2415SmrgDEF_BUILTIN (FLAT_STORE_PTR_INT32, 3 /*CODE_FOR_flat_store_ptr_v64si */, 36760c2415Smrg "flat_store_ptr_int32", B_INSN, 37760c2415Smrg _A5 (GCN_BTI_VOID, GCN_BTI_EXEC, GCN_BTI_SIPTR, GCN_BTI_V64SI, 38760c2415Smrg GCN_BTI_V64SI), 39760c2415Smrg gcn_expand_builtin_1) 40760c2415Smrg 41760c2415SmrgDEF_BUILTIN (FLAT_LOAD_PTR_FLOAT, 2 /*CODE_FOR_flat_load_ptr_v64sf */, 42760c2415Smrg "flat_load_ptr_float", B_INSN, 43760c2415Smrg _A4 (GCN_BTI_V64SF, GCN_BTI_EXEC, GCN_BTI_SFPTR, GCN_BTI_V64SI), 44760c2415Smrg gcn_expand_builtin_1) 45760c2415Smrg 46760c2415SmrgDEF_BUILTIN (FLAT_STORE_PTR_FLOAT, 3 /*CODE_FOR_flat_store_ptr_v64sf */, 47760c2415Smrg "flat_store_ptr_float", B_INSN, 48760c2415Smrg _A5 (GCN_BTI_VOID, GCN_BTI_EXEC, GCN_BTI_SFPTR, GCN_BTI_V64SI, 49760c2415Smrg GCN_BTI_V64SF), 50760c2415Smrg gcn_expand_builtin_1) 51760c2415Smrg 52760c2415SmrgDEF_BUILTIN (SQRTVF, 3 /*CODE_FOR_sqrtvf */, 53760c2415Smrg "sqrtvf", B_INSN, 54760c2415Smrg _A2 (GCN_BTI_V64SF, GCN_BTI_V64SF), 55760c2415Smrg gcn_expand_builtin_1) 56760c2415Smrg 57760c2415SmrgDEF_BUILTIN (SQRTF, 3 /*CODE_FOR_sqrtf */, 58760c2415Smrg "sqrtf", B_INSN, 59760c2415Smrg _A2 (GCN_BTI_SF, GCN_BTI_SF), 60760c2415Smrg gcn_expand_builtin_1) 61760c2415Smrg 62760c2415SmrgDEF_BUILTIN (CMP_SWAP, -1, 63760c2415Smrg "cmp_swap", B_INSN, 64760c2415Smrg _A4 (GCN_BTI_UINT, GCN_BTI_VOIDPTR, GCN_BTI_UINT, GCN_BTI_UINT), 65760c2415Smrg gcn_expand_builtin_1) 66760c2415Smrg 67760c2415SmrgDEF_BUILTIN (CMP_SWAPLL, -1, 68760c2415Smrg "cmp_swapll", B_INSN, 69760c2415Smrg _A4 (GCN_BTI_LLUINT, 70760c2415Smrg GCN_BTI_VOIDPTR, GCN_BTI_LLUINT, GCN_BTI_LLUINT), 71760c2415Smrg gcn_expand_builtin_1) 72760c2415Smrg 73760c2415Smrg/* DEF_BUILTIN_BINOP_INT_FP creates many variants of a builtin function for a 74760c2415Smrg given operation. The first argument will give base to the identifier of a 75760c2415Smrg particular builtin, the second will be used to form the name of the patter 76760c2415Smrg used to expand it to and the third will be used to create the user-visible 77760c2415Smrg builtin identifier. */ 78760c2415Smrg 79760c2415SmrgDEF_BUILTIN_BINOP_INT_FP (ADD, add, "add") 80760c2415SmrgDEF_BUILTIN_BINOP_INT_FP (SUB, sub, "sub") 81760c2415Smrg 82760c2415SmrgDEF_BUILTIN_BINOP_INT_FP (AND, and, "and") 83760c2415SmrgDEF_BUILTIN_BINOP_INT_FP (IOR, ior, "or") 84760c2415SmrgDEF_BUILTIN_BINOP_INT_FP (XOR, xor, "xor") 85760c2415Smrg 86760c2415Smrg/* OpenMP. */ 87760c2415Smrg 88760c2415SmrgDEF_BUILTIN (OMP_DIM_SIZE, CODE_FOR_oacc_dim_size, 89760c2415Smrg "dim_size", B_INSN, 90760c2415Smrg _A2 (GCN_BTI_INT, GCN_BTI_INT), 91760c2415Smrg gcn_expand_builtin_1) 92760c2415SmrgDEF_BUILTIN (OMP_DIM_POS, CODE_FOR_oacc_dim_pos, 93760c2415Smrg "dim_pos", B_INSN, 94760c2415Smrg _A2 (GCN_BTI_INT, GCN_BTI_INT), 95760c2415Smrg gcn_expand_builtin_1) 96760c2415Smrg 97760c2415Smrg/* OpenACC. */ 98760c2415Smrg 99760c2415SmrgDEF_BUILTIN (ACC_SINGLE_START, -1, "single_start", B_INSN, _A1 (GCN_BTI_BOOL), 100760c2415Smrg gcn_expand_builtin_1) 101760c2415Smrg 102760c2415SmrgDEF_BUILTIN (ACC_SINGLE_COPY_START, -1, "single_copy_start", B_INSN, 103760c2415Smrg _A1 (GCN_BTI_LDS_VOIDPTR), gcn_expand_builtin_1) 104760c2415Smrg 105760c2415SmrgDEF_BUILTIN (ACC_SINGLE_COPY_END, -1, "single_copy_end", B_INSN, 106760c2415Smrg _A2 (GCN_BTI_VOID, GCN_BTI_LDS_VOIDPTR), gcn_expand_builtin_1) 107760c2415Smrg 108760c2415SmrgDEF_BUILTIN (ACC_BARRIER, -1, "acc_barrier", B_INSN, _A1 (GCN_BTI_VOID), 109760c2415Smrg gcn_expand_builtin_1) 110760c2415Smrg 111760c2415Smrg 112760c2415Smrg#undef _A1 113760c2415Smrg#undef _A2 114760c2415Smrg#undef _A3 115760c2415Smrg#undef _A4 116760c2415Smrg#undef _A5 117