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