BuiltinsPPC.def 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. //===--- BuiltinsPPC.def - PowerPC Builtin function database ----*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines the PowerPC-specific builtin function database. Users of
  10. // this file must define the BUILTIN macro or the CUSTOM_BUILTIN macro to
  11. // make use of this information. The latter is used for builtins requiring
  12. // custom code generation and checking.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. // FIXME: this needs to be the full list supported by GCC. Right now, I'm just
  16. // adding stuff on demand.
  17. // The format of this database matches clang/Basic/Builtins.def except for the
  18. // MMA builtins that are using their own format documented below.
  19. #if defined(BUILTIN) && !defined(CUSTOM_BUILTIN)
  20. # define CUSTOM_BUILTIN(ID, INTR, TYPES, ACCUMULATE) \
  21. BUILTIN(__builtin_##ID, "i.", "t")
  22. #elif defined(CUSTOM_BUILTIN) && !defined(BUILTIN)
  23. # define BUILTIN(ID, TYPES, ATTRS)
  24. #endif
  25. #define UNALIASED_CUSTOM_BUILTIN(ID, TYPES, ACCUMULATE) \
  26. CUSTOM_BUILTIN(ID, ID, TYPES, ACCUMULATE)
  27. // XL Compatibility built-ins
  28. BUILTIN(__builtin_ppc_popcntb, "ULiULi", "")
  29. BUILTIN(__builtin_ppc_poppar4, "iUi", "")
  30. BUILTIN(__builtin_ppc_poppar8, "iULLi", "")
  31. BUILTIN(__builtin_ppc_eieio, "v", "")
  32. BUILTIN(__builtin_ppc_iospace_eieio, "v", "")
  33. BUILTIN(__builtin_ppc_isync, "v", "")
  34. BUILTIN(__builtin_ppc_lwsync, "v", "")
  35. BUILTIN(__builtin_ppc_iospace_lwsync, "v", "")
  36. BUILTIN(__builtin_ppc_sync, "v", "")
  37. BUILTIN(__builtin_ppc_iospace_sync, "v", "")
  38. BUILTIN(__builtin_ppc_dcbfl, "vvC*", "")
  39. BUILTIN(__builtin_ppc_dcbflp, "vvC*", "")
  40. BUILTIN(__builtin_ppc_dcbst, "vvC*", "")
  41. BUILTIN(__builtin_ppc_dcbt, "vv*", "")
  42. BUILTIN(__builtin_ppc_dcbtst, "vv*", "")
  43. BUILTIN(__builtin_ppc_dcbz, "vv*", "")
  44. BUILTIN(__builtin_ppc_icbt, "vv*", "")
  45. BUILTIN(__builtin_ppc_fric, "dd", "")
  46. BUILTIN(__builtin_ppc_frim, "dd", "")
  47. BUILTIN(__builtin_ppc_frims, "ff", "")
  48. BUILTIN(__builtin_ppc_frin, "dd", "")
  49. BUILTIN(__builtin_ppc_frins, "ff", "")
  50. BUILTIN(__builtin_ppc_frip, "dd", "")
  51. BUILTIN(__builtin_ppc_frips, "ff", "")
  52. BUILTIN(__builtin_ppc_friz, "dd", "")
  53. BUILTIN(__builtin_ppc_frizs, "ff", "")
  54. BUILTIN(__builtin_ppc_fsel, "dddd", "")
  55. BUILTIN(__builtin_ppc_fsels, "ffff", "")
  56. BUILTIN(__builtin_ppc_frsqrte, "dd", "")
  57. BUILTIN(__builtin_ppc_frsqrtes, "ff", "")
  58. BUILTIN(__builtin_ppc_fsqrt, "dd", "")
  59. BUILTIN(__builtin_ppc_fsqrts, "ff", "")
  60. BUILTIN(__builtin_ppc_compare_and_swap, "iiD*i*i", "")
  61. BUILTIN(__builtin_ppc_compare_and_swaplp, "iLiD*Li*Li", "")
  62. BUILTIN(__builtin_ppc_fetch_and_add, "iiD*i", "")
  63. BUILTIN(__builtin_ppc_fetch_and_addlp, "LiLiD*Li", "")
  64. BUILTIN(__builtin_ppc_fetch_and_and, "UiUiD*Ui", "")
  65. BUILTIN(__builtin_ppc_fetch_and_andlp, "ULiULiD*ULi", "")
  66. BUILTIN(__builtin_ppc_fetch_and_or, "UiUiD*Ui", "")
  67. BUILTIN(__builtin_ppc_fetch_and_orlp, "ULiULiD*ULi", "")
  68. BUILTIN(__builtin_ppc_fetch_and_swap, "UiUiD*Ui", "")
  69. BUILTIN(__builtin_ppc_fetch_and_swaplp, "ULiULiD*ULi", "")
  70. BUILTIN(__builtin_ppc_ldarx, "LiLiD*", "")
  71. BUILTIN(__builtin_ppc_lwarx, "iiD*", "")
  72. BUILTIN(__builtin_ppc_lharx, "ssD*", "")
  73. BUILTIN(__builtin_ppc_lbarx, "ccD*", "")
  74. BUILTIN(__builtin_ppc_stdcx, "iLiD*Li", "")
  75. BUILTIN(__builtin_ppc_stwcx, "iiD*i", "")
  76. BUILTIN(__builtin_ppc_sthcx, "isD*s", "")
  77. BUILTIN(__builtin_ppc_stbcx, "icD*i", "")
  78. BUILTIN(__builtin_ppc_tdw, "vLLiLLiIUi", "")
  79. BUILTIN(__builtin_ppc_tw, "viiIUi", "")
  80. BUILTIN(__builtin_ppc_trap, "vi", "")
  81. BUILTIN(__builtin_ppc_trapd, "vLi", "")
  82. BUILTIN(__builtin_ppc_fcfid, "dd", "")
  83. BUILTIN(__builtin_ppc_fcfud, "dd", "")
  84. BUILTIN(__builtin_ppc_fctid, "dd", "")
  85. BUILTIN(__builtin_ppc_fctidz, "dd", "")
  86. BUILTIN(__builtin_ppc_fctiw, "dd", "")
  87. BUILTIN(__builtin_ppc_fctiwz, "dd", "")
  88. BUILTIN(__builtin_ppc_fctudz, "dd", "")
  89. BUILTIN(__builtin_ppc_fctuwz, "dd", "")
  90. BUILTIN(__builtin_ppc_swdiv_nochk, "ddd", "")
  91. BUILTIN(__builtin_ppc_swdivs_nochk, "fff", "")
  92. BUILTIN(__builtin_ppc_alignx, "vIivC*", "nc")
  93. BUILTIN(__builtin_ppc_rdlam, "UWiUWiUWiUWIi", "nc")
  94. BUILTIN(__builtin_ppc_compare_exp_uo, "idd", "")
  95. BUILTIN(__builtin_ppc_compare_exp_lt, "idd", "")
  96. BUILTIN(__builtin_ppc_compare_exp_gt, "idd", "")
  97. BUILTIN(__builtin_ppc_compare_exp_eq, "idd", "")
  98. BUILTIN(__builtin_ppc_test_data_class, "idIi", "t")
  99. BUILTIN(__builtin_ppc_swdiv, "ddd", "")
  100. BUILTIN(__builtin_ppc_swdivs, "fff", "")
  101. // Compare
  102. BUILTIN(__builtin_ppc_cmpeqb, "LLiLLiLLi", "")
  103. BUILTIN(__builtin_ppc_cmprb, "iCIiii", "")
  104. BUILTIN(__builtin_ppc_setb, "LLiLLiLLi", "")
  105. BUILTIN(__builtin_ppc_cmpb, "LLiLLiLLi", "")
  106. // Multiply
  107. BUILTIN(__builtin_ppc_mulhd, "LLiLiLi", "")
  108. BUILTIN(__builtin_ppc_mulhdu, "ULLiULiULi", "")
  109. BUILTIN(__builtin_ppc_mulhw, "iii", "")
  110. BUILTIN(__builtin_ppc_mulhwu, "UiUiUi", "")
  111. BUILTIN(__builtin_ppc_maddhd, "LLiLLiLLiLLi", "")
  112. BUILTIN(__builtin_ppc_maddhdu, "ULLiULLiULLiULLi", "")
  113. BUILTIN(__builtin_ppc_maddld, "LLiLLiLLiLLi", "")
  114. // Rotate
  115. BUILTIN(__builtin_ppc_rlwnm, "UiUiUiIUi", "")
  116. BUILTIN(__builtin_ppc_rlwimi, "UiUiUiIUiIUi", "")
  117. BUILTIN(__builtin_ppc_rldimi, "ULLiULLiULLiIUiIULLi", "")
  118. // load
  119. BUILTIN(__builtin_ppc_load2r, "UsUs*", "")
  120. BUILTIN(__builtin_ppc_load4r, "UiUi*", "")
  121. BUILTIN(__builtin_ppc_load8r, "ULLiULLi*", "")
  122. // store
  123. BUILTIN(__builtin_ppc_store2r, "vUiUs*", "")
  124. BUILTIN(__builtin_ppc_store4r, "vUiUi*", "")
  125. BUILTIN(__builtin_ppc_store8r, "vULLiULLi*", "")
  126. BUILTIN(__builtin_ppc_extract_exp, "Uid", "")
  127. BUILTIN(__builtin_ppc_extract_sig, "ULLid", "")
  128. BUILTIN(__builtin_ppc_mtfsb0, "vUIi", "")
  129. BUILTIN(__builtin_ppc_mtfsb1, "vUIi", "")
  130. BUILTIN(__builtin_ppc_mtfsf, "vUIiUi", "")
  131. BUILTIN(__builtin_ppc_mtfsfi, "vUIiUIi", "")
  132. BUILTIN(__builtin_ppc_insert_exp, "ddULLi", "")
  133. BUILTIN(__builtin_ppc_fmsub, "dddd", "")
  134. BUILTIN(__builtin_ppc_fmsubs, "ffff", "")
  135. BUILTIN(__builtin_ppc_fnmadd, "dddd", "")
  136. BUILTIN(__builtin_ppc_fnmadds, "ffff", "")
  137. BUILTIN(__builtin_ppc_fnmsub, "dddd", "")
  138. BUILTIN(__builtin_ppc_fnmsubs, "ffff", "")
  139. BUILTIN(__builtin_ppc_fre, "dd", "")
  140. BUILTIN(__builtin_ppc_fres, "ff", "")
  141. BUILTIN(__builtin_ppc_dcbtstt, "vv*", "")
  142. BUILTIN(__builtin_ppc_dcbtt, "vv*", "")
  143. BUILTIN(__builtin_ppc_mftbu, "Ui","")
  144. BUILTIN(__builtin_ppc_mfmsr, "Ui", "")
  145. BUILTIN(__builtin_ppc_mfspr, "ULiIi", "")
  146. BUILTIN(__builtin_ppc_mtmsr, "vUi", "")
  147. BUILTIN(__builtin_ppc_mtspr, "vIiULi", "")
  148. BUILTIN(__builtin_ppc_stfiw, "viC*d", "")
  149. BUILTIN(__builtin_ppc_addex, "LLiLLiLLiCIi", "")
  150. BUILTIN(__builtin_ppc_get_timebase, "ULLi", "n")
  151. // This is just a placeholder, the types and attributes are wrong.
  152. BUILTIN(__builtin_altivec_vaddcuw, "V4UiV4UiV4Ui", "")
  153. BUILTIN(__builtin_altivec_vaddsbs, "V16ScV16ScV16Sc", "")
  154. BUILTIN(__builtin_altivec_vaddubs, "V16UcV16UcV16Uc", "")
  155. BUILTIN(__builtin_altivec_vaddshs, "V8SsV8SsV8Ss", "")
  156. BUILTIN(__builtin_altivec_vadduhs, "V8UsV8UsV8Us", "")
  157. BUILTIN(__builtin_altivec_vaddsws, "V4SiV4SiV4Si", "")
  158. BUILTIN(__builtin_altivec_vadduws, "V4UiV4UiV4Ui", "")
  159. BUILTIN(__builtin_altivec_vaddeuqm, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","")
  160. BUILTIN(__builtin_altivec_vaddcuq, "V1ULLLiV1ULLLiV1ULLLi","")
  161. BUILTIN(__builtin_altivec_vaddecuq, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","")
  162. BUILTIN(__builtin_altivec_vadduqm, "V1ULLLiV16UcV16Uc","")
  163. BUILTIN(__builtin_altivec_vsubsbs, "V16ScV16ScV16Sc", "")
  164. BUILTIN(__builtin_altivec_vsububs, "V16UcV16UcV16Uc", "")
  165. BUILTIN(__builtin_altivec_vsubshs, "V8SsV8SsV8Ss", "")
  166. BUILTIN(__builtin_altivec_vsubuhs, "V8UsV8UsV8Us", "")
  167. BUILTIN(__builtin_altivec_vsubsws, "V4SiV4SiV4Si", "")
  168. BUILTIN(__builtin_altivec_vsubuws, "V4UiV4UiV4Ui", "")
  169. BUILTIN(__builtin_altivec_vsubeuqm, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","")
  170. BUILTIN(__builtin_altivec_vsubcuq, "V1ULLLiV1ULLLiV1ULLLi","")
  171. BUILTIN(__builtin_altivec_vsubecuq, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","")
  172. BUILTIN(__builtin_altivec_vsubuqm, "V1ULLLiV16UcV16Uc","")
  173. BUILTIN(__builtin_altivec_vavgsb, "V16ScV16ScV16Sc", "")
  174. BUILTIN(__builtin_altivec_vavgub, "V16UcV16UcV16Uc", "")
  175. BUILTIN(__builtin_altivec_vavgsh, "V8SsV8SsV8Ss", "")
  176. BUILTIN(__builtin_altivec_vavguh, "V8UsV8UsV8Us", "")
  177. BUILTIN(__builtin_altivec_vavgsw, "V4SiV4SiV4Si", "")
  178. BUILTIN(__builtin_altivec_vavguw, "V4UiV4UiV4Ui", "")
  179. BUILTIN(__builtin_altivec_vrfip, "V4fV4f", "")
  180. BUILTIN(__builtin_altivec_vcfsx, "V4fV4SiIi", "")
  181. BUILTIN(__builtin_altivec_vcfux, "V4fV4UiIi", "")
  182. BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "")
  183. BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
  184. BUILTIN(__builtin_altivec_dss, "vUIi", "")
  185. BUILTIN(__builtin_altivec_dssall, "v", "")
  186. BUILTIN(__builtin_altivec_dst, "vvC*iUIi", "")
  187. BUILTIN(__builtin_altivec_dstt, "vvC*iUIi", "")
  188. BUILTIN(__builtin_altivec_dstst, "vvC*iUIi", "")
  189. BUILTIN(__builtin_altivec_dststt, "vvC*iUIi", "")
  190. BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "")
  191. BUILTIN(__builtin_altivec_vrfim, "V4fV4f", "")
  192. BUILTIN(__builtin_altivec_lvx, "V4iLivC*", "")
  193. BUILTIN(__builtin_altivec_lvxl, "V4iLivC*", "")
  194. BUILTIN(__builtin_altivec_lvebx, "V16cLivC*", "")
  195. BUILTIN(__builtin_altivec_lvehx, "V8sLivC*", "")
  196. BUILTIN(__builtin_altivec_lvewx, "V4iLivC*", "")
  197. BUILTIN(__builtin_altivec_vlogefp, "V4fV4f", "")
  198. BUILTIN(__builtin_altivec_lvsl, "V16cUcvC*", "")
  199. BUILTIN(__builtin_altivec_lvsr, "V16cUcvC*", "")
  200. BUILTIN(__builtin_altivec_vmaddfp, "V4fV4fV4fV4f", "")
  201. BUILTIN(__builtin_altivec_vmhaddshs, "V8sV8sV8sV8s", "")
  202. BUILTIN(__builtin_altivec_vmhraddshs, "V8sV8sV8sV8s", "")
  203. BUILTIN(__builtin_altivec_vmsumubm, "V4UiV16UcV16UcV4Ui", "")
  204. BUILTIN(__builtin_altivec_vmsummbm, "V4SiV16ScV16UcV4Si", "")
  205. BUILTIN(__builtin_altivec_vmsumuhm, "V4UiV8UsV8UsV4Ui", "")
  206. BUILTIN(__builtin_altivec_vmsumshm, "V4SiV8SsV8SsV4Si", "")
  207. BUILTIN(__builtin_altivec_vmsumuhs, "V4UiV8UsV8UsV4Ui", "")
  208. BUILTIN(__builtin_altivec_vmsumshs, "V4SiV8SsV8SsV4Si", "")
  209. BUILTIN(__builtin_altivec_vmuleub, "V8UsV16UcV16Uc", "")
  210. BUILTIN(__builtin_altivec_vmulesb, "V8SsV16ScV16Sc", "")
  211. BUILTIN(__builtin_altivec_vmuleuh, "V4UiV8UsV8Us", "")
  212. BUILTIN(__builtin_altivec_vmulesh, "V4SiV8SsV8Ss", "")
  213. BUILTIN(__builtin_altivec_vmuleuw, "V2ULLiV4UiV4Ui", "")
  214. BUILTIN(__builtin_altivec_vmulesw, "V2SLLiV4SiV4Si", "")
  215. BUILTIN(__builtin_altivec_vmuloub, "V8UsV16UcV16Uc", "")
  216. BUILTIN(__builtin_altivec_vmulosb, "V8SsV16ScV16Sc", "")
  217. BUILTIN(__builtin_altivec_vmulouh, "V4UiV8UsV8Us", "")
  218. BUILTIN(__builtin_altivec_vmulosh, "V4SiV8SsV8Ss", "")
  219. BUILTIN(__builtin_altivec_vmulouw, "V2ULLiV4UiV4Ui", "")
  220. BUILTIN(__builtin_altivec_vmulosw, "V2SLLiV4SiV4Si", "")
  221. BUILTIN(__builtin_altivec_vmuleud, "V1ULLLiV2ULLiV2ULLi", "")
  222. BUILTIN(__builtin_altivec_vmulesd, "V1SLLLiV2SLLiV2SLLi", "")
  223. BUILTIN(__builtin_altivec_vmuloud, "V1ULLLiV2ULLiV2ULLi", "")
  224. BUILTIN(__builtin_altivec_vmulosd, "V1SLLLiV2SLLiV2SLLi", "")
  225. BUILTIN(__builtin_altivec_vmsumcud, "V1ULLLiV2ULLiV2ULLiV1ULLLi", "")
  226. BUILTIN(__builtin_altivec_vnmsubfp, "V4fV4fV4fV4f", "")
  227. BUILTIN(__builtin_altivec_vpkpx, "V8sV4UiV4Ui", "")
  228. BUILTIN(__builtin_altivec_vpkuhus, "V16UcV8UsV8Us", "")
  229. BUILTIN(__builtin_altivec_vpkshss, "V16ScV8SsV8Ss", "")
  230. BUILTIN(__builtin_altivec_vpkuwus, "V8UsV4UiV4Ui", "")
  231. BUILTIN(__builtin_altivec_vpkswss, "V8SsV4SiV4Si", "")
  232. BUILTIN(__builtin_altivec_vpkshus, "V16UcV8SsV8Ss", "")
  233. BUILTIN(__builtin_altivec_vpkswus, "V8UsV4SiV4Si", "")
  234. BUILTIN(__builtin_altivec_vpksdss, "V4SiV2SLLiV2SLLi", "")
  235. BUILTIN(__builtin_altivec_vpksdus, "V4UiV2SLLiV2SLLi", "")
  236. BUILTIN(__builtin_altivec_vpkudus, "V4UiV2ULLiV2ULLi", "")
  237. BUILTIN(__builtin_altivec_vpkudum, "V4UiV2ULLiV2ULLi", "")
  238. BUILTIN(__builtin_altivec_vperm_4si, "V4iV4iV4iV16Uc", "")
  239. BUILTIN(__builtin_altivec_stvx, "vV4iLiv*", "")
  240. BUILTIN(__builtin_altivec_stvxl, "vV4iLiv*", "")
  241. BUILTIN(__builtin_altivec_stvebx, "vV16cLiv*", "")
  242. BUILTIN(__builtin_altivec_stvehx, "vV8sLiv*", "")
  243. BUILTIN(__builtin_altivec_stvewx, "vV4iLiv*", "")
  244. BUILTIN(__builtin_altivec_vcmpbfp, "V4iV4fV4f", "")
  245. BUILTIN(__builtin_altivec_vcmpgefp, "V4iV4fV4f", "")
  246. BUILTIN(__builtin_altivec_vcmpequb, "V16cV16cV16c", "")
  247. BUILTIN(__builtin_altivec_vcmpequh, "V8sV8sV8s", "")
  248. BUILTIN(__builtin_altivec_vcmpequw, "V4iV4iV4i", "")
  249. BUILTIN(__builtin_altivec_vcmpequd, "V2LLiV2LLiV2LLi", "")
  250. BUILTIN(__builtin_altivec_vcmpeqfp, "V4iV4fV4f", "")
  251. BUILTIN(__builtin_altivec_vcmpneb, "V16cV16cV16c", "")
  252. BUILTIN(__builtin_altivec_vcmpneh, "V8sV8sV8s", "")
  253. BUILTIN(__builtin_altivec_vcmpnew, "V4iV4iV4i", "")
  254. BUILTIN(__builtin_altivec_vcmpnezb, "V16cV16cV16c", "")
  255. BUILTIN(__builtin_altivec_vcmpnezh, "V8sV8sV8s", "")
  256. BUILTIN(__builtin_altivec_vcmpnezw, "V4iV4iV4i", "")
  257. BUILTIN(__builtin_altivec_vcmpgtsb, "V16cV16ScV16Sc", "")
  258. BUILTIN(__builtin_altivec_vcmpgtub, "V16cV16UcV16Uc", "")
  259. BUILTIN(__builtin_altivec_vcmpgtsh, "V8sV8SsV8Ss", "")
  260. BUILTIN(__builtin_altivec_vcmpgtuh, "V8sV8UsV8Us", "")
  261. BUILTIN(__builtin_altivec_vcmpgtsw, "V4iV4SiV4Si", "")
  262. BUILTIN(__builtin_altivec_vcmpgtuw, "V4iV4UiV4Ui", "")
  263. BUILTIN(__builtin_altivec_vcmpgtsd, "V2LLiV2LLiV2LLi", "")
  264. BUILTIN(__builtin_altivec_vcmpgtud, "V2LLiV2ULLiV2ULLi", "")
  265. BUILTIN(__builtin_altivec_vcmpgtfp, "V4iV4fV4f", "")
  266. // P10 Vector compare builtins.
  267. BUILTIN(__builtin_altivec_vcmpequq, "V1LLLiV1ULLLiV1ULLLi", "")
  268. BUILTIN(__builtin_altivec_vcmpgtsq, "V1LLLiV1SLLLiV1SLLLi", "")
  269. BUILTIN(__builtin_altivec_vcmpgtuq, "V1LLLiV1ULLLiV1ULLLi", "")
  270. BUILTIN(__builtin_altivec_vcmpequq_p, "iiV1ULLLiV1LLLi", "")
  271. BUILTIN(__builtin_altivec_vcmpgtsq_p, "iiV1SLLLiV1SLLLi", "")
  272. BUILTIN(__builtin_altivec_vcmpgtuq_p, "iiV1ULLLiV1ULLLi", "")
  273. BUILTIN(__builtin_altivec_vmaxsb, "V16ScV16ScV16Sc", "")
  274. BUILTIN(__builtin_altivec_vmaxub, "V16UcV16UcV16Uc", "")
  275. BUILTIN(__builtin_altivec_vmaxsh, "V8SsV8SsV8Ss", "")
  276. BUILTIN(__builtin_altivec_vmaxuh, "V8UsV8UsV8Us", "")
  277. BUILTIN(__builtin_altivec_vmaxsw, "V4SiV4SiV4Si", "")
  278. BUILTIN(__builtin_altivec_vmaxuw, "V4UiV4UiV4Ui", "")
  279. BUILTIN(__builtin_altivec_vmaxsd, "V2LLiV2LLiV2LLi", "")
  280. BUILTIN(__builtin_altivec_vmaxud, "V2ULLiV2ULLiV2ULLi", "")
  281. BUILTIN(__builtin_altivec_vmaxfp, "V4fV4fV4f", "")
  282. BUILTIN(__builtin_altivec_mfvscr, "V8Us", "")
  283. BUILTIN(__builtin_altivec_vminsb, "V16ScV16ScV16Sc", "")
  284. BUILTIN(__builtin_altivec_vminub, "V16UcV16UcV16Uc", "")
  285. BUILTIN(__builtin_altivec_vminsh, "V8SsV8SsV8Ss", "")
  286. BUILTIN(__builtin_altivec_vminuh, "V8UsV8UsV8Us", "")
  287. BUILTIN(__builtin_altivec_vminsw, "V4SiV4SiV4Si", "")
  288. BUILTIN(__builtin_altivec_vminuw, "V4UiV4UiV4Ui", "")
  289. BUILTIN(__builtin_altivec_vminsd, "V2LLiV2LLiV2LLi", "")
  290. BUILTIN(__builtin_altivec_vminud, "V2ULLiV2ULLiV2ULLi", "")
  291. BUILTIN(__builtin_altivec_vminfp, "V4fV4fV4f", "")
  292. BUILTIN(__builtin_altivec_mtvscr, "vV4i", "")
  293. BUILTIN(__builtin_altivec_vrefp, "V4fV4f", "")
  294. BUILTIN(__builtin_altivec_vrlb, "V16cV16cV16Uc", "")
  295. BUILTIN(__builtin_altivec_vrlh, "V8sV8sV8Us", "")
  296. BUILTIN(__builtin_altivec_vrlw, "V4iV4iV4Ui", "")
  297. BUILTIN(__builtin_altivec_vrld, "V2LLiV2LLiV2ULLi", "")
  298. BUILTIN(__builtin_altivec_vsel_4si, "V4iV4iV4iV4Ui", "")
  299. BUILTIN(__builtin_altivec_vsl, "V4iV4iV4i", "")
  300. BUILTIN(__builtin_altivec_vslo, "V4iV4iV4i", "")
  301. BUILTIN(__builtin_altivec_vsrab, "V16cV16cV16Uc", "")
  302. BUILTIN(__builtin_altivec_vsrah, "V8sV8sV8Us", "")
  303. BUILTIN(__builtin_altivec_vsraw, "V4iV4iV4Ui", "")
  304. BUILTIN(__builtin_altivec_vsr, "V4iV4iV4i", "")
  305. BUILTIN(__builtin_altivec_vsro, "V4iV4iV4i", "")
  306. BUILTIN(__builtin_altivec_vrfin, "V4fV4f", "")
  307. BUILTIN(__builtin_altivec_vrsqrtefp, "V4fV4f", "")
  308. BUILTIN(__builtin_altivec_vsubcuw, "V4UiV4UiV4Ui", "")
  309. BUILTIN(__builtin_altivec_vsum4sbs, "V4SiV16ScV4Si", "")
  310. BUILTIN(__builtin_altivec_vsum4ubs, "V4UiV16UcV4Ui", "")
  311. BUILTIN(__builtin_altivec_vsum4shs, "V4SiV8SsV4Si", "")
  312. BUILTIN(__builtin_altivec_vsum2sws, "V4SiV4SiV4Si", "")
  313. BUILTIN(__builtin_altivec_vsumsws, "V4SiV4SiV4Si", "")
  314. BUILTIN(__builtin_altivec_vrfiz, "V4fV4f", "")
  315. BUILTIN(__builtin_altivec_vupkhsb, "V8sV16c", "")
  316. BUILTIN(__builtin_altivec_vupkhpx, "V4UiV8s", "")
  317. BUILTIN(__builtin_altivec_vupkhsh, "V4iV8s", "")
  318. BUILTIN(__builtin_altivec_vupkhsw, "V2LLiV4i", "")
  319. BUILTIN(__builtin_altivec_vupklsb, "V8sV16c", "")
  320. BUILTIN(__builtin_altivec_vupklpx, "V4UiV8s", "")
  321. BUILTIN(__builtin_altivec_vupklsh, "V4iV8s", "")
  322. BUILTIN(__builtin_altivec_vupklsw, "V2LLiV4i", "")
  323. BUILTIN(__builtin_altivec_vcmpbfp_p, "iiV4fV4f", "")
  324. BUILTIN(__builtin_altivec_vcmpgefp_p, "iiV4fV4f", "")
  325. BUILTIN(__builtin_altivec_vcmpequb_p, "iiV16cV16c", "")
  326. BUILTIN(__builtin_altivec_vcmpequh_p, "iiV8sV8s", "")
  327. BUILTIN(__builtin_altivec_vcmpequw_p, "iiV4iV4i", "")
  328. BUILTIN(__builtin_altivec_vcmpequd_p, "iiV2LLiV2LLi", "")
  329. BUILTIN(__builtin_altivec_vcmpeqfp_p, "iiV4fV4f", "")
  330. BUILTIN(__builtin_altivec_vcmpneb_p, "iiV16cV16c", "")
  331. BUILTIN(__builtin_altivec_vcmpneh_p, "iiV8sV8s", "")
  332. BUILTIN(__builtin_altivec_vcmpnew_p, "iiV4iV4i", "")
  333. BUILTIN(__builtin_altivec_vcmpned_p, "iiV2LLiV2LLi", "")
  334. BUILTIN(__builtin_altivec_vcmpgtsb_p, "iiV16ScV16Sc", "")
  335. BUILTIN(__builtin_altivec_vcmpgtub_p, "iiV16UcV16Uc", "")
  336. BUILTIN(__builtin_altivec_vcmpgtsh_p, "iiV8SsV8Ss", "")
  337. BUILTIN(__builtin_altivec_vcmpgtuh_p, "iiV8UsV8Us", "")
  338. BUILTIN(__builtin_altivec_vcmpgtsw_p, "iiV4SiV4Si", "")
  339. BUILTIN(__builtin_altivec_vcmpgtuw_p, "iiV4UiV4Ui", "")
  340. BUILTIN(__builtin_altivec_vcmpgtsd_p, "iiV2LLiV2LLi", "")
  341. BUILTIN(__builtin_altivec_vcmpgtud_p, "iiV2ULLiV2ULLi", "")
  342. BUILTIN(__builtin_altivec_vcmpgtfp_p, "iiV4fV4f", "")
  343. BUILTIN(__builtin_altivec_vgbbd, "V16UcV16Uc", "")
  344. BUILTIN(__builtin_altivec_vbpermq, "V2ULLiV16UcV16Uc", "")
  345. BUILTIN(__builtin_altivec_vbpermd, "V2ULLiV2ULLiV16Uc", "")
  346. // P8 Crypto built-ins.
  347. BUILTIN(__builtin_altivec_crypto_vsbox, "V2ULLiV2ULLi", "")
  348. BUILTIN(__builtin_altivec_crypto_vpermxor, "V16UcV16UcV16UcV16Uc", "")
  349. BUILTIN(__builtin_altivec_crypto_vpermxor_be, "V16UcV16UcV16UcV16Uc", "")
  350. BUILTIN(__builtin_altivec_crypto_vshasigmaw, "V4UiV4UiIiIi", "")
  351. BUILTIN(__builtin_altivec_crypto_vshasigmad, "V2ULLiV2ULLiIiIi", "")
  352. BUILTIN(__builtin_altivec_crypto_vcipher, "V2ULLiV2ULLiV2ULLi", "")
  353. BUILTIN(__builtin_altivec_crypto_vcipherlast, "V2ULLiV2ULLiV2ULLi", "")
  354. BUILTIN(__builtin_altivec_crypto_vncipher, "V2ULLiV2ULLiV2ULLi", "")
  355. BUILTIN(__builtin_altivec_crypto_vncipherlast, "V2ULLiV2ULLiV2ULLi", "")
  356. BUILTIN(__builtin_altivec_crypto_vpmsumb, "V16UcV16UcV16Uc", "")
  357. BUILTIN(__builtin_altivec_crypto_vpmsumh, "V8UsV8UsV8Us", "")
  358. BUILTIN(__builtin_altivec_crypto_vpmsumw, "V4UiV4UiV4Ui", "")
  359. BUILTIN(__builtin_altivec_crypto_vpmsumd, "V2ULLiV2ULLiV2ULLi", "")
  360. BUILTIN(__builtin_altivec_vclzb, "V16UcV16Uc", "")
  361. BUILTIN(__builtin_altivec_vclzh, "V8UsV8Us", "")
  362. BUILTIN(__builtin_altivec_vclzw, "V4UiV4Ui", "")
  363. BUILTIN(__builtin_altivec_vclzd, "V2ULLiV2ULLi", "")
  364. BUILTIN(__builtin_altivec_vctzb, "V16UcV16Uc", "")
  365. BUILTIN(__builtin_altivec_vctzh, "V8UsV8Us", "")
  366. BUILTIN(__builtin_altivec_vctzw, "V4UiV4Ui", "")
  367. BUILTIN(__builtin_altivec_vctzd, "V2ULLiV2ULLi", "")
  368. // P8 BCD builtins.
  369. BUILTIN(__builtin_ppc_bcdadd, "V16UcV16UcV16UcIi", "")
  370. BUILTIN(__builtin_ppc_bcdsub, "V16UcV16UcV16UcIi", "")
  371. BUILTIN(__builtin_ppc_bcdadd_p, "iiV16UcV16Uc", "")
  372. BUILTIN(__builtin_ppc_bcdsub_p, "iiV16UcV16Uc", "")
  373. BUILTIN(__builtin_altivec_vclzlsbb, "SiV16Uc", "")
  374. BUILTIN(__builtin_altivec_vctzlsbb, "SiV16Uc", "")
  375. BUILTIN(__builtin_altivec_vprtybw, "V4UiV4Ui", "")
  376. BUILTIN(__builtin_altivec_vprtybd, "V2ULLiV2ULLi", "")
  377. BUILTIN(__builtin_altivec_vprtybq, "V1ULLLiV1ULLLi", "")
  378. // Vector population count built-ins
  379. BUILTIN(__builtin_altivec_vpopcntb, "V16UcV16Uc", "")
  380. BUILTIN(__builtin_altivec_vpopcnth, "V8UsV8Us", "")
  381. BUILTIN(__builtin_altivec_vpopcntw, "V4UiV4Ui", "")
  382. BUILTIN(__builtin_altivec_vpopcntd, "V2ULLiV2ULLi", "")
  383. // Absolute difference built-ins
  384. BUILTIN(__builtin_altivec_vabsdub, "V16UcV16UcV16Uc", "")
  385. BUILTIN(__builtin_altivec_vabsduh, "V8UsV8UsV8Us", "")
  386. BUILTIN(__builtin_altivec_vabsduw, "V4UiV4UiV4Ui", "")
  387. // P9 Shift built-ins.
  388. BUILTIN(__builtin_altivec_vslv, "V16UcV16UcV16Uc", "")
  389. BUILTIN(__builtin_altivec_vsrv, "V16UcV16UcV16Uc", "")
  390. // P9 Vector rotate built-ins
  391. BUILTIN(__builtin_altivec_vrlwmi, "V4UiV4UiV4UiV4Ui", "")
  392. BUILTIN(__builtin_altivec_vrldmi, "V2ULLiV2ULLiV2ULLiV2ULLi", "")
  393. BUILTIN(__builtin_altivec_vrlwnm, "V4UiV4UiV4Ui", "")
  394. BUILTIN(__builtin_altivec_vrldnm, "V2ULLiV2ULLiV2ULLi", "")
  395. // P9 Vector extend sign builtins.
  396. BUILTIN(__builtin_altivec_vextsb2w, "V4SiV16Sc", "")
  397. BUILTIN(__builtin_altivec_vextsb2d, "V2SLLiV16Sc", "")
  398. BUILTIN(__builtin_altivec_vextsh2w, "V4SiV8Ss", "")
  399. BUILTIN(__builtin_altivec_vextsh2d, "V2SLLiV8Ss", "")
  400. BUILTIN(__builtin_altivec_vextsw2d, "V2SLLiV4Si", "")
  401. // P10 Vector extend sign builtins.
  402. BUILTIN(__builtin_altivec_vextsd2q, "V1SLLLiV2SLLi", "")
  403. // P10 Vector Extract with Mask built-ins.
  404. BUILTIN(__builtin_altivec_vextractbm, "UiV16Uc", "")
  405. BUILTIN(__builtin_altivec_vextracthm, "UiV8Us", "")
  406. BUILTIN(__builtin_altivec_vextractwm, "UiV4Ui", "")
  407. BUILTIN(__builtin_altivec_vextractdm, "UiV2ULLi", "")
  408. BUILTIN(__builtin_altivec_vextractqm, "UiV1ULLLi", "")
  409. // P10 Vector Divide Extended built-ins.
  410. BUILTIN(__builtin_altivec_vdivesw, "V4SiV4SiV4Si", "")
  411. BUILTIN(__builtin_altivec_vdiveuw, "V4UiV4UiV4Ui", "")
  412. BUILTIN(__builtin_altivec_vdivesd, "V2LLiV2LLiV2LLi", "")
  413. BUILTIN(__builtin_altivec_vdiveud, "V2ULLiV2ULLiV2ULLi", "")
  414. BUILTIN(__builtin_altivec_vdivesq, "V1SLLLiV1SLLLiV1SLLLi", "")
  415. BUILTIN(__builtin_altivec_vdiveuq, "V1ULLLiV1ULLLiV1ULLLi", "")
  416. // P10 Vector Multiply High built-ins.
  417. BUILTIN(__builtin_altivec_vmulhsw, "V4SiV4SiV4Si", "")
  418. BUILTIN(__builtin_altivec_vmulhuw, "V4UiV4UiV4Ui", "")
  419. BUILTIN(__builtin_altivec_vmulhsd, "V2LLiV2LLiV2LLi", "")
  420. BUILTIN(__builtin_altivec_vmulhud, "V2ULLiV2ULLiV2ULLi", "")
  421. // P10 Vector Expand with Mask built-ins.
  422. BUILTIN(__builtin_altivec_vexpandbm, "V16UcV16Uc", "")
  423. BUILTIN(__builtin_altivec_vexpandhm, "V8UsV8Us", "")
  424. BUILTIN(__builtin_altivec_vexpandwm, "V4UiV4Ui", "")
  425. BUILTIN(__builtin_altivec_vexpanddm, "V2ULLiV2ULLi", "")
  426. BUILTIN(__builtin_altivec_vexpandqm, "V1ULLLiV1ULLLi", "")
  427. // P10 Vector Count with Mask built-ins.
  428. BUILTIN(__builtin_altivec_vcntmbb, "ULLiV16UcUi", "")
  429. BUILTIN(__builtin_altivec_vcntmbh, "ULLiV8UsUi", "")
  430. BUILTIN(__builtin_altivec_vcntmbw, "ULLiV4UiUi", "")
  431. BUILTIN(__builtin_altivec_vcntmbd, "ULLiV2ULLiUi", "")
  432. // P10 Move to VSR with Mask built-ins.
  433. BUILTIN(__builtin_altivec_mtvsrbm, "V16UcULLi", "")
  434. BUILTIN(__builtin_altivec_mtvsrhm, "V8UsULLi", "")
  435. BUILTIN(__builtin_altivec_mtvsrwm, "V4UiULLi", "")
  436. BUILTIN(__builtin_altivec_mtvsrdm, "V2ULLiULLi", "")
  437. BUILTIN(__builtin_altivec_mtvsrqm, "V1ULLLiULLi", "")
  438. // P10 Vector Parallel Bits built-ins.
  439. BUILTIN(__builtin_altivec_vpdepd, "V2ULLiV2ULLiV2ULLi", "")
  440. BUILTIN(__builtin_altivec_vpextd, "V2ULLiV2ULLiV2ULLi", "")
  441. // P10 Vector String Isolate Built-ins.
  442. BUILTIN(__builtin_altivec_vstribr, "V16cV16c", "")
  443. BUILTIN(__builtin_altivec_vstribl, "V16cV16c", "")
  444. BUILTIN(__builtin_altivec_vstrihr, "V8sV8s", "")
  445. BUILTIN(__builtin_altivec_vstrihl, "V8sV8s", "")
  446. BUILTIN(__builtin_altivec_vstribr_p, "iiV16c", "")
  447. BUILTIN(__builtin_altivec_vstribl_p, "iiV16c", "")
  448. BUILTIN(__builtin_altivec_vstrihr_p, "iiV8s", "")
  449. BUILTIN(__builtin_altivec_vstrihl_p, "iiV8s", "")
  450. // P10 Vector Centrifuge built-in.
  451. BUILTIN(__builtin_altivec_vcfuged, "V2ULLiV2ULLiV2ULLi", "")
  452. // P10 Vector Gather Every N-th Bit built-in.
  453. BUILTIN(__builtin_altivec_vgnb, "ULLiV1ULLLiIi", "")
  454. // P10 Vector Clear Bytes built-ins.
  455. BUILTIN(__builtin_altivec_vclrlb, "V16cV16cUi", "")
  456. BUILTIN(__builtin_altivec_vclrrb, "V16cV16cUi", "")
  457. // P10 Vector Count Leading / Trailing Zeroes under bit Mask built-ins.
  458. BUILTIN(__builtin_altivec_vclzdm, "V2ULLiV2ULLiV2ULLi", "")
  459. BUILTIN(__builtin_altivec_vctzdm, "V2ULLiV2ULLiV2ULLi", "")
  460. // P10 Vector Shift built-ins.
  461. BUILTIN(__builtin_altivec_vsldbi, "V16UcV16UcV16UcIi", "")
  462. BUILTIN(__builtin_altivec_vsrdbi, "V16UcV16UcV16UcIi", "")
  463. // P10 Vector Insert built-ins.
  464. BUILTIN(__builtin_altivec_vinsblx, "V16UcV16UcUiUi", "")
  465. BUILTIN(__builtin_altivec_vinsbrx, "V16UcV16UcUiUi", "")
  466. BUILTIN(__builtin_altivec_vinshlx, "V8UsV8UsUiUi", "")
  467. BUILTIN(__builtin_altivec_vinshrx, "V8UsV8UsUiUi", "")
  468. BUILTIN(__builtin_altivec_vinswlx, "V4UiV4UiUiUi", "")
  469. BUILTIN(__builtin_altivec_vinswrx, "V4UiV4UiUiUi", "")
  470. BUILTIN(__builtin_altivec_vinsdlx, "V2ULLiV2ULLiULLiULLi", "")
  471. BUILTIN(__builtin_altivec_vinsdrx, "V2ULLiV2ULLiULLiULLi", "")
  472. BUILTIN(__builtin_altivec_vinsbvlx, "V16UcV16UcUiV16Uc", "")
  473. BUILTIN(__builtin_altivec_vinsbvrx, "V16UcV16UcUiV16Uc", "")
  474. BUILTIN(__builtin_altivec_vinshvlx, "V8UsV8UsUiV8Us", "")
  475. BUILTIN(__builtin_altivec_vinshvrx, "V8UsV8UsUiV8Us", "")
  476. BUILTIN(__builtin_altivec_vinswvlx, "V4UiV4UiUiV4Ui", "")
  477. BUILTIN(__builtin_altivec_vinswvrx, "V4UiV4UiUiV4Ui", "")
  478. BUILTIN(__builtin_altivec_vec_replace_elt, "V4UiV4UiUiIi", "t")
  479. BUILTIN(__builtin_altivec_vec_replace_unaligned, "V4UiV4UiUiIi", "t")
  480. // P10 Vector Extract built-ins.
  481. BUILTIN(__builtin_altivec_vextdubvlx, "V2ULLiV16UcV16UcUi", "")
  482. BUILTIN(__builtin_altivec_vextdubvrx, "V2ULLiV16UcV16UcUi", "")
  483. BUILTIN(__builtin_altivec_vextduhvlx, "V2ULLiV8UsV8UsUi", "")
  484. BUILTIN(__builtin_altivec_vextduhvrx, "V2ULLiV8UsV8UsUi", "")
  485. BUILTIN(__builtin_altivec_vextduwvlx, "V2ULLiV4UiV4UiUi", "")
  486. BUILTIN(__builtin_altivec_vextduwvrx, "V2ULLiV4UiV4UiUi", "")
  487. BUILTIN(__builtin_altivec_vextddvlx, "V2ULLiV2ULLiV2ULLiUi", "")
  488. BUILTIN(__builtin_altivec_vextddvrx, "V2ULLiV2ULLiV2ULLiUi", "")
  489. // P10 Vector rotate built-ins.
  490. BUILTIN(__builtin_altivec_vrlqmi, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi", "")
  491. BUILTIN(__builtin_altivec_vrlqnm, "V1ULLLiV1ULLLiV1ULLLi", "")
  492. // VSX built-ins.
  493. BUILTIN(__builtin_vsx_lxvd2x, "V2dLivC*", "")
  494. BUILTIN(__builtin_vsx_lxvw4x, "V4iLivC*", "")
  495. BUILTIN(__builtin_vsx_lxvd2x_be, "V2dSLLivC*", "")
  496. BUILTIN(__builtin_vsx_lxvw4x_be, "V4iSLLivC*", "")
  497. BUILTIN(__builtin_vsx_stxvd2x, "vV2dLiv*", "")
  498. BUILTIN(__builtin_vsx_stxvw4x, "vV4iLiv*", "")
  499. BUILTIN(__builtin_vsx_stxvd2x_be, "vV2dSLLivC*", "")
  500. BUILTIN(__builtin_vsx_stxvw4x_be, "vV4iSLLivC*", "")
  501. BUILTIN(__builtin_vsx_lxvl, "V4ivC*ULLi", "")
  502. BUILTIN(__builtin_vsx_lxvll, "V4ivC*ULLi", "")
  503. BUILTIN(__builtin_vsx_stxvl, "vV4iv*ULLi", "")
  504. BUILTIN(__builtin_vsx_stxvll, "vV4iv*ULLi", "")
  505. BUILTIN(__builtin_vsx_ldrmb, "V16UcCc*Ii", "")
  506. BUILTIN(__builtin_vsx_strmb, "vCc*IiV16Uc", "")
  507. BUILTIN(__builtin_vsx_xvmaxdp, "V2dV2dV2d", "")
  508. BUILTIN(__builtin_vsx_xvmaxsp, "V4fV4fV4f", "")
  509. BUILTIN(__builtin_vsx_xsmaxdp, "ddd", "")
  510. BUILTIN(__builtin_vsx_xvmindp, "V2dV2dV2d", "")
  511. BUILTIN(__builtin_vsx_xvminsp, "V4fV4fV4f", "")
  512. BUILTIN(__builtin_vsx_xsmindp, "ddd", "")
  513. BUILTIN(__builtin_vsx_xvdivdp, "V2dV2dV2d", "")
  514. BUILTIN(__builtin_vsx_xvdivsp, "V4fV4fV4f", "")
  515. BUILTIN(__builtin_vsx_xvrdpip, "V2dV2d", "")
  516. BUILTIN(__builtin_vsx_xvrspip, "V4fV4f", "")
  517. BUILTIN(__builtin_vsx_xvcmpeqdp, "V2ULLiV2dV2d", "")
  518. BUILTIN(__builtin_vsx_xvcmpeqsp, "V4UiV4fV4f", "")
  519. BUILTIN(__builtin_vsx_xvcmpeqdp_p, "iiV2dV2d", "")
  520. BUILTIN(__builtin_vsx_xvcmpeqsp_p, "iiV4fV4f", "")
  521. BUILTIN(__builtin_vsx_xvcmpgedp, "V2ULLiV2dV2d", "")
  522. BUILTIN(__builtin_vsx_xvcmpgesp, "V4UiV4fV4f", "")
  523. BUILTIN(__builtin_vsx_xvcmpgedp_p, "iiV2dV2d", "")
  524. BUILTIN(__builtin_vsx_xvcmpgesp_p, "iiV4fV4f", "")
  525. BUILTIN(__builtin_vsx_xvcmpgtdp, "V2ULLiV2dV2d", "")
  526. BUILTIN(__builtin_vsx_xvcmpgtsp, "V4UiV4fV4f", "")
  527. BUILTIN(__builtin_vsx_xvcmpgtdp_p, "iiV2dV2d", "")
  528. BUILTIN(__builtin_vsx_xvcmpgtsp_p, "iiV4fV4f", "")
  529. BUILTIN(__builtin_vsx_xvrdpim, "V2dV2d", "")
  530. BUILTIN(__builtin_vsx_xvrspim, "V4fV4f", "")
  531. BUILTIN(__builtin_vsx_xvrdpi, "V2dV2d", "")
  532. BUILTIN(__builtin_vsx_xvrspi, "V4fV4f", "")
  533. BUILTIN(__builtin_vsx_xvrdpic, "V2dV2d", "")
  534. BUILTIN(__builtin_vsx_xvrspic, "V4fV4f", "")
  535. BUILTIN(__builtin_vsx_xvrdpiz, "V2dV2d", "")
  536. BUILTIN(__builtin_vsx_xvrspiz, "V4fV4f", "")
  537. BUILTIN(__builtin_vsx_xvmaddadp, "V2dV2dV2dV2d", "")
  538. BUILTIN(__builtin_vsx_xvmaddasp, "V4fV4fV4fV4f", "")
  539. BUILTIN(__builtin_vsx_xvmsubadp, "V2dV2dV2dV2d", "")
  540. BUILTIN(__builtin_vsx_xvmsubasp, "V4fV4fV4fV4f", "")
  541. BUILTIN(__builtin_vsx_xvmuldp, "V2dV2dV2d", "")
  542. BUILTIN(__builtin_vsx_xvmulsp, "V4fV4fV4f", "")
  543. BUILTIN(__builtin_vsx_xvnmaddadp, "V2dV2dV2dV2d", "")
  544. BUILTIN(__builtin_vsx_xvnmaddasp, "V4fV4fV4fV4f", "")
  545. BUILTIN(__builtin_vsx_xvnmsubadp, "V2dV2dV2dV2d", "")
  546. BUILTIN(__builtin_vsx_xvnmsubasp, "V4fV4fV4fV4f", "")
  547. BUILTIN(__builtin_vsx_xvredp, "V2dV2d", "")
  548. BUILTIN(__builtin_vsx_xvresp, "V4fV4f", "")
  549. BUILTIN(__builtin_vsx_xvrsqrtedp, "V2dV2d", "")
  550. BUILTIN(__builtin_vsx_xvrsqrtesp, "V4fV4f", "")
  551. BUILTIN(__builtin_vsx_xvsqrtdp, "V2dV2d", "")
  552. BUILTIN(__builtin_vsx_xvsqrtsp, "V4fV4f", "")
  553. BUILTIN(__builtin_vsx_xxleqv, "V4UiV4UiV4Ui", "")
  554. BUILTIN(__builtin_vsx_xvcpsgndp, "V2dV2dV2d", "")
  555. BUILTIN(__builtin_vsx_xvcpsgnsp, "V4fV4fV4f", "")
  556. BUILTIN(__builtin_vsx_xvabssp, "V4fV4f", "")
  557. BUILTIN(__builtin_vsx_xvabsdp, "V2dV2d", "")
  558. BUILTIN(__builtin_vsx_xxgenpcvbm, "V16UcV16Uci", "")
  559. BUILTIN(__builtin_vsx_xxgenpcvhm, "V8UsV8Usi", "")
  560. BUILTIN(__builtin_vsx_xxgenpcvwm, "V4UiV4Uii", "")
  561. BUILTIN(__builtin_vsx_xxgenpcvdm, "V2ULLiV2ULLii", "")
  562. // vector Insert/Extract exponent/significand builtins
  563. BUILTIN(__builtin_vsx_xviexpdp, "V2dV2ULLiV2ULLi", "")
  564. BUILTIN(__builtin_vsx_xviexpsp, "V4fV4UiV4Ui", "")
  565. BUILTIN(__builtin_vsx_xvxexpdp, "V2ULLiV2d", "")
  566. BUILTIN(__builtin_vsx_xvxexpsp, "V4UiV4f", "")
  567. BUILTIN(__builtin_vsx_xvxsigdp, "V2ULLiV2d", "")
  568. BUILTIN(__builtin_vsx_xvxsigsp, "V4UiV4f", "")
  569. // Conversion builtins
  570. BUILTIN(__builtin_vsx_xvcvdpsxws, "V4SiV2d", "")
  571. BUILTIN(__builtin_vsx_xvcvdpuxws, "V4UiV2d", "")
  572. BUILTIN(__builtin_vsx_xvcvspsxds, "V2SLLiV4f", "")
  573. BUILTIN(__builtin_vsx_xvcvspuxds, "V2ULLiV4f", "")
  574. BUILTIN(__builtin_vsx_xvcvsxwdp, "V2dV4Si", "")
  575. BUILTIN(__builtin_vsx_xvcvuxwdp, "V2dV4Ui", "")
  576. BUILTIN(__builtin_vsx_xvcvspdp, "V2dV4f", "")
  577. BUILTIN(__builtin_vsx_xvcvsxdsp, "V4fV2SLLi", "")
  578. BUILTIN(__builtin_vsx_xvcvuxdsp, "V4fV2ULLi", "")
  579. BUILTIN(__builtin_vsx_xvcvdpsp, "V4fV2d", "")
  580. BUILTIN(__builtin_vsx_xvcvsphp, "V4fV4f", "")
  581. BUILTIN(__builtin_vsx_xvcvhpsp, "V4fV8Us", "")
  582. BUILTIN(__builtin_vsx_xvcvspbf16, "V16UcV16Uc", "")
  583. BUILTIN(__builtin_vsx_xvcvbf16spn, "V16UcV16Uc", "")
  584. // Vector Test Data Class builtins
  585. BUILTIN(__builtin_vsx_xvtstdcdp, "V2ULLiV2dIi", "")
  586. BUILTIN(__builtin_vsx_xvtstdcsp, "V4UiV4fIi", "")
  587. BUILTIN(__builtin_vsx_insertword, "V16UcV4UiV16UcIi", "")
  588. BUILTIN(__builtin_vsx_extractuword, "V2ULLiV16UcIi", "")
  589. BUILTIN(__builtin_vsx_xxpermdi, "v.", "t")
  590. BUILTIN(__builtin_vsx_xxsldwi, "v.", "t")
  591. BUILTIN(__builtin_vsx_xxeval, "V2ULLiV2ULLiV2ULLiV2ULLiIi", "")
  592. BUILTIN(__builtin_vsx_xvtlsbb, "iV16UcUi", "")
  593. BUILTIN(__builtin_vsx_xvtdivdp, "iV2dV2d", "")
  594. BUILTIN(__builtin_vsx_xvtdivsp, "iV4fV4f", "")
  595. BUILTIN(__builtin_vsx_xvtsqrtdp, "iV2d", "")
  596. BUILTIN(__builtin_vsx_xvtsqrtsp, "iV4f", "")
  597. // P10 Vector Permute Extended built-in.
  598. BUILTIN(__builtin_vsx_xxpermx, "V16UcV16UcV16UcV16UcIi", "")
  599. // P10 Vector Blend built-ins.
  600. BUILTIN(__builtin_vsx_xxblendvb, "V16UcV16UcV16UcV16Uc", "")
  601. BUILTIN(__builtin_vsx_xxblendvh, "V8UsV8UsV8UsV8Us", "")
  602. BUILTIN(__builtin_vsx_xxblendvw, "V4UiV4UiV4UiV4Ui", "")
  603. BUILTIN(__builtin_vsx_xxblendvd, "V2ULLiV2ULLiV2ULLiV2ULLi", "")
  604. // Float 128 built-ins
  605. BUILTIN(__builtin_sqrtf128_round_to_odd, "LLdLLd", "")
  606. BUILTIN(__builtin_addf128_round_to_odd, "LLdLLdLLd", "")
  607. BUILTIN(__builtin_subf128_round_to_odd, "LLdLLdLLd", "")
  608. BUILTIN(__builtin_mulf128_round_to_odd, "LLdLLdLLd", "")
  609. BUILTIN(__builtin_divf128_round_to_odd, "LLdLLdLLd", "")
  610. BUILTIN(__builtin_fmaf128_round_to_odd, "LLdLLdLLdLLd", "")
  611. BUILTIN(__builtin_truncf128_round_to_odd, "dLLd", "")
  612. BUILTIN(__builtin_vsx_scalar_extract_expq, "ULLiLLd", "")
  613. BUILTIN(__builtin_vsx_scalar_insert_exp_qp, "LLdLLdULLi", "")
  614. // Fastmath by default builtins
  615. BUILTIN(__builtin_ppc_rsqrtf, "V4fV4f", "")
  616. BUILTIN(__builtin_ppc_rsqrtd, "V2dV2d", "")
  617. BUILTIN(__builtin_ppc_recipdivf, "V4fV4fV4f", "")
  618. BUILTIN(__builtin_ppc_recipdivd, "V2dV2dV2d", "")
  619. // HTM builtins
  620. BUILTIN(__builtin_tbegin, "UiUIi", "")
  621. BUILTIN(__builtin_tend, "UiUIi", "")
  622. BUILTIN(__builtin_tabort, "UiUi", "")
  623. BUILTIN(__builtin_tabortdc, "UiUiUiUi", "")
  624. BUILTIN(__builtin_tabortdci, "UiUiUii", "")
  625. BUILTIN(__builtin_tabortwc, "UiUiUiUi", "")
  626. BUILTIN(__builtin_tabortwci, "UiUiUii", "")
  627. BUILTIN(__builtin_tcheck, "Ui", "")
  628. BUILTIN(__builtin_treclaim, "UiUi", "")
  629. BUILTIN(__builtin_trechkpt, "Ui", "")
  630. BUILTIN(__builtin_tsr, "UiUi", "")
  631. BUILTIN(__builtin_tendall, "Ui", "")
  632. BUILTIN(__builtin_tresume, "Ui", "")
  633. BUILTIN(__builtin_tsuspend, "Ui", "")
  634. BUILTIN(__builtin_get_texasr, "LUi", "c")
  635. BUILTIN(__builtin_get_texasru, "LUi", "c")
  636. BUILTIN(__builtin_get_tfhar, "LUi", "c")
  637. BUILTIN(__builtin_get_tfiar, "LUi", "c")
  638. BUILTIN(__builtin_set_texasr, "vLUi", "c")
  639. BUILTIN(__builtin_set_texasru, "vLUi", "c")
  640. BUILTIN(__builtin_set_tfhar, "vLUi", "c")
  641. BUILTIN(__builtin_set_tfiar, "vLUi", "c")
  642. BUILTIN(__builtin_ttest, "LUi", "")
  643. // Scalar built-ins
  644. BUILTIN(__builtin_divwe, "SiSiSi", "")
  645. BUILTIN(__builtin_divweu, "UiUiUi", "")
  646. BUILTIN(__builtin_divde, "SLLiSLLiSLLi", "")
  647. BUILTIN(__builtin_divdeu, "ULLiULLiULLi", "")
  648. BUILTIN(__builtin_bpermd, "SLLiSLLiSLLi", "")
  649. BUILTIN(__builtin_pdepd, "ULLiULLiULLi", "")
  650. BUILTIN(__builtin_pextd, "ULLiULLiULLi", "")
  651. BUILTIN(__builtin_cfuged, "ULLiULLiULLi", "")
  652. BUILTIN(__builtin_cntlzdm, "ULLiULLiULLi", "")
  653. BUILTIN(__builtin_cnttzdm, "ULLiULLiULLi", "")
  654. // Double-double (un)pack
  655. BUILTIN(__builtin_unpack_longdouble, "dLdIi", "")
  656. BUILTIN(__builtin_pack_longdouble, "Lddd", "")
  657. // Generate random number
  658. BUILTIN(__builtin_darn, "LLi", "")
  659. BUILTIN(__builtin_darn_raw, "LLi", "")
  660. BUILTIN(__builtin_darn_32, "i", "")
  661. // Vector int128 (un)pack
  662. BUILTIN(__builtin_unpack_vector_int128, "ULLiV1LLLii", "")
  663. BUILTIN(__builtin_pack_vector_int128, "V1LLLiULLiULLi", "")
  664. // Set the floating point rounding mode
  665. BUILTIN(__builtin_setrnd, "di", "")
  666. // Get content from current FPSCR
  667. BUILTIN(__builtin_readflm, "d", "")
  668. // Set content of FPSCR, and return its content before update
  669. BUILTIN(__builtin_setflm, "dd", "")
  670. // Cache built-ins
  671. BUILTIN(__builtin_dcbf, "vvC*", "")
  672. // Built-ins requiring custom code generation.
  673. // Because these built-ins rely on target-dependent types and to avoid pervasive
  674. // change, they are type checked manually in Sema using custom type descriptors.
  675. // The first argument of the CUSTOM_BUILTIN macro is the name of the built-in
  676. // with its prefix, the second argument is the name of the intrinsic this
  677. // built-in generates, the third argument specifies the type of the function
  678. // (result value, then each argument) as follows:
  679. // i -> Unsigned integer followed by the greatest possible value for that
  680. // argument or 0 if no constraint on the value.
  681. // (e.g. i15 for a 4-bits value)
  682. // V -> Vector type used with MMA built-ins (vector unsigned char)
  683. // W -> PPC Vector type followed by the size of the vector type.
  684. // (e.g. W512 for __vector_quad)
  685. // any other descriptor -> Fall back to generic type descriptor decoding.
  686. // The 'C' suffix can be used as a suffix to specify the const type.
  687. // The '*' suffix can be used as a suffix to specify a pointer to a type.
  688. // The fourth argument is set to true if the built-in accumulates its result into
  689. // its given accumulator.
  690. // Provided builtins with _mma_ prefix for compatibility.
  691. CUSTOM_BUILTIN(mma_lxvp, vsx_lxvp, "W256SLiW256C*", false)
  692. CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256C*", false)
  693. CUSTOM_BUILTIN(mma_assemble_pair, vsx_assemble_pair, "vW256*VV", false)
  694. CUSTOM_BUILTIN(mma_disassemble_pair, vsx_disassemble_pair, "vv*W256*", false)
  695. CUSTOM_BUILTIN(vsx_build_pair, vsx_assemble_pair, "vW256*VV", false)
  696. CUSTOM_BUILTIN(mma_build_acc, mma_assemble_acc, "vW512*VVVV", false)
  697. // UNALIASED_CUSTOM_BUILTIN macro is used for built-ins that have
  698. // the same name as that of the intrinsic they generate, i.e. the
  699. // ID and INTR are the same.
  700. // This avoids repeating the ID and INTR in the macro expression.
  701. UNALIASED_CUSTOM_BUILTIN(vsx_lxvp, "W256SLiW256C*", false)
  702. UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256C*", false)
  703. UNALIASED_CUSTOM_BUILTIN(vsx_assemble_pair, "vW256*VV", false)
  704. UNALIASED_CUSTOM_BUILTIN(vsx_disassemble_pair, "vv*W256*", false)
  705. UNALIASED_CUSTOM_BUILTIN(mma_assemble_acc, "vW512*VVVV", false)
  706. UNALIASED_CUSTOM_BUILTIN(mma_disassemble_acc, "vv*W512*", false)
  707. UNALIASED_CUSTOM_BUILTIN(mma_xxmtacc, "vW512*", true)
  708. UNALIASED_CUSTOM_BUILTIN(mma_xxmfacc, "vW512*", true)
  709. UNALIASED_CUSTOM_BUILTIN(mma_xxsetaccz, "vW512*", false)
  710. UNALIASED_CUSTOM_BUILTIN(mma_xvi4ger8, "vW512*VV", false)
  711. UNALIASED_CUSTOM_BUILTIN(mma_xvi8ger4, "vW512*VV", false)
  712. UNALIASED_CUSTOM_BUILTIN(mma_xvi16ger2, "vW512*VV", false)
  713. UNALIASED_CUSTOM_BUILTIN(mma_xvi16ger2s, "vW512*VV", false)
  714. UNALIASED_CUSTOM_BUILTIN(mma_xvf16ger2, "vW512*VV", false)
  715. UNALIASED_CUSTOM_BUILTIN(mma_xvf32ger, "vW512*VV", false)
  716. UNALIASED_CUSTOM_BUILTIN(mma_xvf64ger, "vW512*W256V", false)
  717. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi4ger8, "vW512*VVi15i15i255", false)
  718. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi8ger4, "vW512*VVi15i15i15", false)
  719. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi16ger2, "vW512*VVi15i15i3", false)
  720. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi16ger2s, "vW512*VVi15i15i3", false)
  721. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf16ger2, "vW512*VVi15i15i3", false)
  722. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf32ger, "vW512*VVi15i15", false)
  723. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf64ger, "vW512*W256Vi15i3", false)
  724. UNALIASED_CUSTOM_BUILTIN(mma_xvi4ger8pp, "vW512*VV", true)
  725. UNALIASED_CUSTOM_BUILTIN(mma_xvi8ger4pp, "vW512*VV", true)
  726. UNALIASED_CUSTOM_BUILTIN(mma_xvi8ger4spp, "vW512*VV", true)
  727. UNALIASED_CUSTOM_BUILTIN(mma_xvi16ger2pp, "vW512*VV", true)
  728. UNALIASED_CUSTOM_BUILTIN(mma_xvi16ger2spp, "vW512*VV", true)
  729. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi4ger8pp, "vW512*VVi15i15i255", true)
  730. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi8ger4pp, "vW512*VVi15i15i15", true)
  731. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi8ger4spp, "vW512*VVi15i15i15", true)
  732. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi16ger2pp, "vW512*VVi15i15i3", true)
  733. UNALIASED_CUSTOM_BUILTIN(mma_pmxvi16ger2spp, "vW512*VVi15i15i3", true)
  734. UNALIASED_CUSTOM_BUILTIN(mma_xvf16ger2pp, "vW512*VV", true)
  735. UNALIASED_CUSTOM_BUILTIN(mma_xvf16ger2pn, "vW512*VV", true)
  736. UNALIASED_CUSTOM_BUILTIN(mma_xvf16ger2np, "vW512*VV", true)
  737. UNALIASED_CUSTOM_BUILTIN(mma_xvf16ger2nn, "vW512*VV", true)
  738. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf16ger2pp, "vW512*VVi15i15i3", true)
  739. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf16ger2pn, "vW512*VVi15i15i3", true)
  740. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf16ger2np, "vW512*VVi15i15i3", true)
  741. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf16ger2nn, "vW512*VVi15i15i3", true)
  742. UNALIASED_CUSTOM_BUILTIN(mma_xvf32gerpp, "vW512*VV", true)
  743. UNALIASED_CUSTOM_BUILTIN(mma_xvf32gerpn, "vW512*VV", true)
  744. UNALIASED_CUSTOM_BUILTIN(mma_xvf32gernp, "vW512*VV", true)
  745. UNALIASED_CUSTOM_BUILTIN(mma_xvf32gernn, "vW512*VV", true)
  746. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf32gerpp, "vW512*VVi15i15", true)
  747. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf32gerpn, "vW512*VVi15i15", true)
  748. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf32gernp, "vW512*VVi15i15", true)
  749. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf32gernn, "vW512*VVi15i15", true)
  750. UNALIASED_CUSTOM_BUILTIN(mma_xvf64gerpp, "vW512*W256V", true)
  751. UNALIASED_CUSTOM_BUILTIN(mma_xvf64gerpn, "vW512*W256V", true)
  752. UNALIASED_CUSTOM_BUILTIN(mma_xvf64gernp, "vW512*W256V", true)
  753. UNALIASED_CUSTOM_BUILTIN(mma_xvf64gernn, "vW512*W256V", true)
  754. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf64gerpp, "vW512*W256Vi15i3", true)
  755. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf64gerpn, "vW512*W256Vi15i3", true)
  756. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf64gernp, "vW512*W256Vi15i3", true)
  757. UNALIASED_CUSTOM_BUILTIN(mma_pmxvf64gernn, "vW512*W256Vi15i3", true)
  758. UNALIASED_CUSTOM_BUILTIN(mma_xvbf16ger2, "vW512*VV", false)
  759. UNALIASED_CUSTOM_BUILTIN(mma_pmxvbf16ger2, "vW512*VVi15i15i3", false)
  760. UNALIASED_CUSTOM_BUILTIN(mma_xvbf16ger2pp, "vW512*VV", true)
  761. UNALIASED_CUSTOM_BUILTIN(mma_xvbf16ger2pn, "vW512*VV", true)
  762. UNALIASED_CUSTOM_BUILTIN(mma_xvbf16ger2np, "vW512*VV", true)
  763. UNALIASED_CUSTOM_BUILTIN(mma_xvbf16ger2nn, "vW512*VV", true)
  764. UNALIASED_CUSTOM_BUILTIN(mma_pmxvbf16ger2pp, "vW512*VVi15i15i3", true)
  765. UNALIASED_CUSTOM_BUILTIN(mma_pmxvbf16ger2pn, "vW512*VVi15i15i3", true)
  766. UNALIASED_CUSTOM_BUILTIN(mma_pmxvbf16ger2np, "vW512*VVi15i15i3", true)
  767. UNALIASED_CUSTOM_BUILTIN(mma_pmxvbf16ger2nn, "vW512*VVi15i15i3", true)
  768. // FIXME: Obviously incomplete.
  769. #undef BUILTIN
  770. #undef CUSTOM_BUILTIN
  771. #undef UNALIASED_CUSTOM_BUILTIN