annotate gcc/brig-builtins.def @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
kono
parents:
diff changeset
1 /* This file contains the definitions and documentation for the
kono
parents:
diff changeset
2 HSAIL builtins used in the GNU compiler.
kono
parents:
diff changeset
3 Copyright (C) 2016-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 Contributed by Pekka Jaaskelainen <pekka.jaaskelainen@parmance.com>
kono
parents:
diff changeset
6 for General Processor Tech.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 This file is part of GCC.
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
11 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
12 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
13 version.
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
18 for more details.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
21 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
22 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 /* Following builtins are used by the BRIG (the binary representation of
kono
parents:
diff changeset
25 HSAIL) frontend. Software implementations are available in libhsail-rt.
kono
parents:
diff changeset
26 Use leading double underscore in the name to avoid name space clashes
kono
parents:
diff changeset
27 with kernel program symbols in case the builtin is implemented as
kono
parents:
diff changeset
28 a function call. */
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* Work-item ID related builtins are not constant in the work-group function
kono
parents:
diff changeset
31 mode (each WI has a different return value). */
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 #ifndef DEF_HSAIL_BUILTIN
kono
parents:
diff changeset
34 #define DEF_HSAIL_BUILTIN(ENUM, HSAIL_OPCODE, HSAIL_TYPE, \
kono
parents:
diff changeset
35 NAME, TYPE, ATTRS)
kono
parents:
diff changeset
36 #endif
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKITEMABSID, BRIG_OPCODE_WORKITEMABSID,
kono
parents:
diff changeset
39 BRIG_TYPE_U32, "__hsail_workitemabsid", BT_FN_UINT_UINT_PTR,
kono
parents:
diff changeset
40 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_GRIDSIZE, BRIG_OPCODE_GRIDSIZE,
kono
parents:
diff changeset
43 BRIG_TYPE_U32, "__hsail_gridsize", BT_FN_UINT_UINT_PTR,
kono
parents:
diff changeset
44 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKITEMFLATABSID_U32,
kono
parents:
diff changeset
47 BRIG_OPCODE_WORKITEMFLATABSID, BRIG_TYPE_U32,
kono
parents:
diff changeset
48 "__hsail_workitemflatabsid_u32", BT_FN_UINT_PTR,
kono
parents:
diff changeset
49 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKITEMFLATABSID_U64,
kono
parents:
diff changeset
52 BRIG_OPCODE_WORKITEMFLATABSID, BRIG_TYPE_U64,
kono
parents:
diff changeset
53 "__hsail_workitemflatabsid_u64", BT_FN_ULONG_PTR,
kono
parents:
diff changeset
54 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKITEMFLATID, BRIG_OPCODE_WORKITEMFLATID,
kono
parents:
diff changeset
57 BRIG_TYPE_U32, "__hsail_workitemflatid", BT_FN_UINT_PTR,
kono
parents:
diff changeset
58 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKITEMID, BRIG_OPCODE_WORKITEMID,
kono
parents:
diff changeset
61 BRIG_TYPE_U32, "__hsail_workitemid", BT_FN_UINT_UINT_PTR,
kono
parents:
diff changeset
62 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKGROUPID, BRIG_OPCODE_WORKGROUPID,
kono
parents:
diff changeset
65 BRIG_TYPE_U32, "__hsail_workgroupid", BT_FN_UINT_UINT_PTR,
kono
parents:
diff changeset
66 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CURRENTWORKITEMFLATID,
kono
parents:
diff changeset
69 BRIG_OPCODE_CURRENTWORKITEMFLATID,
kono
parents:
diff changeset
70 BRIG_TYPE_U32, "__hsail_currentworkitemflatid",
kono
parents:
diff changeset
71 BT_FN_UINT_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKITEMABSID_U64, BRIG_OPCODE_WORKITEMABSID,
kono
parents:
diff changeset
74 BRIG_TYPE_U64, "__hsail_workitemabsid_u64",
kono
parents:
diff changeset
75 BT_FN_ULONG_UINT_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_PACKETID, BRIG_OPCODE_PACKETID,
kono
parents:
diff changeset
78 BRIG_TYPE_U64, "__hsail_packetid", BT_FN_ULONG_PTR,
kono
parents:
diff changeset
79 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_PACKETCOMPLETIONSIG_SIG64,
kono
parents:
diff changeset
82 BRIG_OPCODE_PACKETCOMPLETIONSIG, BRIG_TYPE_SIG64,
kono
parents:
diff changeset
83 "__hsail_packetcompletionsig_sig64", BT_FN_ULONG_PTR,
kono
parents:
diff changeset
84 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_PACKETCOMPLETIONSIG_SIG32,
kono
parents:
diff changeset
87 BRIG_OPCODE_PACKETCOMPLETIONSIG, BRIG_TYPE_SIG32,
kono
parents:
diff changeset
88 "__hsail_packetcompletionsig_sig32", BT_FN_UINT_PTR,
kono
parents:
diff changeset
89 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CURRENTWORKGROUPSIZE,
kono
parents:
diff changeset
92 BRIG_OPCODE_CURRENTWORKGROUPSIZE, BRIG_TYPE_U32,
kono
parents:
diff changeset
93 "__hsail_currentworkgroupsize", BT_FN_UINT_UINT_PTR,
kono
parents:
diff changeset
94 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WORKGROUPSIZE, BRIG_OPCODE_WORKGROUPSIZE,
kono
parents:
diff changeset
97 BRIG_TYPE_U32, "__hsail_workgroupsize", BT_FN_UINT_UINT_PTR,
kono
parents:
diff changeset
98 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_DIM, BRIG_OPCODE_DIM,
kono
parents:
diff changeset
101 BRIG_TYPE_U32, "__hsail_dim", BT_FN_UINT_PTR,
kono
parents:
diff changeset
102 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_GRIDGROUPS, BRIG_OPCODE_GRIDGROUPS,
kono
parents:
diff changeset
105 BRIG_TYPE_U32, "__hsail_gridgroups", BT_FN_UINT_UINT_PTR,
kono
parents:
diff changeset
106 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITEXTRACT_S32, BRIG_OPCODE_BITEXTRACT,
kono
parents:
diff changeset
109 BRIG_TYPE_S32, "__hsail_bitextract_s32",
kono
parents:
diff changeset
110 BT_FN_INT_INT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITEXTRACT_U32, BRIG_OPCODE_BITEXTRACT,
kono
parents:
diff changeset
113 BRIG_TYPE_U32, "__hsail_bitextract_u32",
kono
parents:
diff changeset
114 BT_FN_UINT_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITEXTRACT_S64, BRIG_OPCODE_BITEXTRACT,
kono
parents:
diff changeset
117 BRIG_TYPE_S64, "__hsail_bitextract_s64",
kono
parents:
diff changeset
118 BT_FN_LONG_LONG_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITEXTRACT_U64, BRIG_OPCODE_BITEXTRACT,
kono
parents:
diff changeset
121 BRIG_TYPE_U64, "__hsail_bitextract_u64",
kono
parents:
diff changeset
122 BT_FN_ULONG_ULONG_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITINSERT_U32, BRIG_OPCODE_BITINSERT,
kono
parents:
diff changeset
125 BRIG_TYPE_U32, "__hsail_bitinsert_u32",
kono
parents:
diff changeset
126 BT_FN_UINT_UINT_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITINSERT_U64, BRIG_OPCODE_BITINSERT,
kono
parents:
diff changeset
129 BRIG_TYPE_U64, "__hsail_bitinsert_u64",
kono
parents:
diff changeset
130 BT_FN_ULONG_ULONG_ULONG_UINT_UINT,
kono
parents:
diff changeset
131 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITMASK_B32, BRIG_OPCODE_BITMASK,
kono
parents:
diff changeset
134 BRIG_TYPE_B32, "__hsail_bitmask_u32", BT_FN_UINT_UINT_UINT,
kono
parents:
diff changeset
135 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITMASK_B64, BRIG_OPCODE_BITMASK,
kono
parents:
diff changeset
138 BRIG_TYPE_B64, "__hsail_bitmask_u64", BT_FN_ULONG_UINT_UINT,
kono
parents:
diff changeset
139 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
140
kono
parents:
diff changeset
141 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITREV_B32, BRIG_OPCODE_BITREV,
kono
parents:
diff changeset
142 BRIG_TYPE_B32, "__hsail_bitrev_u32", BT_FN_UINT_UINT,
kono
parents:
diff changeset
143 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITREV_B64, BRIG_OPCODE_BITREV,
kono
parents:
diff changeset
146 BRIG_TYPE_B64, "__hsail_bitrev_u64", BT_FN_ULONG_ULONG,
kono
parents:
diff changeset
147 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITSELECT_B32, BRIG_OPCODE_BITSELECT,
kono
parents:
diff changeset
150 BRIG_TYPE_B32, "__hsail_bitselect_u32",
kono
parents:
diff changeset
151 BT_FN_UINT_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITSELECT_U64, BRIG_OPCODE_BITSELECT,
kono
parents:
diff changeset
154 BRIG_TYPE_B64, "__hsail_bitselect_u64",
kono
parents:
diff changeset
155 BT_FN_ULONG_ULONG_ULONG_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_FIRSTBIT_U32, BRIG_OPCODE_FIRSTBIT,
kono
parents:
diff changeset
158 BRIG_TYPE_U32, "__hsail_firstbit_u32", BT_FN_UINT_UINT,
kono
parents:
diff changeset
159 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_FIRSTBIT_S32, BRIG_OPCODE_FIRSTBIT,
kono
parents:
diff changeset
162 BRIG_TYPE_S32, "__hsail_firstbit_s32", BT_FN_UINT_INT,
kono
parents:
diff changeset
163 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
164
kono
parents:
diff changeset
165 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_FIRSTBIT_U64, BRIG_OPCODE_FIRSTBIT,
kono
parents:
diff changeset
166 BRIG_TYPE_U64, "__hsail_firstbit_u64", BT_FN_UINT_ULONG,
kono
parents:
diff changeset
167 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
168
kono
parents:
diff changeset
169 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_FIRSTBIT_S64, BRIG_OPCODE_FIRSTBIT,
kono
parents:
diff changeset
170 BRIG_TYPE_S64, "__hsail_firstbit_s64", BT_FN_UINT_LONG,
kono
parents:
diff changeset
171 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
172
kono
parents:
diff changeset
173 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_LASTBIT_U32, BRIG_OPCODE_LASTBIT,
kono
parents:
diff changeset
174 BRIG_TYPE_U32, "__hsail_lastbit_u32", BT_FN_UINT_UINT,
kono
parents:
diff changeset
175 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
176
kono
parents:
diff changeset
177 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_LASTBIT_U64, BRIG_OPCODE_LASTBIT,
kono
parents:
diff changeset
178 BRIG_TYPE_U64, "__hsail_lastbit_u64", BT_FN_UINT_ULONG,
kono
parents:
diff changeset
179 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
180
kono
parents:
diff changeset
181 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BORROW_U32, BRIG_OPCODE_BORROW,
kono
parents:
diff changeset
182 BRIG_TYPE_U32, "__hsail_borrow_u32", BT_FN_UINT_UINT_UINT,
kono
parents:
diff changeset
183 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
184
kono
parents:
diff changeset
185 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BORROW_U64, BRIG_OPCODE_BORROW,
kono
parents:
diff changeset
186 BRIG_TYPE_U64, "__hsail_borrow_u64", BT_FN_ULONG_ULONG_ULONG,
kono
parents:
diff changeset
187 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
188
kono
parents:
diff changeset
189 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CARRY_U32, BRIG_OPCODE_CARRY,
kono
parents:
diff changeset
190 BRIG_TYPE_U32, "__hsail_carry_u32", BT_FN_UINT_UINT_UINT,
kono
parents:
diff changeset
191 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CARRY_U64, BRIG_OPCODE_CARRY,
kono
parents:
diff changeset
194 BRIG_TYPE_U64, "__hsail_carry_u64", BT_FN_ULONG_ULONG_ULONG,
kono
parents:
diff changeset
195 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
196
kono
parents:
diff changeset
197 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_REM_S32, BRIG_OPCODE_REM,
kono
parents:
diff changeset
198 BRIG_TYPE_S32, "__hsail_rem_s32", BT_FN_INT_INT_INT,
kono
parents:
diff changeset
199 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
200
kono
parents:
diff changeset
201 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_REM_S64, BRIG_OPCODE_REM,
kono
parents:
diff changeset
202 BRIG_TYPE_S64, "__hsail_rem_s64", BT_FN_LONG_LONG_LONG,
kono
parents:
diff changeset
203 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
204
kono
parents:
diff changeset
205 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_MIN_F32, BRIG_OPCODE_MIN,
kono
parents:
diff changeset
206 BRIG_TYPE_F32, "__hsail_min_f32", BT_FN_FLOAT_FLOAT_FLOAT,
kono
parents:
diff changeset
207 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
208
kono
parents:
diff changeset
209 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_MAX_F32, BRIG_OPCODE_MAX,
kono
parents:
diff changeset
210 BRIG_TYPE_F32, "__hsail_max_f32", BT_FN_FLOAT_FLOAT_FLOAT,
kono
parents:
diff changeset
211 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
212
kono
parents:
diff changeset
213 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_MIN_F64, BRIG_OPCODE_MIN,
kono
parents:
diff changeset
214 BRIG_TYPE_F64, "__hsail_min_f64", BT_FN_DOUBLE_DOUBLE_DOUBLE,
kono
parents:
diff changeset
215 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
216
kono
parents:
diff changeset
217 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_MAX_F64, BRIG_OPCODE_MAX,
kono
parents:
diff changeset
218 BRIG_TYPE_F64, "__hsail_max_f64", BT_FN_DOUBLE_DOUBLE_DOUBLE,
kono
parents:
diff changeset
219 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CLASS_F32, BRIG_OPCODE_CLASS,
kono
parents:
diff changeset
222 BRIG_TYPE_F32, "__hsail_class_f32", BT_FN_UINT_FLOAT_UINT,
kono
parents:
diff changeset
223 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
224
kono
parents:
diff changeset
225 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CLASS_F64, BRIG_OPCODE_CLASS,
kono
parents:
diff changeset
226 BRIG_TYPE_F64, "__hsail_class_f64", BT_FN_UINT_DOUBLE_UINT,
kono
parents:
diff changeset
227 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CLASS_F32_F16, BRIG_OPCODE_CLASS,
kono
parents:
diff changeset
230 BRIG_TYPE_F16, "__hsail_class_f32_f16",
kono
parents:
diff changeset
231 BT_FN_UINT_FLOAT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
232
kono
parents:
diff changeset
233 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_FRACT_F32, BRIG_OPCODE_FRACT,
kono
parents:
diff changeset
234 BRIG_TYPE_F32, "__hsail_fract_f32", BT_FN_FLOAT_FLOAT,
kono
parents:
diff changeset
235 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
236
kono
parents:
diff changeset
237 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_FRACT_F64, BRIG_OPCODE_FRACT,
kono
parents:
diff changeset
238 BRIG_TYPE_F64, "__hsail_fract_f64", BT_FN_DOUBLE_DOUBLE,
kono
parents:
diff changeset
239 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
240
kono
parents:
diff changeset
241 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BARRIER, BRIG_OPCODE_BARRIER,
kono
parents:
diff changeset
242 BRIG_TYPE_NONE, "__hsail_barrier", BT_FN_VOID_PTR,
kono
parents:
diff changeset
243 ATTR_RT_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
244
kono
parents:
diff changeset
245 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_INITFBAR, BRIG_OPCODE_INITFBAR,
kono
parents:
diff changeset
246 BRIG_TYPE_NONE, "__hsail_initfbar", BT_FN_VOID_UINT_PTR,
kono
parents:
diff changeset
247 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_JOINFBAR, BRIG_OPCODE_JOINFBAR,
kono
parents:
diff changeset
250 BRIG_TYPE_NONE, "__hsail_joinfbar", BT_FN_VOID_UINT_PTR,
kono
parents:
diff changeset
251 ATTR_NOTHROW_LIST)
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_WAITFBAR, BRIG_OPCODE_WAITFBAR,
kono
parents:
diff changeset
254 BRIG_TYPE_NONE, "__hsail_waitfbar", BT_FN_VOID_UINT_PTR,
kono
parents:
diff changeset
255 ATTR_RT_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
256
kono
parents:
diff changeset
257 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_ARRIVEFBAR, BRIG_OPCODE_ARRIVEFBAR,
kono
parents:
diff changeset
258 BRIG_TYPE_NONE, "__hsail_arrivefbar", BT_FN_VOID_UINT_PTR,
kono
parents:
diff changeset
259 ATTR_RT_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
260
kono
parents:
diff changeset
261 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_LEAVEFBAR, BRIG_OPCODE_LEAVEFBAR,
kono
parents:
diff changeset
262 BRIG_TYPE_NONE, "__hsail_leavefbar", BT_FN_VOID_UINT_PTR,
kono
parents:
diff changeset
263 ATTR_NOTHROW_LIST)
kono
parents:
diff changeset
264
kono
parents:
diff changeset
265 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_RELEASEFBAR, BRIG_OPCODE_RELEASEFBAR,
kono
parents:
diff changeset
266 BRIG_TYPE_NONE, "__hsail_releasefbar", BT_FN_VOID_UINT_PTR,
kono
parents:
diff changeset
267 ATTR_NOTHROW_LIST)
kono
parents:
diff changeset
268
kono
parents:
diff changeset
269 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BITALIGN, BRIG_OPCODE_BITALIGN,
kono
parents:
diff changeset
270 BRIG_TYPE_B32, "__hsail_bitalign",
kono
parents:
diff changeset
271 BT_FN_UINT_ULONG_ULONG_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
272
kono
parents:
diff changeset
273 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_BYTEALIGN, BRIG_OPCODE_BYTEALIGN,
kono
parents:
diff changeset
274 BRIG_TYPE_B32, "__hsail_bytealign",
kono
parents:
diff changeset
275 BT_FN_UINT_ULONG_ULONG_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
276
kono
parents:
diff changeset
277 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_LERP, BRIG_OPCODE_LERP,
kono
parents:
diff changeset
278 BRIG_TYPE_U8X4, "__hsail_lerp", BT_FN_UINT_UINT_UINT_UINT,
kono
parents:
diff changeset
279 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
280
kono
parents:
diff changeset
281 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_PACKCVT, BRIG_OPCODE_PACKCVT,
kono
parents:
diff changeset
282 BRIG_TYPE_U8X4, "__hsail_packcvt",
kono
parents:
diff changeset
283 BT_FN_UINT_FLOAT_FLOAT_FLOAT_FLOAT,
kono
parents:
diff changeset
284 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
285
kono
parents:
diff changeset
286 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_UNPACKCVT, BRIG_OPCODE_UNPACKCVT,
kono
parents:
diff changeset
287 BRIG_TYPE_F32, "__hsail_unpackcvt", BT_FN_FLOAT_UINT_UINT,
kono
parents:
diff changeset
288 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
289
kono
parents:
diff changeset
290 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_SAD_U16X2, BRIG_OPCODE_SAD,
kono
parents:
diff changeset
291 BRIG_TYPE_U16X2, "__hsail_sad_u16x2",
kono
parents:
diff changeset
292 BT_FN_UINT_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
293
kono
parents:
diff changeset
294 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_SAD_U32, BRIG_OPCODE_SAD,
kono
parents:
diff changeset
295 BRIG_TYPE_U32, "__hsail_sad_u32", BT_FN_UINT_UINT_UINT_UINT,
kono
parents:
diff changeset
296 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
297
kono
parents:
diff changeset
298 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_SAD_U8X4, BRIG_OPCODE_SAD,
kono
parents:
diff changeset
299 BRIG_TYPE_U8X4, "__hsail_sad_u8x4",
kono
parents:
diff changeset
300 BT_FN_UINT_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
301
kono
parents:
diff changeset
302 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_SADHI_U8X4, BRIG_OPCODE_SADHI,
kono
parents:
diff changeset
303 BRIG_TYPE_U16X2, "__hsail_sadhi_u16x2_u8x4",
kono
parents:
diff changeset
304 BT_FN_UINT_UINT_UINT_UINT,
kono
parents:
diff changeset
305 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
306
kono
parents:
diff changeset
307 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CLOCK, BRIG_OPCODE_CLOCK,
kono
parents:
diff changeset
308 BRIG_TYPE_U64, "__hsail_clock", BT_FN_ULONG,
kono
parents:
diff changeset
309 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
310
kono
parents:
diff changeset
311 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CUID, BRIG_OPCODE_CUID,
kono
parents:
diff changeset
312 BRIG_TYPE_U32, "__hsail_cuid", BT_FN_UINT_PTR,
kono
parents:
diff changeset
313 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
314
kono
parents:
diff changeset
315 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_MAXCUID, BRIG_OPCODE_MAXCUID,
kono
parents:
diff changeset
316 BRIG_TYPE_U32, "__hsail_maxcuid", BT_FN_UINT_PTR,
kono
parents:
diff changeset
317 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
318
kono
parents:
diff changeset
319 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_DEBUGTRAP, BRIG_OPCODE_DEBUGTRAP,
kono
parents:
diff changeset
320 BRIG_TYPE_U32, "__hsail_debugtrap", BT_FN_VOID_UINT_PTR,
kono
parents:
diff changeset
321 ATTR_NORETURN_NOTHROW_LIST)
kono
parents:
diff changeset
322
kono
parents:
diff changeset
323 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_GROUPBASEPTR, BRIG_OPCODE_GROUPBASEPTR,
kono
parents:
diff changeset
324 BRIG_TYPE_U32, "__hsail_groupbaseptr", BT_FN_UINT_PTR,
kono
parents:
diff changeset
325 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
326
kono
parents:
diff changeset
327 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_KERNARGBASEPTR_U64,
kono
parents:
diff changeset
328 BRIG_OPCODE_KERNARGBASEPTR, BRIG_TYPE_U64,
kono
parents:
diff changeset
329 "__hsail_kernargbaseptr_u64", BT_FN_ULONG_PTR,
kono
parents:
diff changeset
330 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
331
kono
parents:
diff changeset
332 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_KERNARGBASEPTR_U32,
kono
parents:
diff changeset
333 BRIG_OPCODE_KERNARGBASEPTR, BRIG_TYPE_U32,
kono
parents:
diff changeset
334 "__hsail_kernargbaseptr_u32", BT_FN_UINT_PTR,
kono
parents:
diff changeset
335 ATTR_PURE_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
336
kono
parents:
diff changeset
337 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_ALLOCA, BRIG_OPCODE_ALLOCA,
kono
parents:
diff changeset
338 BRIG_TYPE_U32, "__hsail_alloca", BT_FN_UINT_UINT_UINT_PTR,
kono
parents:
diff changeset
339 ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
340
kono
parents:
diff changeset
341 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_LDQUEUEWRITEINDEX,
kono
parents:
diff changeset
342 BRIG_OPCODE_LDQUEUEWRITEINDEX,
kono
parents:
diff changeset
343 BRIG_TYPE_U64, "__hsail_ldqueuewriteindex",
kono
parents:
diff changeset
344 BT_FN_ULONG_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
345
kono
parents:
diff changeset
346 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_LDQUEUEREADINDEX,
kono
parents:
diff changeset
347 BRIG_OPCODE_LDQUEUEREADINDEX,
kono
parents:
diff changeset
348 BRIG_TYPE_U64, "__hsail_ldqueuereadindex",
kono
parents:
diff changeset
349 BT_FN_ULONG_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
350
kono
parents:
diff changeset
351 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_STQUEUEWRITEINDEX,
kono
parents:
diff changeset
352 BRIG_OPCODE_STQUEUEWRITEINDEX,
kono
parents:
diff changeset
353 BRIG_TYPE_U64, "__hsail_stqueuewriteindex",
kono
parents:
diff changeset
354 BT_FN_VOID_UINT64_UINT64, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
355
kono
parents:
diff changeset
356 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_STQUEUEREADINDEX,
kono
parents:
diff changeset
357 BRIG_OPCODE_STQUEUEREADINDEX,
kono
parents:
diff changeset
358 BRIG_TYPE_U64, "__hsail_stqueuereadindex",
kono
parents:
diff changeset
359 BT_FN_VOID_UINT64_UINT64, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
360
kono
parents:
diff changeset
361 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_ADDQUEUEWRITEINDEX,
kono
parents:
diff changeset
362 BRIG_OPCODE_ADDQUEUEWRITEINDEX,
kono
parents:
diff changeset
363 BRIG_TYPE_U64, "__hsail_addqueuewriteindex",
kono
parents:
diff changeset
364 BT_FN_ULONG_ULONG_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
365
kono
parents:
diff changeset
366 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_CASQUEUEWRITEINDEX,
kono
parents:
diff changeset
367 BRIG_OPCODE_CASQUEUEWRITEINDEX,
kono
parents:
diff changeset
368 BRIG_TYPE_U64, "__hsail_casqueuewriteindex",
kono
parents:
diff changeset
369 BT_FN_ULONG_ULONG_ULONG_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
370
kono
parents:
diff changeset
371 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_SEGMENTP_GLOBAL,
kono
parents:
diff changeset
372 BRIG_OPCODE_SEGMENTP,
kono
parents:
diff changeset
373 BRIG_TYPE_U32, "__hsail_segmentp_global",
kono
parents:
diff changeset
374 BT_FN_UINT32_UINT64_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
375
kono
parents:
diff changeset
376 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_SEGMENTP_GROUP,
kono
parents:
diff changeset
377 BRIG_OPCODE_SEGMENTP,
kono
parents:
diff changeset
378 BRIG_TYPE_U32, "__hsail_segmentp_group",
kono
parents:
diff changeset
379 BT_FN_UINT32_UINT64_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
380
kono
parents:
diff changeset
381 DEF_HSAIL_BUILTIN (BUILT_IN_HSAIL_SEGMENTP_PRIVATE,
kono
parents:
diff changeset
382 BRIG_OPCODE_SEGMENTP,
kono
parents:
diff changeset
383 BRIG_TYPE_U32, "__hsail_segmentp_private",
kono
parents:
diff changeset
384 BT_FN_UINT32_UINT64_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
385
kono
parents:
diff changeset
386 #ifndef DEF_HSAIL_ATOMIC_BUILTIN
kono
parents:
diff changeset
387 #define DEF_HSAIL_ATOMIC_BUILTIN(ENUM, ATOMIC_OPCODE, HSAIL_TYPE, \
kono
parents:
diff changeset
388 NAME, TYPE, ATTRS)
kono
parents:
diff changeset
389 #endif
kono
parents:
diff changeset
390
kono
parents:
diff changeset
391 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MIN_S32, BRIG_ATOMIC_MIN,
kono
parents:
diff changeset
392 BRIG_TYPE_S32, "__hsail_atomic_min_s32",
kono
parents:
diff changeset
393 BT_FN_INT_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
394
kono
parents:
diff changeset
395 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MIN_S64, BRIG_ATOMIC_MIN,
kono
parents:
diff changeset
396 BRIG_TYPE_S64, "__hsail_atomic_min_s64",
kono
parents:
diff changeset
397 BT_FN_LONG_PTR_LONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
398
kono
parents:
diff changeset
399 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MIN_U32, BRIG_ATOMIC_MIN,
kono
parents:
diff changeset
400 BRIG_TYPE_U32, "__hsail_atomic_min_u32",
kono
parents:
diff changeset
401 BT_FN_UINT_PTR_UINT, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
402
kono
parents:
diff changeset
403 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MIN_U64, BRIG_ATOMIC_MIN,
kono
parents:
diff changeset
404 BRIG_TYPE_U64, "__hsail_atomic_min_u64",
kono
parents:
diff changeset
405 BT_FN_ULONG_PTR_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
406
kono
parents:
diff changeset
407 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MAX_S32, BRIG_ATOMIC_MAX,
kono
parents:
diff changeset
408 BRIG_TYPE_S32, "__hsail_atomic_max_s32",
kono
parents:
diff changeset
409 BT_FN_INT_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
410
kono
parents:
diff changeset
411 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MAX_S64, BRIG_ATOMIC_MAX,
kono
parents:
diff changeset
412 BRIG_TYPE_S64, "__hsail_atomic_max_s64",
kono
parents:
diff changeset
413 BT_FN_LONG_PTR_LONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
414
kono
parents:
diff changeset
415 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MAX_U32, BRIG_ATOMIC_MAX,
kono
parents:
diff changeset
416 BRIG_TYPE_U32, "__hsail_atomic_max_u32",
kono
parents:
diff changeset
417 BT_FN_UINT_PTR_UINT, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
418
kono
parents:
diff changeset
419 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_MAX_U64, BRIG_ATOMIC_MAX,
kono
parents:
diff changeset
420 BRIG_TYPE_U64, "__hsail_atomic_max_u64",
kono
parents:
diff changeset
421 BT_FN_ULONG_PTR_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
422
kono
parents:
diff changeset
423 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_WRAPDEC_U32,
kono
parents:
diff changeset
424 BRIG_ATOMIC_WRAPDEC, BRIG_TYPE_U32,
kono
parents:
diff changeset
425 "__hsail_atomic_wrapdec_u32",
kono
parents:
diff changeset
426 BT_FN_UINT_PTR_UINT, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
427
kono
parents:
diff changeset
428 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_WRAPDEC_U64,
kono
parents:
diff changeset
429 BRIG_ATOMIC_WRAPDEC, BRIG_TYPE_U64,
kono
parents:
diff changeset
430 "__hsail_atomic_wrapdec_u64",
kono
parents:
diff changeset
431 BT_FN_ULONG_PTR_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
432
kono
parents:
diff changeset
433 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_WRAPINC_U32,
kono
parents:
diff changeset
434 BRIG_ATOMIC_WRAPINC, BRIG_TYPE_U32,
kono
parents:
diff changeset
435 "__hsail_atomic_wrapinc_u32",
kono
parents:
diff changeset
436 BT_FN_UINT_PTR_UINT, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
437
kono
parents:
diff changeset
438 DEF_HSAIL_ATOMIC_BUILTIN (BUILT_IN_HSAIL_ATOMIC_WRAPINC_U64,
kono
parents:
diff changeset
439 BRIG_ATOMIC_WRAPINC, BRIG_TYPE_U64,
kono
parents:
diff changeset
440 "__hsail_atomic_wrapinc_u64",
kono
parents:
diff changeset
441 BT_FN_ULONG_PTR_ULONG, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
442
kono
parents:
diff changeset
443 #ifndef DEF_HSAIL_SAT_BUILTIN
kono
parents:
diff changeset
444 #define DEF_HSAIL_SAT_BUILTIN(ENUM, HSAIL_OPCODE, HSAIL_TYPE, \
kono
parents:
diff changeset
445 NAME, TYPE, ATTRS)
kono
parents:
diff changeset
446 #endif
kono
parents:
diff changeset
447
kono
parents:
diff changeset
448 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_U64, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
449 BRIG_TYPE_U64, "__hsail_sat_add_u64",
kono
parents:
diff changeset
450 BT_FN_ULONG_ULONG_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
451
kono
parents:
diff changeset
452 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_S64, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
453 BRIG_TYPE_S64, "__hsail_sat_add_s64",
kono
parents:
diff changeset
454 BT_FN_LONG_LONG_LONG, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
455
kono
parents:
diff changeset
456 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_U32, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
457 BRIG_TYPE_U32, "__hsail_sat_add_u32",
kono
parents:
diff changeset
458 BT_FN_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
459
kono
parents:
diff changeset
460 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_S32, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
461 BRIG_TYPE_S32, "__hsail_sat_add_s32",
kono
parents:
diff changeset
462 BT_FN_INT_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
463
kono
parents:
diff changeset
464 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_U16, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
465 BRIG_TYPE_U16, "__hsail_sat_add_u16",
kono
parents:
diff changeset
466 BT_FN_UINT16_UINT16_UINT16, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
467
kono
parents:
diff changeset
468 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_S16, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
469 BRIG_TYPE_S16, "__hsail_sat_add_s16",
kono
parents:
diff changeset
470 BT_FN_INT16_INT16_INT16, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
471
kono
parents:
diff changeset
472 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_U8, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
473 BRIG_TYPE_U8, "__hsail_sat_add_u8",
kono
parents:
diff changeset
474 BT_FN_UINT8_UINT8_UINT8, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
475
kono
parents:
diff changeset
476 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_ADD_S8, BRIG_OPCODE_ADD,
kono
parents:
diff changeset
477 BRIG_TYPE_S8, "__hsail_sat_add_s8",
kono
parents:
diff changeset
478 BT_FN_INT8_INT8_INT8, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
479
kono
parents:
diff changeset
480 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_U64, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
481 BRIG_TYPE_U64, "__hsail_sat_sub_u64",
kono
parents:
diff changeset
482 BT_FN_ULONG_ULONG_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
483
kono
parents:
diff changeset
484 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_S64, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
485 BRIG_TYPE_S64, "__hsail_sat_sub_s64",
kono
parents:
diff changeset
486 BT_FN_LONG_LONG_LONG, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
487
kono
parents:
diff changeset
488 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_U32, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
489 BRIG_TYPE_U32, "__hsail_sat_sub_u32",
kono
parents:
diff changeset
490 BT_FN_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
491
kono
parents:
diff changeset
492 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_S32, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
493 BRIG_TYPE_S32, "__hsail_sat_sub_s32",
kono
parents:
diff changeset
494 BT_FN_INT_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
495
kono
parents:
diff changeset
496 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_U16, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
497 BRIG_TYPE_U16, "__hsail_sat_sub_u16",
kono
parents:
diff changeset
498 BT_FN_UINT16_UINT16_UINT16, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
499
kono
parents:
diff changeset
500 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_S16, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
501 BRIG_TYPE_S16, "__hsail_sat_sub_s16",
kono
parents:
diff changeset
502 BT_FN_INT16_INT16_INT16, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
503
kono
parents:
diff changeset
504 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_U8, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
505 BRIG_TYPE_U8, "__hsail_sat_sub_u8",
kono
parents:
diff changeset
506 BT_FN_UINT8_UINT8_UINT8, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
507
kono
parents:
diff changeset
508 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_SUB_S8, BRIG_OPCODE_SUB,
kono
parents:
diff changeset
509 BRIG_TYPE_S8, "__hsail_sat_sub_s8",
kono
parents:
diff changeset
510 BT_FN_INT8_INT8_INT8, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
511
kono
parents:
diff changeset
512 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_U64, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
513 BRIG_TYPE_U64, "__hsail_sat_mul_u64",
kono
parents:
diff changeset
514 BT_FN_ULONG_ULONG_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
515
kono
parents:
diff changeset
516 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_S64, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
517 BRIG_TYPE_S64, "__hsail_sat_mul_s64",
kono
parents:
diff changeset
518 BT_FN_LONG_LONG_LONG, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
519
kono
parents:
diff changeset
520 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_U32, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
521 BRIG_TYPE_U32, "__hsail_sat_mul_u32",
kono
parents:
diff changeset
522 BT_FN_UINT_UINT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
523
kono
parents:
diff changeset
524 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_S32, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
525 BRIG_TYPE_S32, "__hsail_sat_mul_s32",
kono
parents:
diff changeset
526 BT_FN_INT_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
527
kono
parents:
diff changeset
528 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_U16, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
529 BRIG_TYPE_U16, "__hsail_sat_mul_u16",
kono
parents:
diff changeset
530 BT_FN_UINT16_UINT16_UINT16, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
531
kono
parents:
diff changeset
532 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_S16, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
533 BRIG_TYPE_S16, "__hsail_sat_mul_s16",
kono
parents:
diff changeset
534 BT_FN_INT16_INT16_INT16, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
535
kono
parents:
diff changeset
536 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_U8, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
537 BRIG_TYPE_U8, "__hsail_sat_mul_u8",
kono
parents:
diff changeset
538 BT_FN_UINT8_UINT8_UINT8, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
539
kono
parents:
diff changeset
540 DEF_HSAIL_SAT_BUILTIN (BUILT_IN_HSAIL_SAT_MUL_S8, BRIG_OPCODE_MUL,
kono
parents:
diff changeset
541 BRIG_TYPE_S8, "__hsail_sat_mul_s8",
kono
parents:
diff changeset
542 BT_FN_INT8_INT8_INT8, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
543
kono
parents:
diff changeset
544 #ifndef DEF_HSAIL_INTR_BUILTIN
kono
parents:
diff changeset
545 #define DEF_HSAIL_INTR_BUILTIN(ENUM, NAME, TYPE, ATTRS)
kono
parents:
diff changeset
546 #endif
kono
parents:
diff changeset
547
kono
parents:
diff changeset
548 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_FTZ_F32_F16, "__hsail_ftz_f32_f16",
kono
parents:
diff changeset
549 BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
550
kono
parents:
diff changeset
551 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_FTZ_F32, "__hsail_ftz_f32",
kono
parents:
diff changeset
552 BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
553
kono
parents:
diff changeset
554 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_FTZ_F64, "__hsail_ftz_f64",
kono
parents:
diff changeset
555 BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
556
kono
parents:
diff changeset
557 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_PUSH_FRAME, "__hsail_alloca_push_frame",
kono
parents:
diff changeset
558 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
559
kono
parents:
diff changeset
560 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_POP_FRAME, "__hsail_alloca_pop_frame",
kono
parents:
diff changeset
561 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
562
kono
parents:
diff changeset
563 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_SETWORKITEMID, "__hsail_setworkitemid",
kono
parents:
diff changeset
564 BT_FN_VOID_UINT32_UINT32_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
565
kono
parents:
diff changeset
566 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_LAUNCH_WG_FUNC,
kono
parents:
diff changeset
567 "__hsail_launch_wg_function",
kono
parents:
diff changeset
568 BT_FN_VOID_PTR_PTR_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
569
kono
parents:
diff changeset
570 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_LAUNCH_KERNEL,
kono
parents:
diff changeset
571 "__hsail_launch_kernel",
kono
parents:
diff changeset
572 BT_FN_VOID_PTR_PTR_PTR, ATTR_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
573
kono
parents:
diff changeset
574 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_F32_TO_F16, "__hsail_f32_to_f16",
kono
parents:
diff changeset
575 BT_FN_UINT16_UINT32, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
576
kono
parents:
diff changeset
577 DEF_HSAIL_INTR_BUILTIN (BUILT_IN_HSAIL_F16_TO_F32, "__hsail_f16_to_f32",
kono
parents:
diff changeset
578 BT_FN_UINT32_UINT16, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
579
kono
parents:
diff changeset
580 #ifndef DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN
kono
parents:
diff changeset
581 #define DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN(ENUM, HSAIL_DEST_TYPE, HSAIL_SRC_TYPE, \
kono
parents:
diff changeset
582 NAME, TYPE, ATTRS)
kono
parents:
diff changeset
583 #endif
kono
parents:
diff changeset
584
kono
parents:
diff changeset
585 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U8_F32,
kono
parents:
diff changeset
586 BRIG_TYPE_U8, BRIG_TYPE_F32,
kono
parents:
diff changeset
587 "__hsail_cvt_zeroi_sat_u8_f32",
kono
parents:
diff changeset
588 BT_FN_UINT8_FLOAT,
kono
parents:
diff changeset
589 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
590
kono
parents:
diff changeset
591 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S8_F32,
kono
parents:
diff changeset
592 BRIG_TYPE_S8, BRIG_TYPE_F32,
kono
parents:
diff changeset
593 "__hsail_cvt_zeroi_sat_s8_f32",
kono
parents:
diff changeset
594 BT_FN_INT8_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
595
kono
parents:
diff changeset
596 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U16_F32,
kono
parents:
diff changeset
597 BRIG_TYPE_U16, BRIG_TYPE_F32,
kono
parents:
diff changeset
598 "__hsail_cvt_zeroi_sat_u16_f32",
kono
parents:
diff changeset
599 BT_FN_UINT16_FLOAT,
kono
parents:
diff changeset
600 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
601
kono
parents:
diff changeset
602 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S16_F32,
kono
parents:
diff changeset
603 BRIG_TYPE_S16, BRIG_TYPE_F32,
kono
parents:
diff changeset
604 "__hsail_cvt_zeroi_sat_s16_f32",
kono
parents:
diff changeset
605 BT_FN_INT16_FLOAT,
kono
parents:
diff changeset
606 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
607
kono
parents:
diff changeset
608 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U32_F32,
kono
parents:
diff changeset
609 BRIG_TYPE_U32, BRIG_TYPE_F32,
kono
parents:
diff changeset
610 "__hsail_cvt_zeroi_sat_u32_f32",
kono
parents:
diff changeset
611 BT_FN_UINT32_FLOAT,
kono
parents:
diff changeset
612 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
613
kono
parents:
diff changeset
614 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S32_F32,
kono
parents:
diff changeset
615 BRIG_TYPE_S32, BRIG_TYPE_F32,
kono
parents:
diff changeset
616 "__hsail_cvt_zeroi_sat_s32_f32",
kono
parents:
diff changeset
617 BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
618
kono
parents:
diff changeset
619 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U64_F32,
kono
parents:
diff changeset
620 BRIG_TYPE_U64, BRIG_TYPE_F32,
kono
parents:
diff changeset
621 "__hsail_cvt_zeroi_sat_u64_f32",
kono
parents:
diff changeset
622 BT_FN_UINT64_FLOAT,
kono
parents:
diff changeset
623 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
624
kono
parents:
diff changeset
625 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S64_F32,
kono
parents:
diff changeset
626 BRIG_TYPE_S64, BRIG_TYPE_F32,
kono
parents:
diff changeset
627 "__hsail_cvt_zeroi_sat_s64_f32",
kono
parents:
diff changeset
628 BT_FN_LONG_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
629
kono
parents:
diff changeset
630 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U8_F64,
kono
parents:
diff changeset
631 BRIG_TYPE_U8, BRIG_TYPE_F64,
kono
parents:
diff changeset
632 "__hsail_cvt_zeroi_sat_u8_f64",
kono
parents:
diff changeset
633 BT_FN_UINT8_FLOAT,
kono
parents:
diff changeset
634 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
635
kono
parents:
diff changeset
636 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S8_F64,
kono
parents:
diff changeset
637 BRIG_TYPE_S8, BRIG_TYPE_F64,
kono
parents:
diff changeset
638 "__hsail_cvt_zeroi_sat_s8_f64",
kono
parents:
diff changeset
639 BT_FN_INT8_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
640
kono
parents:
diff changeset
641 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U16_F64,
kono
parents:
diff changeset
642 BRIG_TYPE_U16, BRIG_TYPE_F64,
kono
parents:
diff changeset
643 "__hsail_cvt_zeroi_sat_u16_f64",
kono
parents:
diff changeset
644 BT_FN_UINT16_FLOAT,
kono
parents:
diff changeset
645 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
646
kono
parents:
diff changeset
647 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S16_F64,
kono
parents:
diff changeset
648 BRIG_TYPE_S16, BRIG_TYPE_F64,
kono
parents:
diff changeset
649 "__hsail_cvt_zeroi_sat_s16_f64",
kono
parents:
diff changeset
650 BT_FN_INT16_FLOAT,
kono
parents:
diff changeset
651 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
652
kono
parents:
diff changeset
653 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U32_F64,
kono
parents:
diff changeset
654 BRIG_TYPE_U32, BRIG_TYPE_F64,
kono
parents:
diff changeset
655 "__hsail_cvt_zeroi_sat_u32_f64",
kono
parents:
diff changeset
656 BT_FN_UINT32_FLOAT,
kono
parents:
diff changeset
657 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
658
kono
parents:
diff changeset
659 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S32_F64,
kono
parents:
diff changeset
660 BRIG_TYPE_S32, BRIG_TYPE_F64,
kono
parents:
diff changeset
661 "__hsail_cvt_zeroi_sat_s32_f64",
kono
parents:
diff changeset
662 BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
663
kono
parents:
diff changeset
664 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_U64_F64,
kono
parents:
diff changeset
665 BRIG_TYPE_U64, BRIG_TYPE_F64,
kono
parents:
diff changeset
666 "__hsail_cvt_zeroi_sat_u64_f64",
kono
parents:
diff changeset
667 BT_FN_UINT64_FLOAT,
kono
parents:
diff changeset
668 ATTR_CONST_NOTHROW_LEAF_LIST)
kono
parents:
diff changeset
669
kono
parents:
diff changeset
670 DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN (BUILT_IN_HSAIL_CVT_ZEROI_SAT_S64_F64,
kono
parents:
diff changeset
671 BRIG_TYPE_S64, BRIG_TYPE_F64,
kono
parents:
diff changeset
672 "__hsail_cvt_zeroi_sat_s64_f64",
kono
parents:
diff changeset
673 BT_FN_LONG_FLOAT,
kono
parents:
diff changeset
674 ATTR_CONST_NOTHROW_LEAF_LIST)