brig-builtins.def 26 KB

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