Builtins.def 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694
  1. //===--- Builtins.def - Builtin function info 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 standard builtin function database. Users of this file
  10. // must define the BUILTIN macro to make use of this information.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. // FIXME: This should really be a .td file, but that requires modifying tblgen.
  14. // Perhaps tblgen should have plugins.
  15. // The first value provided to the macro specifies the function name of the
  16. // builtin, and results in a clang::builtin::BIXX enum value for XX.
  17. // The second value provided to the macro specifies the type of the function
  18. // (result value, then each argument) as follows:
  19. // v -> void
  20. // b -> boolean
  21. // c -> char
  22. // s -> short
  23. // i -> int
  24. // h -> half (__fp16, OpenCL)
  25. // x -> half (_Float16)
  26. // y -> half (__bf16)
  27. // f -> float
  28. // d -> double
  29. // z -> size_t
  30. // w -> wchar_t
  31. // F -> constant CFString
  32. // G -> id
  33. // H -> SEL
  34. // M -> struct objc_super
  35. // a -> __builtin_va_list
  36. // A -> "reference" to __builtin_va_list
  37. // V -> Vector, followed by the number of elements and the base type.
  38. // q -> Scalable vector, followed by the number of elements and the base type.
  39. // E -> ext_vector, followed by the number of elements and the base type.
  40. // X -> _Complex, followed by the base type.
  41. // Y -> ptrdiff_t
  42. // P -> FILE
  43. // J -> jmp_buf
  44. // SJ -> sigjmp_buf
  45. // K -> ucontext_t
  46. // p -> pid_t
  47. // . -> "...". This may only occur at the end of the function list.
  48. //
  49. // Types may be prefixed with the following modifiers:
  50. // L -> long (e.g. Li for 'long int', Ld for 'long double')
  51. // LL -> long long (e.g. LLi for 'long long int', LLd for __float128)
  52. // LLL -> __int128_t (e.g. LLLi)
  53. // Z -> int32_t (require a native 32-bit integer type on the target)
  54. // W -> int64_t (require a native 64-bit integer type on the target)
  55. // N -> 'int' size if target is LP64, 'L' otherwise.
  56. // O -> long for OpenCL targets, long long otherwise.
  57. // S -> signed
  58. // U -> unsigned
  59. // I -> Required to constant fold to an integer constant expression.
  60. //
  61. // Types may be postfixed with the following modifiers:
  62. // * -> pointer (optionally followed by an address space number, if no address
  63. // space is specified than any address space will be accepted)
  64. // & -> reference (optionally followed by an address space number)
  65. // C -> const
  66. // D -> volatile
  67. // R -> restrict
  68. // The third value provided to the macro specifies information about attributes
  69. // of the function. These must be kept in sync with the predicates in the
  70. // Builtin::Context class. Currently we have:
  71. // n -> nothrow
  72. // r -> noreturn
  73. // U -> pure
  74. // c -> const
  75. // t -> signature is meaningless, use custom typechecking
  76. // T -> type is not important to semantic analysis and codegen; recognize as
  77. // builtin even if type doesn't match signature, and don't warn if we
  78. // can't be sure the type is right
  79. // F -> this is a libc/libm function with a '__builtin_' prefix added.
  80. // f -> this is a libc/libm function without the '__builtin_' prefix.
  81. // h -> this function requires a specific header or an explicit declaration.
  82. // i -> this is a runtime library implemented function without the
  83. // '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
  84. // p:N: -> this is a printf-like function whose Nth argument is the format
  85. // string.
  86. // P:N: -> similar to the p:N: attribute, but the function is like vprintf
  87. // in that it accepts its arguments as a va_list rather than
  88. // through an ellipsis
  89. // s:N: -> this is a scanf-like function whose Nth argument is the format
  90. // string.
  91. // S:N: -> similar to the s:N: attribute, but the function is like vscanf
  92. // in that it accepts its arguments as a va_list rather than
  93. // through an ellipsis
  94. // e -> const, but only when -fno-math-errno
  95. // j -> returns_twice (like setjmp)
  96. // u -> arguments are not evaluated for their side-effects
  97. // V:N: -> requires vectors of at least N bits to be legal
  98. // C<N,M_0,...,M_k> -> callback behavior: argument N is called with argument
  99. // M_0, ..., M_k as payload
  100. // FIXME: gcc has nonnull
  101. #if defined(BUILTIN) && !defined(LIBBUILTIN)
  102. # define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS)
  103. #endif
  104. #if defined(BUILTIN) && !defined(LANGBUILTIN)
  105. # define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS)
  106. #endif
  107. // Standard libc/libm functions:
  108. BUILTIN(__builtin_atan2 , "ddd" , "Fne")
  109. BUILTIN(__builtin_atan2f, "fff" , "Fne")
  110. BUILTIN(__builtin_atan2l, "LdLdLd", "Fne")
  111. BUILTIN(__builtin_atan2f128, "LLdLLdLLd", "Fne")
  112. BUILTIN(__builtin_abs , "ii" , "ncF")
  113. BUILTIN(__builtin_copysign, "ddd", "ncF")
  114. BUILTIN(__builtin_copysignf, "fff", "ncF")
  115. BUILTIN(__builtin_copysignf16, "hhh", "ncF")
  116. BUILTIN(__builtin_copysignl, "LdLdLd", "ncF")
  117. BUILTIN(__builtin_copysignf128, "LLdLLdLLd", "ncF")
  118. BUILTIN(__builtin_fabs , "dd" , "ncF")
  119. BUILTIN(__builtin_fabsf, "ff" , "ncF")
  120. BUILTIN(__builtin_fabsl, "LdLd", "ncF")
  121. BUILTIN(__builtin_fabsf16, "hh" , "ncF")
  122. BUILTIN(__builtin_fabsf128, "LLdLLd", "ncF")
  123. BUILTIN(__builtin_fmod , "ddd" , "Fne")
  124. BUILTIN(__builtin_fmodf, "fff" , "Fne")
  125. BUILTIN(__builtin_fmodf16, "hhh" , "Fne")
  126. BUILTIN(__builtin_fmodl, "LdLdLd", "Fne")
  127. BUILTIN(__builtin_fmodf128, "LLdLLdLLd", "Fne")
  128. BUILTIN(__builtin_frexp , "ddi*" , "Fn")
  129. BUILTIN(__builtin_frexpf, "ffi*" , "Fn")
  130. BUILTIN(__builtin_frexpl, "LdLdi*", "Fn")
  131. BUILTIN(__builtin_frexpf128, "LLdLLdi*", "Fn")
  132. BUILTIN(__builtin_huge_val, "d", "nc")
  133. BUILTIN(__builtin_huge_valf, "f", "nc")
  134. BUILTIN(__builtin_huge_vall, "Ld", "nc")
  135. BUILTIN(__builtin_huge_valf128, "LLd", "nc")
  136. BUILTIN(__builtin_inf , "d" , "nc")
  137. BUILTIN(__builtin_inff , "f" , "nc")
  138. BUILTIN(__builtin_infl , "Ld" , "nc")
  139. BUILTIN(__builtin_inff128 , "LLd" , "nc")
  140. BUILTIN(__builtin_labs , "LiLi" , "Fnc")
  141. BUILTIN(__builtin_llabs, "LLiLLi", "Fnc")
  142. BUILTIN(__builtin_ldexp , "ddi" , "Fne")
  143. BUILTIN(__builtin_ldexpf, "ffi" , "Fne")
  144. BUILTIN(__builtin_ldexpl, "LdLdi", "Fne")
  145. BUILTIN(__builtin_ldexpf128, "LLdLLdi", "Fne")
  146. BUILTIN(__builtin_modf , "ddd*" , "Fn")
  147. BUILTIN(__builtin_modff, "fff*" , "Fn")
  148. BUILTIN(__builtin_modfl, "LdLdLd*", "Fn")
  149. BUILTIN(__builtin_modff128, "LLdLLdLLd*", "Fn")
  150. BUILTIN(__builtin_nan, "dcC*" , "FnU")
  151. BUILTIN(__builtin_nanf, "fcC*" , "FnU")
  152. BUILTIN(__builtin_nanl, "LdcC*", "FnU")
  153. BUILTIN(__builtin_nanf128, "LLdcC*", "FnU")
  154. BUILTIN(__builtin_nans, "dcC*" , "FnU")
  155. BUILTIN(__builtin_nansf, "fcC*" , "FnU")
  156. BUILTIN(__builtin_nansl, "LdcC*", "FnU")
  157. BUILTIN(__builtin_nansf128, "LLdcC*", "FnU")
  158. BUILTIN(__builtin_powi , "ddi" , "Fnc")
  159. BUILTIN(__builtin_powif, "ffi" , "Fnc")
  160. BUILTIN(__builtin_powil, "LdLdi", "Fnc")
  161. BUILTIN(__builtin_pow , "ddd" , "Fne")
  162. BUILTIN(__builtin_powf, "fff" , "Fne")
  163. BUILTIN(__builtin_powf16, "hhh" , "Fne")
  164. BUILTIN(__builtin_powl, "LdLdLd", "Fne")
  165. BUILTIN(__builtin_powf128, "LLdLLdLLd", "Fne")
  166. // Standard unary libc/libm functions with double/float/long double variants:
  167. BUILTIN(__builtin_acos , "dd" , "Fne")
  168. BUILTIN(__builtin_acosf, "ff" , "Fne")
  169. BUILTIN(__builtin_acosl, "LdLd", "Fne")
  170. BUILTIN(__builtin_acosf128, "LLdLLd", "Fne")
  171. BUILTIN(__builtin_acosh , "dd" , "Fne")
  172. BUILTIN(__builtin_acoshf, "ff" , "Fne")
  173. BUILTIN(__builtin_acoshl, "LdLd", "Fne")
  174. BUILTIN(__builtin_acoshf128, "LLdLLd", "Fne")
  175. BUILTIN(__builtin_asin , "dd" , "Fne")
  176. BUILTIN(__builtin_asinf, "ff" , "Fne")
  177. BUILTIN(__builtin_asinl, "LdLd", "Fne")
  178. BUILTIN(__builtin_asinf128, "LLdLLd", "Fne")
  179. BUILTIN(__builtin_asinh , "dd" , "Fne")
  180. BUILTIN(__builtin_asinhf, "ff" , "Fne")
  181. BUILTIN(__builtin_asinhl, "LdLd", "Fne")
  182. BUILTIN(__builtin_asinhf128, "LLdLLd", "Fne")
  183. BUILTIN(__builtin_atan , "dd" , "Fne")
  184. BUILTIN(__builtin_atanf, "ff" , "Fne")
  185. BUILTIN(__builtin_atanl, "LdLd", "Fne")
  186. BUILTIN(__builtin_atanf128, "LLdLLd", "Fne")
  187. BUILTIN(__builtin_atanh , "dd", "Fne")
  188. BUILTIN(__builtin_atanhf, "ff", "Fne")
  189. BUILTIN(__builtin_atanhl, "LdLd", "Fne")
  190. BUILTIN(__builtin_atanhf128, "LLdLLd", "Fne")
  191. BUILTIN(__builtin_cbrt , "dd", "Fnc")
  192. BUILTIN(__builtin_cbrtf, "ff", "Fnc")
  193. BUILTIN(__builtin_cbrtl, "LdLd", "Fnc")
  194. BUILTIN(__builtin_cbrtf128, "LLdLLd", "Fnc")
  195. BUILTIN(__builtin_ceil , "dd" , "Fnc")
  196. BUILTIN(__builtin_ceilf, "ff" , "Fnc")
  197. BUILTIN(__builtin_ceilf16, "hh" , "Fnc")
  198. BUILTIN(__builtin_ceill, "LdLd", "Fnc")
  199. BUILTIN(__builtin_ceilf128, "LLdLLd", "Fnc")
  200. BUILTIN(__builtin_cos , "dd" , "Fne")
  201. BUILTIN(__builtin_cosf, "ff" , "Fne")
  202. BUILTIN(__builtin_cosf16, "hh" , "Fne")
  203. BUILTIN(__builtin_cosh , "dd" , "Fne")
  204. BUILTIN(__builtin_coshf, "ff" , "Fne")
  205. BUILTIN(__builtin_coshl, "LdLd", "Fne")
  206. BUILTIN(__builtin_coshf128, "LLdLLd", "Fne")
  207. BUILTIN(__builtin_cosl, "LdLd", "Fne")
  208. BUILTIN(__builtin_cosf128, "LLdLLd" , "Fne")
  209. BUILTIN(__builtin_erf , "dd", "Fne")
  210. BUILTIN(__builtin_erff, "ff", "Fne")
  211. BUILTIN(__builtin_erfl, "LdLd", "Fne")
  212. BUILTIN(__builtin_erff128, "LLdLLd", "Fne")
  213. BUILTIN(__builtin_erfc , "dd", "Fne")
  214. BUILTIN(__builtin_erfcf, "ff", "Fne")
  215. BUILTIN(__builtin_erfcl, "LdLd", "Fne")
  216. BUILTIN(__builtin_erfcf128, "LLdLLd", "Fne")
  217. BUILTIN(__builtin_exp , "dd" , "Fne")
  218. BUILTIN(__builtin_expf, "ff" , "Fne")
  219. BUILTIN(__builtin_expf16, "hh" , "Fne")
  220. BUILTIN(__builtin_expl, "LdLd", "Fne")
  221. BUILTIN(__builtin_expf128, "LLdLLd", "Fne")
  222. BUILTIN(__builtin_exp2 , "dd" , "Fne")
  223. BUILTIN(__builtin_exp2f, "ff" , "Fne")
  224. BUILTIN(__builtin_exp2f16, "hh" , "Fne")
  225. BUILTIN(__builtin_exp2l, "LdLd", "Fne")
  226. BUILTIN(__builtin_exp2f128, "LLdLLd" , "Fne")
  227. BUILTIN(__builtin_expm1 , "dd", "Fne")
  228. BUILTIN(__builtin_expm1f, "ff", "Fne")
  229. BUILTIN(__builtin_expm1l, "LdLd", "Fne")
  230. BUILTIN(__builtin_expm1f128, "LLdLLd", "Fne")
  231. BUILTIN(__builtin_fdim, "ddd", "Fne")
  232. BUILTIN(__builtin_fdimf, "fff", "Fne")
  233. BUILTIN(__builtin_fdiml, "LdLdLd", "Fne")
  234. BUILTIN(__builtin_fdimf128, "LLdLLdLLd", "Fne")
  235. BUILTIN(__builtin_floor , "dd" , "Fnc")
  236. BUILTIN(__builtin_floorf, "ff" , "Fnc")
  237. BUILTIN(__builtin_floorf16, "hh" , "Fnc")
  238. BUILTIN(__builtin_floorl, "LdLd", "Fnc")
  239. BUILTIN(__builtin_floorf128, "LLdLLd", "Fnc")
  240. BUILTIN(__builtin_fma, "dddd", "Fne")
  241. BUILTIN(__builtin_fmaf, "ffff", "Fne")
  242. BUILTIN(__builtin_fmaf16, "hhhh", "Fne")
  243. BUILTIN(__builtin_fmal, "LdLdLdLd", "Fne")
  244. BUILTIN(__builtin_fmaf128, "LLdLLdLLdLLd", "Fne")
  245. BUILTIN(__builtin_fmax, "ddd", "Fnc")
  246. BUILTIN(__builtin_fmaxf, "fff", "Fnc")
  247. BUILTIN(__builtin_fmaxf16, "hhh", "Fnc")
  248. BUILTIN(__builtin_fmaxl, "LdLdLd", "Fnc")
  249. BUILTIN(__builtin_fmaxf128, "LLdLLdLLd", "Fnc")
  250. BUILTIN(__builtin_fmin, "ddd", "Fnc")
  251. BUILTIN(__builtin_fminf, "fff", "Fnc")
  252. BUILTIN(__builtin_fminf16, "hhh", "Fnc")
  253. BUILTIN(__builtin_fminl, "LdLdLd", "Fnc")
  254. BUILTIN(__builtin_fminf128, "LLdLLdLLd", "Fnc")
  255. BUILTIN(__builtin_hypot , "ddd" , "Fne")
  256. BUILTIN(__builtin_hypotf, "fff" , "Fne")
  257. BUILTIN(__builtin_hypotl, "LdLdLd", "Fne")
  258. BUILTIN(__builtin_hypotf128, "LLdLLdLLd", "Fne")
  259. BUILTIN(__builtin_ilogb , "id", "Fne")
  260. BUILTIN(__builtin_ilogbf, "if", "Fne")
  261. BUILTIN(__builtin_ilogbl, "iLd", "Fne")
  262. BUILTIN(__builtin_ilogbf128, "iLLd", "Fne")
  263. BUILTIN(__builtin_lgamma , "dd", "Fn")
  264. BUILTIN(__builtin_lgammaf, "ff", "Fn")
  265. BUILTIN(__builtin_lgammal, "LdLd", "Fn")
  266. BUILTIN(__builtin_lgammaf128, "LLdLLd", "Fn")
  267. BUILTIN(__builtin_llrint, "LLid", "Fne")
  268. BUILTIN(__builtin_llrintf, "LLif", "Fne")
  269. BUILTIN(__builtin_llrintl, "LLiLd", "Fne")
  270. BUILTIN(__builtin_llrintf128, "LLiLLd", "Fne")
  271. BUILTIN(__builtin_llround , "LLid", "Fne")
  272. BUILTIN(__builtin_llroundf, "LLif", "Fne")
  273. BUILTIN(__builtin_llroundl, "LLiLd", "Fne")
  274. BUILTIN(__builtin_llroundf128, "LLiLLd", "Fne")
  275. BUILTIN(__builtin_log , "dd" , "Fne")
  276. BUILTIN(__builtin_log10 , "dd" , "Fne")
  277. BUILTIN(__builtin_log10f, "ff" , "Fne")
  278. BUILTIN(__builtin_log10f16, "hh" , "Fne")
  279. BUILTIN(__builtin_log10l, "LdLd", "Fne")
  280. BUILTIN(__builtin_log10f128, "LLdLLd" , "Fne")
  281. BUILTIN(__builtin_log1p , "dd" , "Fne")
  282. BUILTIN(__builtin_log1pf, "ff" , "Fne")
  283. BUILTIN(__builtin_log1pl, "LdLd", "Fne")
  284. BUILTIN(__builtin_log1pf128, "LLdLLd", "Fne")
  285. BUILTIN(__builtin_log2, "dd" , "Fne")
  286. BUILTIN(__builtin_log2f, "ff" , "Fne")
  287. BUILTIN(__builtin_log2f16, "hh" , "Fne")
  288. BUILTIN(__builtin_log2l, "LdLd" , "Fne")
  289. BUILTIN(__builtin_log2f128, "LLdLLd" , "Fne")
  290. BUILTIN(__builtin_logb , "dd", "Fne")
  291. BUILTIN(__builtin_logbf, "ff", "Fne")
  292. BUILTIN(__builtin_logbl, "LdLd", "Fne")
  293. BUILTIN(__builtin_logbf128, "LLdLLd", "Fne")
  294. BUILTIN(__builtin_logf, "ff" , "Fne")
  295. BUILTIN(__builtin_logf16, "hh" , "Fne")
  296. BUILTIN(__builtin_logl, "LdLd", "Fne")
  297. BUILTIN(__builtin_logf128, "LLdLLd", "Fne")
  298. BUILTIN(__builtin_lrint , "Lid", "Fne")
  299. BUILTIN(__builtin_lrintf, "Lif", "Fne")
  300. BUILTIN(__builtin_lrintl, "LiLd", "Fne")
  301. BUILTIN(__builtin_lrintf128, "LiLLd", "Fne")
  302. BUILTIN(__builtin_lround , "Lid", "Fne")
  303. BUILTIN(__builtin_lroundf, "Lif", "Fne")
  304. BUILTIN(__builtin_lroundl, "LiLd", "Fne")
  305. BUILTIN(__builtin_lroundf128, "LiLLd", "Fne")
  306. BUILTIN(__builtin_nearbyint , "dd", "Fnc")
  307. BUILTIN(__builtin_nearbyintf, "ff", "Fnc")
  308. BUILTIN(__builtin_nearbyintl, "LdLd", "Fnc")
  309. BUILTIN(__builtin_nearbyintf128, "LLdLLd", "Fnc")
  310. BUILTIN(__builtin_nextafter , "ddd", "Fne")
  311. BUILTIN(__builtin_nextafterf, "fff", "Fne")
  312. BUILTIN(__builtin_nextafterl, "LdLdLd", "Fne")
  313. BUILTIN(__builtin_nextafterf128, "LLdLLdLLd", "Fne")
  314. BUILTIN(__builtin_nexttoward , "ddLd", "Fne")
  315. BUILTIN(__builtin_nexttowardf, "ffLd", "Fne")
  316. BUILTIN(__builtin_nexttowardl, "LdLdLd", "Fne")
  317. BUILTIN(__builtin_nexttowardf128, "LLdLLdLLd", "Fne")
  318. BUILTIN(__builtin_remainder , "ddd", "Fne")
  319. BUILTIN(__builtin_remainderf, "fff", "Fne")
  320. BUILTIN(__builtin_remainderl, "LdLdLd", "Fne")
  321. BUILTIN(__builtin_remainderf128, "LLdLLdLLd", "Fne")
  322. BUILTIN(__builtin_remquo , "dddi*", "Fn")
  323. BUILTIN(__builtin_remquof, "fffi*", "Fn")
  324. BUILTIN(__builtin_remquol, "LdLdLdi*", "Fn")
  325. BUILTIN(__builtin_remquof128, "LLdLLdLLdi*", "Fn")
  326. BUILTIN(__builtin_rint , "dd", "Fnc")
  327. BUILTIN(__builtin_rintf, "ff", "Fnc")
  328. BUILTIN(__builtin_rintf16, "hh", "Fnc")
  329. BUILTIN(__builtin_rintl, "LdLd", "Fnc")
  330. BUILTIN(__builtin_rintf128, "LLdLLd", "Fnc")
  331. BUILTIN(__builtin_round, "dd" , "Fnc")
  332. BUILTIN(__builtin_roundf, "ff" , "Fnc")
  333. BUILTIN(__builtin_roundf16, "hh" , "Fnc")
  334. BUILTIN(__builtin_roundl, "LdLd" , "Fnc")
  335. BUILTIN(__builtin_roundf128, "LLdLLd" , "Fnc")
  336. BUILTIN(__builtin_scalbln , "ddLi", "Fne")
  337. BUILTIN(__builtin_scalblnf, "ffLi", "Fne")
  338. BUILTIN(__builtin_scalblnl, "LdLdLi", "Fne")
  339. BUILTIN(__builtin_scalblnf128, "LLdLLdLi", "Fne")
  340. BUILTIN(__builtin_scalbn , "ddi", "Fne")
  341. BUILTIN(__builtin_scalbnf, "ffi", "Fne")
  342. BUILTIN(__builtin_scalbnl, "LdLdi", "Fne")
  343. BUILTIN(__builtin_scalbnf128, "LLdLLdi", "Fne")
  344. BUILTIN(__builtin_sin , "dd" , "Fne")
  345. BUILTIN(__builtin_sinf, "ff" , "Fne")
  346. BUILTIN(__builtin_sinf16, "hh" , "Fne")
  347. BUILTIN(__builtin_sinh , "dd" , "Fne")
  348. BUILTIN(__builtin_sinhf, "ff" , "Fne")
  349. BUILTIN(__builtin_sinhl, "LdLd", "Fne")
  350. BUILTIN(__builtin_sinhf128, "LLdLLd", "Fne")
  351. BUILTIN(__builtin_sinl, "LdLd", "Fne")
  352. BUILTIN(__builtin_sinf128, "LLdLLd" , "Fne")
  353. BUILTIN(__builtin_sqrt , "dd" , "Fne")
  354. BUILTIN(__builtin_sqrtf, "ff" , "Fne")
  355. BUILTIN(__builtin_sqrtf16, "hh" , "Fne")
  356. BUILTIN(__builtin_sqrtl, "LdLd", "Fne")
  357. BUILTIN(__builtin_sqrtf128, "LLdLLd", "Fne")
  358. BUILTIN(__builtin_tan , "dd" , "Fne")
  359. BUILTIN(__builtin_tanf, "ff" , "Fne")
  360. BUILTIN(__builtin_tanh , "dd" , "Fne")
  361. BUILTIN(__builtin_tanhf, "ff" , "Fne")
  362. BUILTIN(__builtin_tanhl, "LdLd", "Fne")
  363. BUILTIN(__builtin_tanhf128, "LLdLLd", "Fne")
  364. BUILTIN(__builtin_tanl, "LdLd", "Fne")
  365. BUILTIN(__builtin_tanf128, "LLdLLd" , "Fne")
  366. BUILTIN(__builtin_tgamma , "dd", "Fne")
  367. BUILTIN(__builtin_tgammaf, "ff", "Fne")
  368. BUILTIN(__builtin_tgammal, "LdLd", "Fne")
  369. BUILTIN(__builtin_tgammaf128, "LLdLLd", "Fne")
  370. BUILTIN(__builtin_trunc , "dd", "Fnc")
  371. BUILTIN(__builtin_truncf, "ff", "Fnc")
  372. BUILTIN(__builtin_truncl, "LdLd", "Fnc")
  373. BUILTIN(__builtin_truncf128, "LLdLLd", "Fnc")
  374. BUILTIN(__builtin_truncf16, "hh", "Fnc")
  375. // Access to floating point environment
  376. BUILTIN(__builtin_flt_rounds, "i", "n")
  377. // C99 complex builtins
  378. BUILTIN(__builtin_cabs, "dXd", "Fne")
  379. BUILTIN(__builtin_cabsf, "fXf", "Fne")
  380. BUILTIN(__builtin_cabsl, "LdXLd", "Fne")
  381. BUILTIN(__builtin_cacos, "XdXd", "Fne")
  382. BUILTIN(__builtin_cacosf, "XfXf", "Fne")
  383. BUILTIN(__builtin_cacosh, "XdXd", "Fne")
  384. BUILTIN(__builtin_cacoshf, "XfXf", "Fne")
  385. BUILTIN(__builtin_cacoshl, "XLdXLd", "Fne")
  386. BUILTIN(__builtin_cacosl, "XLdXLd", "Fne")
  387. BUILTIN(__builtin_carg, "dXd", "Fne")
  388. BUILTIN(__builtin_cargf, "fXf", "Fne")
  389. BUILTIN(__builtin_cargl, "LdXLd", "Fne")
  390. BUILTIN(__builtin_casin, "XdXd", "Fne")
  391. BUILTIN(__builtin_casinf, "XfXf", "Fne")
  392. BUILTIN(__builtin_casinh, "XdXd", "Fne")
  393. BUILTIN(__builtin_casinhf, "XfXf", "Fne")
  394. BUILTIN(__builtin_casinhl, "XLdXLd", "Fne")
  395. BUILTIN(__builtin_casinl, "XLdXLd", "Fne")
  396. BUILTIN(__builtin_catan, "XdXd", "Fne")
  397. BUILTIN(__builtin_catanf, "XfXf", "Fne")
  398. BUILTIN(__builtin_catanh, "XdXd", "Fne")
  399. BUILTIN(__builtin_catanhf, "XfXf", "Fne")
  400. BUILTIN(__builtin_catanhl, "XLdXLd", "Fne")
  401. BUILTIN(__builtin_catanl, "XLdXLd", "Fne")
  402. BUILTIN(__builtin_ccos, "XdXd", "Fne")
  403. BUILTIN(__builtin_ccosf, "XfXf", "Fne")
  404. BUILTIN(__builtin_ccosl, "XLdXLd", "Fne")
  405. BUILTIN(__builtin_ccosh, "XdXd", "Fne")
  406. BUILTIN(__builtin_ccoshf, "XfXf", "Fne")
  407. BUILTIN(__builtin_ccoshl, "XLdXLd", "Fne")
  408. BUILTIN(__builtin_cexp, "XdXd", "Fne")
  409. BUILTIN(__builtin_cexpf, "XfXf", "Fne")
  410. BUILTIN(__builtin_cexpl, "XLdXLd", "Fne")
  411. BUILTIN(__builtin_cimag, "dXd", "Fnc")
  412. BUILTIN(__builtin_cimagf, "fXf", "Fnc")
  413. BUILTIN(__builtin_cimagl, "LdXLd", "Fnc")
  414. BUILTIN(__builtin_conj, "XdXd", "Fnc")
  415. BUILTIN(__builtin_conjf, "XfXf", "Fnc")
  416. BUILTIN(__builtin_conjl, "XLdXLd", "Fnc")
  417. BUILTIN(__builtin_clog, "XdXd", "Fne")
  418. BUILTIN(__builtin_clogf, "XfXf", "Fne")
  419. BUILTIN(__builtin_clogl, "XLdXLd", "Fne")
  420. BUILTIN(__builtin_cproj, "XdXd", "Fnc")
  421. BUILTIN(__builtin_cprojf, "XfXf", "Fnc")
  422. BUILTIN(__builtin_cprojl, "XLdXLd", "Fnc")
  423. BUILTIN(__builtin_cpow, "XdXdXd", "Fne")
  424. BUILTIN(__builtin_cpowf, "XfXfXf", "Fne")
  425. BUILTIN(__builtin_cpowl, "XLdXLdXLd", "Fne")
  426. BUILTIN(__builtin_creal, "dXd", "Fnc")
  427. BUILTIN(__builtin_crealf, "fXf", "Fnc")
  428. BUILTIN(__builtin_creall, "LdXLd", "Fnc")
  429. BUILTIN(__builtin_csin, "XdXd", "Fne")
  430. BUILTIN(__builtin_csinf, "XfXf", "Fne")
  431. BUILTIN(__builtin_csinl, "XLdXLd", "Fne")
  432. BUILTIN(__builtin_csinh, "XdXd", "Fne")
  433. BUILTIN(__builtin_csinhf, "XfXf", "Fne")
  434. BUILTIN(__builtin_csinhl, "XLdXLd", "Fne")
  435. BUILTIN(__builtin_csqrt, "XdXd", "Fne")
  436. BUILTIN(__builtin_csqrtf, "XfXf", "Fne")
  437. BUILTIN(__builtin_csqrtl, "XLdXLd", "Fne")
  438. BUILTIN(__builtin_ctan, "XdXd", "Fne")
  439. BUILTIN(__builtin_ctanf, "XfXf", "Fne")
  440. BUILTIN(__builtin_ctanl, "XLdXLd", "Fne")
  441. BUILTIN(__builtin_ctanh, "XdXd", "Fne")
  442. BUILTIN(__builtin_ctanhf, "XfXf", "Fne")
  443. BUILTIN(__builtin_ctanhl, "XLdXLd", "Fne")
  444. // GCC-compatible C99 CMPLX implementation.
  445. BUILTIN(__builtin_complex, "v.", "nct")
  446. // FP Comparisons.
  447. BUILTIN(__builtin_isgreater , "i.", "Fnct")
  448. BUILTIN(__builtin_isgreaterequal, "i.", "Fnct")
  449. BUILTIN(__builtin_isless , "i.", "Fnct")
  450. BUILTIN(__builtin_islessequal , "i.", "Fnct")
  451. BUILTIN(__builtin_islessgreater , "i.", "Fnct")
  452. BUILTIN(__builtin_isunordered , "i.", "Fnct")
  453. // Unary FP classification
  454. BUILTIN(__builtin_fpclassify, "iiiiii.", "Fnct")
  455. BUILTIN(__builtin_isfinite, "i.", "Fnct")
  456. BUILTIN(__builtin_isinf, "i.", "Fnct")
  457. BUILTIN(__builtin_isinf_sign, "i.", "Fnct")
  458. BUILTIN(__builtin_isnan, "i.", "Fnct")
  459. BUILTIN(__builtin_isnormal, "i.", "Fnct")
  460. // FP signbit builtins
  461. BUILTIN(__builtin_signbit, "i.", "Fnct")
  462. BUILTIN(__builtin_signbitf, "if", "Fnc")
  463. BUILTIN(__builtin_signbitl, "iLd", "Fnc")
  464. // Special FP builtins.
  465. BUILTIN(__builtin_canonicalize, "dd", "nc")
  466. BUILTIN(__builtin_canonicalizef, "ff", "nc")
  467. BUILTIN(__builtin_canonicalizef16, "hh", "nc")
  468. BUILTIN(__builtin_canonicalizel, "LdLd", "nc")
  469. // Builtins for arithmetic.
  470. BUILTIN(__builtin_clzs , "iUs" , "nc")
  471. BUILTIN(__builtin_clz , "iUi" , "nc")
  472. BUILTIN(__builtin_clzl , "iULi" , "nc")
  473. BUILTIN(__builtin_clzll, "iULLi", "nc")
  474. // TODO: int clzimax(uintmax_t)
  475. BUILTIN(__builtin_ctzs , "iUs" , "nc")
  476. BUILTIN(__builtin_ctz , "iUi" , "nc")
  477. BUILTIN(__builtin_ctzl , "iULi" , "nc")
  478. BUILTIN(__builtin_ctzll, "iULLi", "nc")
  479. // TODO: int ctzimax(uintmax_t)
  480. BUILTIN(__builtin_ffs , "ii" , "Fnc")
  481. BUILTIN(__builtin_ffsl , "iLi" , "Fnc")
  482. BUILTIN(__builtin_ffsll, "iLLi", "Fnc")
  483. BUILTIN(__builtin_parity , "iUi" , "nc")
  484. BUILTIN(__builtin_parityl , "iULi" , "nc")
  485. BUILTIN(__builtin_parityll, "iULLi", "nc")
  486. BUILTIN(__builtin_popcount , "iUi" , "nc")
  487. BUILTIN(__builtin_popcountl , "iULi" , "nc")
  488. BUILTIN(__builtin_popcountll, "iULLi", "nc")
  489. BUILTIN(__builtin_clrsb , "ii" , "nc")
  490. BUILTIN(__builtin_clrsbl , "iLi" , "nc")
  491. BUILTIN(__builtin_clrsbll, "iLLi", "nc")
  492. // The following builtins rely on that char == 8 bits, short == 16 bits and that
  493. // there exists native types on the target that are 32- and 64-bits wide, unless
  494. // these conditions are fulfilled these builtins will operate on a not intended
  495. // bitwidth.
  496. BUILTIN(__builtin_bswap16, "UsUs", "nc")
  497. BUILTIN(__builtin_bswap32, "UZiUZi", "nc")
  498. BUILTIN(__builtin_bswap64, "UWiUWi", "nc")
  499. BUILTIN(__builtin_bitreverse8, "UcUc", "nc")
  500. BUILTIN(__builtin_bitreverse16, "UsUs", "nc")
  501. BUILTIN(__builtin_bitreverse32, "UZiUZi", "nc")
  502. BUILTIN(__builtin_bitreverse64, "UWiUWi", "nc")
  503. BUILTIN(__builtin_rotateleft8, "UcUcUc", "nc")
  504. BUILTIN(__builtin_rotateleft16, "UsUsUs", "nc")
  505. BUILTIN(__builtin_rotateleft32, "UZiUZiUZi", "nc")
  506. BUILTIN(__builtin_rotateleft64, "UWiUWiUWi", "nc")
  507. BUILTIN(__builtin_rotateright8, "UcUcUc", "nc")
  508. BUILTIN(__builtin_rotateright16, "UsUsUs", "nc")
  509. BUILTIN(__builtin_rotateright32, "UZiUZiUZi", "nc")
  510. BUILTIN(__builtin_rotateright64, "UWiUWiUWi", "nc")
  511. // Random GCC builtins
  512. BUILTIN(__builtin_calloc, "v*zz", "nF")
  513. BUILTIN(__builtin_constant_p, "i.", "nctu")
  514. BUILTIN(__builtin_classify_type, "i.", "nctu")
  515. BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "nc")
  516. BUILTIN(__builtin___NSStringMakeConstantString, "FC*cC*", "nc")
  517. BUILTIN(__builtin_va_start, "vA.", "nt")
  518. BUILTIN(__builtin_va_end, "vA", "n")
  519. BUILTIN(__builtin_va_copy, "vAA", "n")
  520. BUILTIN(__builtin_stdarg_start, "vA.", "nt")
  521. BUILTIN(__builtin_assume_aligned, "v*vC*z.", "nc")
  522. BUILTIN(__builtin_bcmp, "ivC*vC*z", "Fn")
  523. BUILTIN(__builtin_bcopy, "vv*v*z", "n")
  524. BUILTIN(__builtin_bzero, "vv*z", "nF")
  525. BUILTIN(__builtin_fprintf, "iP*cC*.", "Fp:1:")
  526. BUILTIN(__builtin_free, "vv*", "nF")
  527. BUILTIN(__builtin_malloc, "v*z", "nF")
  528. BUILTIN(__builtin_memchr, "v*vC*iz", "nF")
  529. BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF")
  530. BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF")
  531. BUILTIN(__builtin_memcpy_inline, "vv*vC*Iz", "nt")
  532. BUILTIN(__builtin_memmove, "v*v*vC*z", "nF")
  533. BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF")
  534. BUILTIN(__builtin_memset, "v*v*iz", "nF")
  535. BUILTIN(__builtin_printf, "icC*.", "Fp:0:")
  536. BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF")
  537. BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF")
  538. BUILTIN(__builtin_strcasecmp, "icC*cC*", "nF")
  539. BUILTIN(__builtin_strcat, "c*c*cC*", "nF")
  540. BUILTIN(__builtin_strchr, "c*cC*i", "nF")
  541. BUILTIN(__builtin_strcmp, "icC*cC*", "nF")
  542. BUILTIN(__builtin_strcpy, "c*c*cC*", "nF")
  543. BUILTIN(__builtin_strcspn, "zcC*cC*", "nF")
  544. BUILTIN(__builtin_strdup, "c*cC*", "nF")
  545. BUILTIN(__builtin_strlen, "zcC*", "nF")
  546. BUILTIN(__builtin_strncasecmp, "icC*cC*z", "nF")
  547. BUILTIN(__builtin_strncat, "c*c*cC*z", "nF")
  548. BUILTIN(__builtin_strncmp, "icC*cC*z", "nF")
  549. BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF")
  550. BUILTIN(__builtin_strndup, "c*cC*z", "nF")
  551. BUILTIN(__builtin_strpbrk, "c*cC*cC*", "nF")
  552. BUILTIN(__builtin_strrchr, "c*cC*i", "nF")
  553. BUILTIN(__builtin_strspn, "zcC*cC*", "nF")
  554. BUILTIN(__builtin_strstr, "c*cC*cC*", "nF")
  555. BUILTIN(__builtin_wcschr, "w*wC*w", "nF")
  556. BUILTIN(__builtin_wcscmp, "iwC*wC*", "nF")
  557. BUILTIN(__builtin_wcslen, "zwC*", "nF")
  558. BUILTIN(__builtin_wcsncmp, "iwC*wC*z", "nF")
  559. BUILTIN(__builtin_wmemchr, "w*wC*wz", "nF")
  560. BUILTIN(__builtin_wmemcmp, "iwC*wC*z", "nF")
  561. BUILTIN(__builtin_wmemcpy, "w*w*wC*z", "nF")
  562. BUILTIN(__builtin_wmemmove, "w*w*wC*z", "nF")
  563. BUILTIN(__builtin_realloc, "v*v*z", "nF")
  564. BUILTIN(__builtin_return_address, "v*IUi", "n")
  565. BUILTIN(__builtin_extract_return_addr, "v*v*", "n")
  566. BUILTIN(__builtin_frame_address, "v*IUi", "n")
  567. BUILTIN(__builtin___clear_cache, "vc*c*", "n")
  568. BUILTIN(__builtin_setjmp, "iv**", "j")
  569. BUILTIN(__builtin_longjmp, "vv**i", "r")
  570. BUILTIN(__builtin_unwind_init, "v", "")
  571. BUILTIN(__builtin_eh_return_data_regno, "iIi", "nc")
  572. BUILTIN(__builtin_snprintf, "ic*zcC*.", "nFp:2:")
  573. BUILTIN(__builtin_sprintf, "ic*cC*.", "nFP:1:")
  574. BUILTIN(__builtin_vsnprintf, "ic*zcC*a", "nFP:2:")
  575. BUILTIN(__builtin_vsprintf, "ic*cC*a", "nFP:1:")
  576. BUILTIN(__builtin_thread_pointer, "v*", "nc")
  577. BUILTIN(__builtin_launder, "v*v*", "nt")
  578. LANGBUILTIN(__builtin_is_constant_evaluated, "b", "n", CXX_LANG)
  579. // GCC exception builtins
  580. BUILTIN(__builtin_eh_return, "vzv*", "r") // FIXME: Takes intptr_t, not size_t!
  581. BUILTIN(__builtin_frob_return_addr, "v*v*", "n")
  582. BUILTIN(__builtin_dwarf_cfa, "v*", "n")
  583. BUILTIN(__builtin_init_dwarf_reg_size_table, "vv*", "n")
  584. BUILTIN(__builtin_dwarf_sp_column, "Ui", "n")
  585. BUILTIN(__builtin_extend_pointer, "ULLiv*", "n") // _Unwind_Word == uint64_t
  586. // GCC Object size checking builtins
  587. BUILTIN(__builtin_object_size, "zvC*i", "nu")
  588. BUILTIN(__builtin_dynamic_object_size, "zvC*i", "nu") // Clang only.
  589. BUILTIN(__builtin___memcpy_chk, "v*v*vC*zz", "nF")
  590. BUILTIN(__builtin___memccpy_chk, "v*v*vC*izz", "nF")
  591. BUILTIN(__builtin___memmove_chk, "v*v*vC*zz", "nF")
  592. BUILTIN(__builtin___mempcpy_chk, "v*v*vC*zz", "nF")
  593. BUILTIN(__builtin___memset_chk, "v*v*izz", "nF")
  594. BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z", "nF")
  595. BUILTIN(__builtin___strcat_chk, "c*c*cC*z", "nF")
  596. BUILTIN(__builtin___strcpy_chk, "c*c*cC*z", "nF")
  597. BUILTIN(__builtin___strlcat_chk, "zc*cC*zz", "nF")
  598. BUILTIN(__builtin___strlcpy_chk, "zc*cC*zz", "nF")
  599. BUILTIN(__builtin___strncat_chk, "c*c*cC*zz", "nF")
  600. BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz", "nF")
  601. BUILTIN(__builtin___stpncpy_chk, "c*c*cC*zz", "nF")
  602. BUILTIN(__builtin___snprintf_chk, "ic*zizcC*.", "Fp:4:")
  603. BUILTIN(__builtin___sprintf_chk, "ic*izcC*.", "Fp:3:")
  604. BUILTIN(__builtin___vsnprintf_chk, "ic*zizcC*a", "FP:4:")
  605. BUILTIN(__builtin___vsprintf_chk, "ic*izcC*a", "FP:3:")
  606. BUILTIN(__builtin___fprintf_chk, "iP*icC*.", "Fp:2:")
  607. BUILTIN(__builtin___printf_chk, "iicC*.", "Fp:1:")
  608. BUILTIN(__builtin___vfprintf_chk, "iP*icC*a", "FP:2:")
  609. BUILTIN(__builtin___vprintf_chk, "iicC*a", "FP:1:")
  610. BUILTIN(__builtin_unpredictable, "LiLi" , "nc")
  611. BUILTIN(__builtin_expect, "LiLiLi" , "nc")
  612. BUILTIN(__builtin_expect_with_probability, "LiLiLid", "nc")
  613. BUILTIN(__builtin_prefetch, "vvC*.", "nc")
  614. BUILTIN(__builtin_readcyclecounter, "ULLi", "n")
  615. BUILTIN(__builtin_trap, "v", "nr")
  616. BUILTIN(__builtin_debugtrap, "v", "n")
  617. BUILTIN(__builtin_unreachable, "v", "nr")
  618. BUILTIN(__builtin_shufflevector, "v." , "nct")
  619. BUILTIN(__builtin_convertvector, "v." , "nct")
  620. BUILTIN(__builtin_alloca, "v*z" , "Fn")
  621. BUILTIN(__builtin_alloca_uninitialized, "v*z", "Fn")
  622. BUILTIN(__builtin_alloca_with_align, "v*zIz", "Fn")
  623. BUILTIN(__builtin_alloca_with_align_uninitialized, "v*zIz", "Fn")
  624. BUILTIN(__builtin_call_with_static_chain, "v.", "nt")
  625. BUILTIN(__builtin_elementwise_abs, "v.", "nct")
  626. BUILTIN(__builtin_elementwise_max, "v.", "nct")
  627. BUILTIN(__builtin_elementwise_min, "v.", "nct")
  628. BUILTIN(__builtin_elementwise_ceil, "v.", "nct")
  629. BUILTIN(__builtin_elementwise_floor, "v.", "nct")
  630. BUILTIN(__builtin_elementwise_roundeven, "v.", "nct")
  631. BUILTIN(__builtin_elementwise_trunc, "v.", "nct")
  632. BUILTIN(__builtin_reduce_max, "v.", "nct")
  633. BUILTIN(__builtin_reduce_min, "v.", "nct")
  634. BUILTIN(__builtin_reduce_xor, "v.", "nct")
  635. BUILTIN(__builtin_reduce_or, "v.", "nct")
  636. BUILTIN(__builtin_reduce_and, "v.", "nct")
  637. BUILTIN(__builtin_matrix_transpose, "v.", "nFt")
  638. BUILTIN(__builtin_matrix_column_major_load, "v.", "nFt")
  639. BUILTIN(__builtin_matrix_column_major_store, "v.", "nFt")
  640. // "Overloaded" Atomic operator builtins. These are overloaded to support data
  641. // types of i8, i16, i32, i64, and i128. The front-end sees calls to the
  642. // non-suffixed version of these (which has a bogus type) and transforms them to
  643. // the right overloaded version in Sema (plus casts).
  644. // FIXME: These assume that char -> i8, short -> i16, int -> i32,
  645. // long long -> i64.
  646. BUILTIN(__sync_fetch_and_add, "v.", "t")
  647. BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "nt")
  648. BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "nt")
  649. BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "nt")
  650. BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "nt")
  651. BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "nt")
  652. BUILTIN(__sync_fetch_and_sub, "v.", "t")
  653. BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "nt")
  654. BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "nt")
  655. BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "nt")
  656. BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "nt")
  657. BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "nt")
  658. BUILTIN(__sync_fetch_and_or, "v.", "t")
  659. BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "nt")
  660. BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "nt")
  661. BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "nt")
  662. BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "nt")
  663. BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "nt")
  664. BUILTIN(__sync_fetch_and_and, "v.", "t")
  665. BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "tn")
  666. BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "tn")
  667. BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "tn")
  668. BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "tn")
  669. BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "tn")
  670. BUILTIN(__sync_fetch_and_xor, "v.", "t")
  671. BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "tn")
  672. BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "tn")
  673. BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "tn")
  674. BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "tn")
  675. BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "tn")
  676. BUILTIN(__sync_fetch_and_nand, "v.", "t")
  677. BUILTIN(__sync_fetch_and_nand_1, "ccD*c.", "tn")
  678. BUILTIN(__sync_fetch_and_nand_2, "ssD*s.", "tn")
  679. BUILTIN(__sync_fetch_and_nand_4, "iiD*i.", "tn")
  680. BUILTIN(__sync_fetch_and_nand_8, "LLiLLiD*LLi.", "tn")
  681. BUILTIN(__sync_fetch_and_nand_16, "LLLiLLLiD*LLLi.", "tn")
  682. BUILTIN(__sync_add_and_fetch, "v.", "t")
  683. BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "tn")
  684. BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "tn")
  685. BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "tn")
  686. BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "tn")
  687. BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
  688. BUILTIN(__sync_sub_and_fetch, "v.", "t")
  689. BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "tn")
  690. BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "tn")
  691. BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "tn")
  692. BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "tn")
  693. BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
  694. BUILTIN(__sync_or_and_fetch, "v.", "t")
  695. BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "tn")
  696. BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "tn")
  697. BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "tn")
  698. BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "tn")
  699. BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
  700. BUILTIN(__sync_and_and_fetch, "v.", "t")
  701. BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "tn")
  702. BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "tn")
  703. BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "tn")
  704. BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "tn")
  705. BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
  706. BUILTIN(__sync_xor_and_fetch, "v.", "t")
  707. BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "tn")
  708. BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "tn")
  709. BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "tn")
  710. BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "tn")
  711. BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
  712. BUILTIN(__sync_nand_and_fetch, "v.", "t")
  713. BUILTIN(__sync_nand_and_fetch_1, "ccD*c.", "tn")
  714. BUILTIN(__sync_nand_and_fetch_2, "ssD*s.", "tn")
  715. BUILTIN(__sync_nand_and_fetch_4, "iiD*i.", "tn")
  716. BUILTIN(__sync_nand_and_fetch_8, "LLiLLiD*LLi.", "tn")
  717. BUILTIN(__sync_nand_and_fetch_16, "LLLiLLLiD*LLLi.", "tn")
  718. BUILTIN(__sync_bool_compare_and_swap, "v.", "t")
  719. BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "tn")
  720. BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "tn")
  721. BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "tn")
  722. BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "tn")
  723. BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "tn")
  724. BUILTIN(__sync_val_compare_and_swap, "v.", "t")
  725. BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "tn")
  726. BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "tn")
  727. BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "tn")
  728. BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "tn")
  729. BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "tn")
  730. BUILTIN(__sync_lock_test_and_set, "v.", "t")
  731. BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "tn")
  732. BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "tn")
  733. BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "tn")
  734. BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "tn")
  735. BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "tn")
  736. BUILTIN(__sync_lock_release, "v.", "t")
  737. BUILTIN(__sync_lock_release_1, "vcD*.", "tn")
  738. BUILTIN(__sync_lock_release_2, "vsD*.", "tn")
  739. BUILTIN(__sync_lock_release_4, "viD*.", "tn")
  740. BUILTIN(__sync_lock_release_8, "vLLiD*.", "tn")
  741. BUILTIN(__sync_lock_release_16, "vLLLiD*.", "tn")
  742. BUILTIN(__sync_swap, "v.", "t")
  743. BUILTIN(__sync_swap_1, "ccD*c.", "tn")
  744. BUILTIN(__sync_swap_2, "ssD*s.", "tn")
  745. BUILTIN(__sync_swap_4, "iiD*i.", "tn")
  746. BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "tn")
  747. BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "tn")
  748. // Some of our atomics builtins are handled by AtomicExpr rather than
  749. // as normal builtin CallExprs. This macro is used for such builtins.
  750. #ifndef ATOMIC_BUILTIN
  751. #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) BUILTIN(ID, TYPE, ATTRS)
  752. #endif
  753. // C11 _Atomic operations for <stdatomic.h>.
  754. ATOMIC_BUILTIN(__c11_atomic_init, "v.", "t")
  755. ATOMIC_BUILTIN(__c11_atomic_load, "v.", "t")
  756. ATOMIC_BUILTIN(__c11_atomic_store, "v.", "t")
  757. ATOMIC_BUILTIN(__c11_atomic_exchange, "v.", "t")
  758. ATOMIC_BUILTIN(__c11_atomic_compare_exchange_strong, "v.", "t")
  759. ATOMIC_BUILTIN(__c11_atomic_compare_exchange_weak, "v.", "t")
  760. ATOMIC_BUILTIN(__c11_atomic_fetch_add, "v.", "t")
  761. ATOMIC_BUILTIN(__c11_atomic_fetch_sub, "v.", "t")
  762. ATOMIC_BUILTIN(__c11_atomic_fetch_and, "v.", "t")
  763. ATOMIC_BUILTIN(__c11_atomic_fetch_or, "v.", "t")
  764. ATOMIC_BUILTIN(__c11_atomic_fetch_xor, "v.", "t")
  765. ATOMIC_BUILTIN(__c11_atomic_fetch_nand, "v.", "t")
  766. ATOMIC_BUILTIN(__c11_atomic_fetch_max, "v.", "t")
  767. ATOMIC_BUILTIN(__c11_atomic_fetch_min, "v.", "t")
  768. BUILTIN(__c11_atomic_thread_fence, "vi", "n")
  769. BUILTIN(__c11_atomic_signal_fence, "vi", "n")
  770. BUILTIN(__c11_atomic_is_lock_free, "bz", "n")
  771. // GNU atomic builtins.
  772. ATOMIC_BUILTIN(__atomic_load, "v.", "t")
  773. ATOMIC_BUILTIN(__atomic_load_n, "v.", "t")
  774. ATOMIC_BUILTIN(__atomic_store, "v.", "t")
  775. ATOMIC_BUILTIN(__atomic_store_n, "v.", "t")
  776. ATOMIC_BUILTIN(__atomic_exchange, "v.", "t")
  777. ATOMIC_BUILTIN(__atomic_exchange_n, "v.", "t")
  778. ATOMIC_BUILTIN(__atomic_compare_exchange, "v.", "t")
  779. ATOMIC_BUILTIN(__atomic_compare_exchange_n, "v.", "t")
  780. ATOMIC_BUILTIN(__atomic_fetch_add, "v.", "t")
  781. ATOMIC_BUILTIN(__atomic_fetch_sub, "v.", "t")
  782. ATOMIC_BUILTIN(__atomic_fetch_and, "v.", "t")
  783. ATOMIC_BUILTIN(__atomic_fetch_or, "v.", "t")
  784. ATOMIC_BUILTIN(__atomic_fetch_xor, "v.", "t")
  785. ATOMIC_BUILTIN(__atomic_fetch_nand, "v.", "t")
  786. ATOMIC_BUILTIN(__atomic_add_fetch, "v.", "t")
  787. ATOMIC_BUILTIN(__atomic_sub_fetch, "v.", "t")
  788. ATOMIC_BUILTIN(__atomic_and_fetch, "v.", "t")
  789. ATOMIC_BUILTIN(__atomic_or_fetch, "v.", "t")
  790. ATOMIC_BUILTIN(__atomic_xor_fetch, "v.", "t")
  791. ATOMIC_BUILTIN(__atomic_max_fetch, "v.", "t")
  792. ATOMIC_BUILTIN(__atomic_min_fetch, "v.", "t")
  793. ATOMIC_BUILTIN(__atomic_nand_fetch, "v.", "t")
  794. BUILTIN(__atomic_test_and_set, "bvD*i", "n")
  795. BUILTIN(__atomic_clear, "vvD*i", "n")
  796. BUILTIN(__atomic_thread_fence, "vi", "n")
  797. BUILTIN(__atomic_signal_fence, "vi", "n")
  798. BUILTIN(__atomic_always_lock_free, "bzvCD*", "n")
  799. BUILTIN(__atomic_is_lock_free, "bzvCD*", "n")
  800. // OpenCL 2.0 atomic builtins.
  801. ATOMIC_BUILTIN(__opencl_atomic_init, "v.", "t")
  802. ATOMIC_BUILTIN(__opencl_atomic_load, "v.", "t")
  803. ATOMIC_BUILTIN(__opencl_atomic_store, "v.", "t")
  804. ATOMIC_BUILTIN(__opencl_atomic_exchange, "v.", "t")
  805. ATOMIC_BUILTIN(__opencl_atomic_compare_exchange_strong, "v.", "t")
  806. ATOMIC_BUILTIN(__opencl_atomic_compare_exchange_weak, "v.", "t")
  807. ATOMIC_BUILTIN(__opencl_atomic_fetch_add, "v.", "t")
  808. ATOMIC_BUILTIN(__opencl_atomic_fetch_sub, "v.", "t")
  809. ATOMIC_BUILTIN(__opencl_atomic_fetch_and, "v.", "t")
  810. ATOMIC_BUILTIN(__opencl_atomic_fetch_or, "v.", "t")
  811. ATOMIC_BUILTIN(__opencl_atomic_fetch_xor, "v.", "t")
  812. ATOMIC_BUILTIN(__opencl_atomic_fetch_min, "v.", "t")
  813. ATOMIC_BUILTIN(__opencl_atomic_fetch_max, "v.", "t")
  814. // GCC does not support these, they are a Clang extension.
  815. ATOMIC_BUILTIN(__atomic_fetch_min, "v.", "t")
  816. ATOMIC_BUILTIN(__atomic_fetch_max, "v.", "t")
  817. // HIP atomic builtins.
  818. ATOMIC_BUILTIN(__hip_atomic_load, "v.", "t")
  819. ATOMIC_BUILTIN(__hip_atomic_store, "v.", "t")
  820. ATOMIC_BUILTIN(__hip_atomic_compare_exchange_weak, "v.", "t")
  821. ATOMIC_BUILTIN(__hip_atomic_compare_exchange_strong, "v.", "t")
  822. ATOMIC_BUILTIN(__hip_atomic_exchange, "v.", "t")
  823. ATOMIC_BUILTIN(__hip_atomic_fetch_add, "v.", "t")
  824. ATOMIC_BUILTIN(__hip_atomic_fetch_and, "v.", "t")
  825. ATOMIC_BUILTIN(__hip_atomic_fetch_or, "v.", "t")
  826. ATOMIC_BUILTIN(__hip_atomic_fetch_xor, "v.", "t")
  827. ATOMIC_BUILTIN(__hip_atomic_fetch_min, "v.", "t")
  828. ATOMIC_BUILTIN(__hip_atomic_fetch_max, "v.", "t")
  829. #undef ATOMIC_BUILTIN
  830. // Non-overloaded atomic builtins.
  831. BUILTIN(__sync_synchronize, "v", "n")
  832. // GCC does not support these, they are a Clang extension.
  833. BUILTIN(__sync_fetch_and_min, "iiD*i", "n")
  834. BUILTIN(__sync_fetch_and_max, "iiD*i", "n")
  835. BUILTIN(__sync_fetch_and_umin, "UiUiD*Ui", "n")
  836. BUILTIN(__sync_fetch_and_umax, "UiUiD*Ui", "n")
  837. // Random libc builtins.
  838. BUILTIN(__builtin_abort, "v", "Fnr")
  839. BUILTIN(__builtin_index, "c*cC*i", "Fn")
  840. BUILTIN(__builtin_rindex, "c*cC*i", "Fn")
  841. // ignored glibc builtin, see https://sourceware.org/bugzilla/show_bug.cgi?id=25399
  842. BUILTIN(__warn_memset_zero_len, "v", "nU")
  843. // Microsoft builtins. These are only active with -fms-extensions.
  844. LANGBUILTIN(_alloca, "v*z", "n", ALL_MS_LANGUAGES)
  845. LANGBUILTIN(__annotation, "wC*.","n", ALL_MS_LANGUAGES)
  846. LANGBUILTIN(__assume, "vb", "n", ALL_MS_LANGUAGES)
  847. LANGBUILTIN(_bittest, "UcNiC*Ni", "n", ALL_MS_LANGUAGES)
  848. LANGBUILTIN(_bittestandcomplement, "UcNi*Ni", "n", ALL_MS_LANGUAGES)
  849. LANGBUILTIN(_bittestandreset, "UcNi*Ni", "n", ALL_MS_LANGUAGES)
  850. LANGBUILTIN(_bittestandset, "UcNi*Ni", "n", ALL_MS_LANGUAGES)
  851. LANGBUILTIN(_bittest64, "UcWiC*Wi", "n", ALL_MS_LANGUAGES)
  852. LANGBUILTIN(_bittestandcomplement64, "UcWi*Wi", "n", ALL_MS_LANGUAGES)
  853. LANGBUILTIN(_bittestandreset64, "UcWi*Wi", "n", ALL_MS_LANGUAGES)
  854. LANGBUILTIN(_bittestandset64, "UcWi*Wi", "n", ALL_MS_LANGUAGES)
  855. LIBBUILTIN(_byteswap_ushort, "UsUs", "fnc", "stdlib.h", ALL_MS_LANGUAGES)
  856. LIBBUILTIN(_byteswap_ulong, "UNiUNi", "fnc", "stdlib.h", ALL_MS_LANGUAGES)
  857. LIBBUILTIN(_byteswap_uint64, "ULLiULLi", "fnc", "stdlib.h", ALL_MS_LANGUAGES)
  858. LANGBUILTIN(__debugbreak, "v", "n", ALL_MS_LANGUAGES)
  859. LANGBUILTIN(__exception_code, "UNi", "n", ALL_MS_LANGUAGES)
  860. LANGBUILTIN(_exception_code, "UNi", "n", ALL_MS_LANGUAGES)
  861. LANGBUILTIN(__exception_info, "v*", "n", ALL_MS_LANGUAGES)
  862. LANGBUILTIN(_exception_info, "v*", "n", ALL_MS_LANGUAGES)
  863. LANGBUILTIN(__abnormal_termination, "i", "n", ALL_MS_LANGUAGES)
  864. LANGBUILTIN(_abnormal_termination, "i", "n", ALL_MS_LANGUAGES)
  865. LANGBUILTIN(__GetExceptionInfo, "v*.", "ntu", ALL_MS_LANGUAGES)
  866. LANGBUILTIN(_InterlockedAnd8, "ccD*c", "n", ALL_MS_LANGUAGES)
  867. LANGBUILTIN(_InterlockedAnd16, "ssD*s", "n", ALL_MS_LANGUAGES)
  868. LANGBUILTIN(_InterlockedAnd, "NiNiD*Ni", "n", ALL_MS_LANGUAGES)
  869. LANGBUILTIN(_InterlockedCompareExchange8, "ccD*cc", "n", ALL_MS_LANGUAGES)
  870. LANGBUILTIN(_InterlockedCompareExchange16, "ssD*ss", "n", ALL_MS_LANGUAGES)
  871. LANGBUILTIN(_InterlockedCompareExchange, "NiNiD*NiNi", "n", ALL_MS_LANGUAGES)
  872. LANGBUILTIN(_InterlockedCompareExchange64, "LLiLLiD*LLiLLi", "n", ALL_MS_LANGUAGES)
  873. LANGBUILTIN(_InterlockedCompareExchangePointer, "v*v*D*v*v*", "n", ALL_MS_LANGUAGES)
  874. LANGBUILTIN(_InterlockedCompareExchangePointer_nf, "v*v*D*v*v*", "n", ALL_MS_LANGUAGES)
  875. LANGBUILTIN(_InterlockedDecrement16, "ssD*", "n", ALL_MS_LANGUAGES)
  876. LANGBUILTIN(_InterlockedDecrement, "NiNiD*", "n", ALL_MS_LANGUAGES)
  877. LANGBUILTIN(_InterlockedExchange, "NiNiD*Ni", "n", ALL_MS_LANGUAGES)
  878. LANGBUILTIN(_InterlockedExchange8, "ccD*c", "n", ALL_MS_LANGUAGES)
  879. LANGBUILTIN(_InterlockedExchange16, "ssD*s", "n", ALL_MS_LANGUAGES)
  880. LANGBUILTIN(_InterlockedExchangeAdd8, "ccD*c", "n", ALL_MS_LANGUAGES)
  881. LANGBUILTIN(_InterlockedExchangeAdd16, "ssD*s", "n", ALL_MS_LANGUAGES)
  882. LANGBUILTIN(_InterlockedExchangeAdd, "NiNiD*Ni", "n", ALL_MS_LANGUAGES)
  883. LANGBUILTIN(_InterlockedExchangePointer, "v*v*D*v*", "n", ALL_MS_LANGUAGES)
  884. LANGBUILTIN(_InterlockedExchangeSub8, "ccD*c", "n", ALL_MS_LANGUAGES)
  885. LANGBUILTIN(_InterlockedExchangeSub16, "ssD*s", "n", ALL_MS_LANGUAGES)
  886. LANGBUILTIN(_InterlockedExchangeSub, "NiNiD*Ni", "n", ALL_MS_LANGUAGES)
  887. LANGBUILTIN(_InterlockedIncrement16, "ssD*", "n", ALL_MS_LANGUAGES)
  888. LANGBUILTIN(_InterlockedIncrement, "NiNiD*", "n", ALL_MS_LANGUAGES)
  889. LANGBUILTIN(_InterlockedOr8, "ccD*c", "n", ALL_MS_LANGUAGES)
  890. LANGBUILTIN(_InterlockedOr16, "ssD*s", "n", ALL_MS_LANGUAGES)
  891. LANGBUILTIN(_InterlockedOr, "NiNiD*Ni", "n", ALL_MS_LANGUAGES)
  892. LANGBUILTIN(_InterlockedXor8, "ccD*c", "n", ALL_MS_LANGUAGES)
  893. LANGBUILTIN(_InterlockedXor16, "ssD*s", "n", ALL_MS_LANGUAGES)
  894. LANGBUILTIN(_InterlockedXor, "NiNiD*Ni", "n", ALL_MS_LANGUAGES)
  895. LANGBUILTIN(_interlockedbittestandreset, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  896. LANGBUILTIN(_interlockedbittestandreset64, "UcWiD*Wi", "n", ALL_MS_LANGUAGES)
  897. LANGBUILTIN(_interlockedbittestandreset_acq, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  898. LANGBUILTIN(_interlockedbittestandreset_nf, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  899. LANGBUILTIN(_interlockedbittestandreset_rel, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  900. LANGBUILTIN(_interlockedbittestandset, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  901. LANGBUILTIN(_interlockedbittestandset64, "UcWiD*Wi", "n", ALL_MS_LANGUAGES)
  902. LANGBUILTIN(_interlockedbittestandset_acq, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  903. LANGBUILTIN(_interlockedbittestandset_nf, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  904. LANGBUILTIN(_interlockedbittestandset_rel, "UcNiD*Ni", "n", ALL_MS_LANGUAGES)
  905. LANGBUILTIN(__iso_volatile_load8, "ccCD*", "n", ALL_MS_LANGUAGES)
  906. LANGBUILTIN(__iso_volatile_load16, "ssCD*", "n", ALL_MS_LANGUAGES)
  907. LANGBUILTIN(__iso_volatile_load32, "iiCD*", "n", ALL_MS_LANGUAGES)
  908. LANGBUILTIN(__iso_volatile_load64, "LLiLLiCD*", "n", ALL_MS_LANGUAGES)
  909. LANGBUILTIN(__iso_volatile_store8, "vcD*c", "n", ALL_MS_LANGUAGES)
  910. LANGBUILTIN(__iso_volatile_store16, "vsD*s", "n", ALL_MS_LANGUAGES)
  911. LANGBUILTIN(__iso_volatile_store32, "viD*i", "n", ALL_MS_LANGUAGES)
  912. LANGBUILTIN(__iso_volatile_store64, "vLLiD*LLi", "n", ALL_MS_LANGUAGES)
  913. LANGBUILTIN(__noop, "i.", "n", ALL_MS_LANGUAGES)
  914. LANGBUILTIN(__lzcnt16, "UsUs", "nc", ALL_MS_LANGUAGES)
  915. LANGBUILTIN(__lzcnt, "UiUi", "nc", ALL_MS_LANGUAGES)
  916. LANGBUILTIN(__lzcnt64, "UWiUWi", "nc", ALL_MS_LANGUAGES)
  917. LANGBUILTIN(__popcnt16, "UsUs", "nc", ALL_MS_LANGUAGES)
  918. LANGBUILTIN(__popcnt, "UiUi", "nc", ALL_MS_LANGUAGES)
  919. LANGBUILTIN(__popcnt64, "UWiUWi", "nc", ALL_MS_LANGUAGES)
  920. LANGBUILTIN(_ReturnAddress, "v*", "n", ALL_MS_LANGUAGES)
  921. LANGBUILTIN(_rotl8, "UcUcUc", "n", ALL_MS_LANGUAGES)
  922. LANGBUILTIN(_rotl16, "UsUsUc", "n", ALL_MS_LANGUAGES)
  923. LANGBUILTIN(_rotl, "UiUii", "n", ALL_MS_LANGUAGES)
  924. LANGBUILTIN(_lrotl, "ULiULii", "n", ALL_MS_LANGUAGES)
  925. LANGBUILTIN(_rotl64, "UWiUWii", "n", ALL_MS_LANGUAGES)
  926. LANGBUILTIN(_rotr8, "UcUcUc", "n", ALL_MS_LANGUAGES)
  927. LANGBUILTIN(_rotr16, "UsUsUc", "n", ALL_MS_LANGUAGES)
  928. LANGBUILTIN(_rotr, "UiUii", "n", ALL_MS_LANGUAGES)
  929. LANGBUILTIN(_lrotr, "ULiULii", "n", ALL_MS_LANGUAGES)
  930. LANGBUILTIN(_rotr64, "UWiUWii", "n", ALL_MS_LANGUAGES)
  931. LANGBUILTIN(__va_start, "vc**.", "nt", ALL_MS_LANGUAGES)
  932. LANGBUILTIN(__fastfail, "vUi", "nr", ALL_MS_LANGUAGES)
  933. // Microsoft library builtins.
  934. LIBBUILTIN(_setjmpex, "iJ", "fjT", "setjmpex.h", ALL_MS_LANGUAGES)
  935. // C99 library functions
  936. // C99 stdarg.h
  937. LIBBUILTIN(va_start, "vA.", "fn", "stdarg.h", ALL_LANGUAGES)
  938. LIBBUILTIN(va_end, "vA", "fn", "stdarg.h", ALL_LANGUAGES)
  939. LIBBUILTIN(va_copy, "vAA", "fn", "stdarg.h", ALL_LANGUAGES)
  940. // C99 stdlib.h
  941. LIBBUILTIN(abort, "v", "fr", "stdlib.h", ALL_LANGUAGES)
  942. LIBBUILTIN(calloc, "v*zz", "f", "stdlib.h", ALL_LANGUAGES)
  943. LIBBUILTIN(exit, "vi", "fr", "stdlib.h", ALL_LANGUAGES)
  944. LIBBUILTIN(_Exit, "vi", "fr", "stdlib.h", ALL_LANGUAGES)
  945. LIBBUILTIN(malloc, "v*z", "f", "stdlib.h", ALL_LANGUAGES)
  946. LIBBUILTIN(realloc, "v*v*z", "f", "stdlib.h", ALL_LANGUAGES)
  947. LIBBUILTIN(free, "vv*", "f", "stdlib.h", ALL_LANGUAGES)
  948. LIBBUILTIN(strtod, "dcC*c**", "f", "stdlib.h", ALL_LANGUAGES)
  949. LIBBUILTIN(strtof, "fcC*c**", "f", "stdlib.h", ALL_LANGUAGES)
  950. LIBBUILTIN(strtold, "LdcC*c**", "f", "stdlib.h", ALL_LANGUAGES)
  951. LIBBUILTIN(strtol, "LicC*c**i", "f", "stdlib.h", ALL_LANGUAGES)
  952. LIBBUILTIN(strtoll, "LLicC*c**i", "f", "stdlib.h", ALL_LANGUAGES)
  953. LIBBUILTIN(strtoul, "ULicC*c**i", "f", "stdlib.h", ALL_LANGUAGES)
  954. LIBBUILTIN(strtoull, "ULLicC*c**i", "f", "stdlib.h", ALL_LANGUAGES)
  955. // C11 stdlib.h
  956. LIBBUILTIN(aligned_alloc, "v*zz", "f", "stdlib.h", ALL_LANGUAGES)
  957. // C99 string.h
  958. LIBBUILTIN(memcpy, "v*v*vC*z", "f", "string.h", ALL_LANGUAGES)
  959. LIBBUILTIN(memcmp, "ivC*vC*z", "f", "string.h", ALL_LANGUAGES)
  960. LIBBUILTIN(memmove, "v*v*vC*z", "f", "string.h", ALL_LANGUAGES)
  961. LIBBUILTIN(strcpy, "c*c*cC*", "f", "string.h", ALL_LANGUAGES)
  962. LIBBUILTIN(strncpy, "c*c*cC*z", "f", "string.h", ALL_LANGUAGES)
  963. LIBBUILTIN(strcmp, "icC*cC*", "f", "string.h", ALL_LANGUAGES)
  964. LIBBUILTIN(strncmp, "icC*cC*z", "f", "string.h", ALL_LANGUAGES)
  965. LIBBUILTIN(strcat, "c*c*cC*", "f", "string.h", ALL_LANGUAGES)
  966. LIBBUILTIN(strncat, "c*c*cC*z", "f", "string.h", ALL_LANGUAGES)
  967. LIBBUILTIN(strxfrm, "zc*cC*z", "f", "string.h", ALL_LANGUAGES)
  968. LIBBUILTIN(memchr, "v*vC*iz", "f", "string.h", ALL_LANGUAGES)
  969. LIBBUILTIN(strchr, "c*cC*i", "f", "string.h", ALL_LANGUAGES)
  970. LIBBUILTIN(strcspn, "zcC*cC*", "f", "string.h", ALL_LANGUAGES)
  971. LIBBUILTIN(strpbrk, "c*cC*cC*", "f", "string.h", ALL_LANGUAGES)
  972. LIBBUILTIN(strrchr, "c*cC*i", "f", "string.h", ALL_LANGUAGES)
  973. LIBBUILTIN(strspn, "zcC*cC*", "f", "string.h", ALL_LANGUAGES)
  974. LIBBUILTIN(strstr, "c*cC*cC*", "f", "string.h", ALL_LANGUAGES)
  975. LIBBUILTIN(strtok, "c*c*cC*", "f", "string.h", ALL_LANGUAGES)
  976. LIBBUILTIN(memset, "v*v*iz", "f", "string.h", ALL_LANGUAGES)
  977. LIBBUILTIN(strerror, "c*i", "f", "string.h", ALL_LANGUAGES)
  978. LIBBUILTIN(strlen, "zcC*", "f", "string.h", ALL_LANGUAGES)
  979. // C99 stdio.h
  980. // FIXME: This list is incomplete.
  981. LIBBUILTIN(printf, "icC*.", "fp:0:", "stdio.h", ALL_LANGUAGES)
  982. LIBBUILTIN(fprintf, "iP*cC*.", "fp:1:", "stdio.h", ALL_LANGUAGES)
  983. LIBBUILTIN(snprintf, "ic*zcC*.", "fp:2:", "stdio.h", ALL_LANGUAGES)
  984. LIBBUILTIN(sprintf, "ic*cC*.", "fp:1:", "stdio.h", ALL_LANGUAGES)
  985. LIBBUILTIN(vprintf, "icC*a", "fP:0:", "stdio.h", ALL_LANGUAGES)
  986. LIBBUILTIN(vfprintf, "iP*cC*a", "fP:1:", "stdio.h", ALL_LANGUAGES)
  987. LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h", ALL_LANGUAGES)
  988. LIBBUILTIN(vsprintf, "ic*cC*a", "fP:1:", "stdio.h", ALL_LANGUAGES)
  989. LIBBUILTIN(scanf, "icC*R.", "fs:0:", "stdio.h", ALL_LANGUAGES)
  990. LIBBUILTIN(fscanf, "iP*RcC*R.", "fs:1:", "stdio.h", ALL_LANGUAGES)
  991. LIBBUILTIN(sscanf, "icC*RcC*R.", "fs:1:", "stdio.h", ALL_LANGUAGES)
  992. LIBBUILTIN(vscanf, "icC*Ra", "fS:0:", "stdio.h", ALL_LANGUAGES)
  993. LIBBUILTIN(vfscanf, "iP*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES)
  994. LIBBUILTIN(vsscanf, "icC*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES)
  995. LIBBUILTIN(fopen, "P*cC*cC*", "f", "stdio.h", ALL_LANGUAGES)
  996. LIBBUILTIN(fread, "zv*zzP*", "f", "stdio.h", ALL_LANGUAGES)
  997. LIBBUILTIN(fwrite, "zvC*zzP*", "f", "stdio.h", ALL_LANGUAGES)
  998. // C99 ctype.h
  999. LIBBUILTIN(isalnum, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1000. LIBBUILTIN(isalpha, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1001. LIBBUILTIN(isblank, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1002. LIBBUILTIN(iscntrl, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1003. LIBBUILTIN(isdigit, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1004. LIBBUILTIN(isgraph, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1005. LIBBUILTIN(islower, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1006. LIBBUILTIN(isprint, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1007. LIBBUILTIN(ispunct, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1008. LIBBUILTIN(isspace, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1009. LIBBUILTIN(isupper, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1010. LIBBUILTIN(isxdigit, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1011. LIBBUILTIN(tolower, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1012. LIBBUILTIN(toupper, "ii", "fnU", "ctype.h", ALL_LANGUAGES)
  1013. // C99 wchar.h
  1014. // FIXME: This list is incomplete. We should cover at least the functions that
  1015. // take format strings.
  1016. LIBBUILTIN(wcschr, "w*wC*w", "f", "wchar.h", ALL_LANGUAGES)
  1017. LIBBUILTIN(wcscmp, "iwC*wC*", "f", "wchar.h", ALL_LANGUAGES)
  1018. LIBBUILTIN(wcslen, "zwC*", "f", "wchar.h", ALL_LANGUAGES)
  1019. LIBBUILTIN(wcsncmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
  1020. LIBBUILTIN(wmemchr, "w*wC*wz", "f", "wchar.h", ALL_LANGUAGES)
  1021. LIBBUILTIN(wmemcmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
  1022. LIBBUILTIN(wmemcpy, "w*w*wC*z", "f", "wchar.h", ALL_LANGUAGES)
  1023. LIBBUILTIN(wmemmove,"w*w*wC*z", "f", "wchar.h", ALL_LANGUAGES)
  1024. // C99
  1025. // In some systems setjmp is a macro that expands to _setjmp. We undefine
  1026. // it here to avoid having two identical LIBBUILTIN entries.
  1027. #undef setjmp
  1028. LIBBUILTIN(setjmp, "iJ", "fjT", "setjmp.h", ALL_LANGUAGES)
  1029. LIBBUILTIN(longjmp, "vJi", "frT", "setjmp.h", ALL_LANGUAGES)
  1030. // Non-C library functions, active in GNU mode only.
  1031. // Functions with (returns_twice) attribute (marked as "j") are still active in
  1032. // all languages, because losing this attribute would result in miscompilation
  1033. // when these functions are used in non-GNU mode. PR16138.
  1034. LIBBUILTIN(alloca, "v*z", "f", "stdlib.h", ALL_GNU_LANGUAGES)
  1035. // POSIX malloc.h
  1036. LIBBUILTIN(memalign, "v*zz", "f", "malloc.h", ALL_GNU_LANGUAGES)
  1037. // POSIX string.h
  1038. LIBBUILTIN(memccpy, "v*v*vC*iz", "f", "string.h", ALL_GNU_LANGUAGES)
  1039. LIBBUILTIN(mempcpy, "v*v*vC*z", "f", "string.h", ALL_GNU_LANGUAGES)
  1040. LIBBUILTIN(stpcpy, "c*c*cC*", "f", "string.h", ALL_GNU_LANGUAGES)
  1041. LIBBUILTIN(stpncpy, "c*c*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
  1042. LIBBUILTIN(strdup, "c*cC*", "f", "string.h", ALL_GNU_LANGUAGES)
  1043. LIBBUILTIN(strndup, "c*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
  1044. // POSIX strings.h
  1045. LIBBUILTIN(index, "c*cC*i", "f", "strings.h", ALL_GNU_LANGUAGES)
  1046. LIBBUILTIN(rindex, "c*cC*i", "f", "strings.h", ALL_GNU_LANGUAGES)
  1047. LIBBUILTIN(bzero, "vv*z", "f", "strings.h", ALL_GNU_LANGUAGES)
  1048. LIBBUILTIN(bcmp, "ivC*vC*z", "f", "strings.h", ALL_GNU_LANGUAGES)
  1049. // In some systems str[n]casejmp is a macro that expands to _str[n]icmp.
  1050. // We undefine then here to avoid wrong name.
  1051. #undef strcasecmp
  1052. #undef strncasecmp
  1053. LIBBUILTIN(strcasecmp, "icC*cC*", "f", "strings.h", ALL_GNU_LANGUAGES)
  1054. LIBBUILTIN(strncasecmp, "icC*cC*z", "f", "strings.h", ALL_GNU_LANGUAGES)
  1055. // POSIX unistd.h
  1056. LIBBUILTIN(_exit, "vi", "fr", "unistd.h", ALL_GNU_LANGUAGES)
  1057. LIBBUILTIN(vfork, "p", "fjT", "unistd.h", ALL_LANGUAGES)
  1058. // POSIX pthread.h
  1059. // FIXME: Should specify argument types.
  1060. LIBBUILTIN(pthread_create, "", "fC<2,3>", "pthread.h", ALL_GNU_LANGUAGES)
  1061. // POSIX setjmp.h
  1062. // FIXME: MinGW _setjmp has an additional void* parameter.
  1063. LIBBUILTIN(_setjmp, "iJ", "fjT", "setjmp.h", ALL_LANGUAGES)
  1064. LIBBUILTIN(__sigsetjmp, "iSJi", "fjT", "setjmp.h", ALL_LANGUAGES)
  1065. LIBBUILTIN(sigsetjmp, "iSJi", "fjT", "setjmp.h", ALL_LANGUAGES)
  1066. LIBBUILTIN(savectx, "iJ", "fjT", "setjmp.h", ALL_LANGUAGES)
  1067. LIBBUILTIN(getcontext, "iK*", "fjT", "setjmp.h", ALL_LANGUAGES)
  1068. LIBBUILTIN(_longjmp, "vJi", "frT", "setjmp.h", ALL_GNU_LANGUAGES)
  1069. LIBBUILTIN(siglongjmp, "vSJi", "frT", "setjmp.h", ALL_GNU_LANGUAGES)
  1070. // non-standard but very common
  1071. LIBBUILTIN(strlcpy, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
  1072. LIBBUILTIN(strlcat, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
  1073. // id objc_msgSend(id, SEL, ...)
  1074. LIBBUILTIN(objc_msgSend, "GGH.", "f", "objc/message.h", OBJC_LANG)
  1075. // long double objc_msgSend_fpret(id self, SEL op, ...)
  1076. LIBBUILTIN(objc_msgSend_fpret, "LdGH.", "f", "objc/message.h", OBJC_LANG)
  1077. // _Complex long double objc_msgSend_fp2ret(id self, SEL op, ...)
  1078. LIBBUILTIN(objc_msgSend_fp2ret, "XLdGH.", "f", "objc/message.h", OBJC_LANG)
  1079. // void objc_msgSend_stret (id, SEL, ...)
  1080. LIBBUILTIN(objc_msgSend_stret, "vGH.", "f", "objc/message.h", OBJC_LANG)
  1081. // id objc_msgSendSuper(struct objc_super *super, SEL op, ...)
  1082. LIBBUILTIN(objc_msgSendSuper, "GM*H.", "f", "objc/message.h", OBJC_LANG)
  1083. // void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...)
  1084. LIBBUILTIN(objc_msgSendSuper_stret, "vM*H.", "f", "objc/message.h", OBJC_LANG)
  1085. // id objc_getClass(const char *name)
  1086. LIBBUILTIN(objc_getClass, "GcC*", "f", "objc/runtime.h", OBJC_LANG)
  1087. // id objc_getMetaClass(const char *name)
  1088. LIBBUILTIN(objc_getMetaClass, "GcC*", "f", "objc/runtime.h", OBJC_LANG)
  1089. // void objc_enumerationMutation(id)
  1090. LIBBUILTIN(objc_enumerationMutation, "vG", "f", "objc/runtime.h", OBJC_LANG)
  1091. // id objc_read_weak(id *location)
  1092. LIBBUILTIN(objc_read_weak, "GG*", "f", "objc/objc-auto.h", OBJC_LANG)
  1093. // id objc_assign_weak(id value, id *location)
  1094. LIBBUILTIN(objc_assign_weak, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG)
  1095. // id objc_assign_ivar(id value, id dest, ptrdiff_t offset)
  1096. LIBBUILTIN(objc_assign_ivar, "GGGY", "f", "objc/objc-auto.h", OBJC_LANG)
  1097. // id objc_assign_global(id val, id *dest)
  1098. LIBBUILTIN(objc_assign_global, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG)
  1099. // id objc_assign_strongCast(id val, id *dest
  1100. LIBBUILTIN(objc_assign_strongCast, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG)
  1101. // id objc_exception_extract(void *localExceptionData)
  1102. LIBBUILTIN(objc_exception_extract, "Gv*", "f", "objc/objc-exception.h", OBJC_LANG)
  1103. // void objc_exception_try_enter(void *localExceptionData)
  1104. LIBBUILTIN(objc_exception_try_enter, "vv*", "f", "objc/objc-exception.h", OBJC_LANG)
  1105. // void objc_exception_try_exit(void *localExceptionData)
  1106. LIBBUILTIN(objc_exception_try_exit, "vv*", "f", "objc/objc-exception.h", OBJC_LANG)
  1107. // int objc_exception_match(Class exceptionClass, id exception)
  1108. LIBBUILTIN(objc_exception_match, "iGG", "f", "objc/objc-exception.h", OBJC_LANG)
  1109. // void objc_exception_throw(id exception)
  1110. LIBBUILTIN(objc_exception_throw, "vG", "f", "objc/objc-exception.h", OBJC_LANG)
  1111. // int objc_sync_enter(id obj)
  1112. LIBBUILTIN(objc_sync_enter, "iG", "f", "objc/objc-sync.h", OBJC_LANG)
  1113. // int objc_sync_exit(id obj)
  1114. LIBBUILTIN(objc_sync_exit, "iG", "f", "objc/objc-sync.h", OBJC_LANG)
  1115. BUILTIN(__builtin_objc_memmove_collectable, "v*v*vC*z", "nF")
  1116. // void NSLog(NSString *fmt, ...)
  1117. LIBBUILTIN(NSLog, "vG.", "fp:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG)
  1118. // void NSLogv(NSString *fmt, va_list args)
  1119. LIBBUILTIN(NSLogv, "vGa", "fP:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG)
  1120. // Builtin math library functions
  1121. LIBBUILTIN(atan2, "ddd", "fne", "math.h", ALL_LANGUAGES)
  1122. LIBBUILTIN(atan2f, "fff", "fne", "math.h", ALL_LANGUAGES)
  1123. LIBBUILTIN(atan2l, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1124. LIBBUILTIN(abs, "ii", "fnc", "stdlib.h", ALL_LANGUAGES)
  1125. LIBBUILTIN(labs, "LiLi", "fnc", "stdlib.h", ALL_LANGUAGES)
  1126. LIBBUILTIN(llabs, "LLiLLi", "fnc", "stdlib.h", ALL_LANGUAGES)
  1127. LIBBUILTIN(copysign, "ddd", "fnc", "math.h", ALL_LANGUAGES)
  1128. LIBBUILTIN(copysignf, "fff", "fnc", "math.h", ALL_LANGUAGES)
  1129. LIBBUILTIN(copysignl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES)
  1130. LIBBUILTIN(fabs, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1131. LIBBUILTIN(fabsf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1132. LIBBUILTIN(fabsl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1133. // Some systems define finitef as alias of _finitef.
  1134. #if defined (finitef)
  1135. #undef finitef
  1136. #endif
  1137. LIBBUILTIN(finite, "id", "fnc", "math.h", GNU_LANG)
  1138. LIBBUILTIN(finitef, "if", "fnc", "math.h", GNU_LANG)
  1139. LIBBUILTIN(finitel, "iLd", "fnc", "math.h", GNU_LANG)
  1140. // glibc's math.h generates calls to __finite
  1141. LIBBUILTIN(__finite, "id", "fnc", "math.h", ALL_LANGUAGES)
  1142. LIBBUILTIN(__finitef, "if", "fnc", "math.h", ALL_LANGUAGES)
  1143. LIBBUILTIN(__finitel, "iLd", "fnc", "math.h", ALL_LANGUAGES)
  1144. LIBBUILTIN(fmod, "ddd", "fne", "math.h", ALL_LANGUAGES)
  1145. LIBBUILTIN(fmodf, "fff", "fne", "math.h", ALL_LANGUAGES)
  1146. LIBBUILTIN(fmodl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1147. LIBBUILTIN(frexp, "ddi*", "fn", "math.h", ALL_LANGUAGES)
  1148. LIBBUILTIN(frexpf, "ffi*", "fn", "math.h", ALL_LANGUAGES)
  1149. LIBBUILTIN(frexpl, "LdLdi*", "fn", "math.h", ALL_LANGUAGES)
  1150. LIBBUILTIN(ldexp, "ddi", "fne", "math.h", ALL_LANGUAGES)
  1151. LIBBUILTIN(ldexpf, "ffi", "fne", "math.h", ALL_LANGUAGES)
  1152. LIBBUILTIN(ldexpl, "LdLdi", "fne", "math.h", ALL_LANGUAGES)
  1153. LIBBUILTIN(modf, "ddd*", "fn", "math.h", ALL_LANGUAGES)
  1154. LIBBUILTIN(modff, "fff*", "fn", "math.h", ALL_LANGUAGES)
  1155. LIBBUILTIN(modfl, "LdLdLd*", "fn", "math.h", ALL_LANGUAGES)
  1156. LIBBUILTIN(nan, "dcC*", "fUn", "math.h", ALL_LANGUAGES)
  1157. LIBBUILTIN(nanf, "fcC*", "fUn", "math.h", ALL_LANGUAGES)
  1158. LIBBUILTIN(nanl, "LdcC*", "fUn", "math.h", ALL_LANGUAGES)
  1159. LIBBUILTIN(pow, "ddd", "fne", "math.h", ALL_LANGUAGES)
  1160. LIBBUILTIN(powf, "fff", "fne", "math.h", ALL_LANGUAGES)
  1161. LIBBUILTIN(powl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1162. LIBBUILTIN(acos, "dd", "fne", "math.h", ALL_LANGUAGES)
  1163. LIBBUILTIN(acosf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1164. LIBBUILTIN(acosl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1165. LIBBUILTIN(acosh, "dd", "fne", "math.h", ALL_LANGUAGES)
  1166. LIBBUILTIN(acoshf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1167. LIBBUILTIN(acoshl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1168. LIBBUILTIN(asin, "dd", "fne", "math.h", ALL_LANGUAGES)
  1169. LIBBUILTIN(asinf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1170. LIBBUILTIN(asinl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1171. LIBBUILTIN(asinh, "dd", "fne", "math.h", ALL_LANGUAGES)
  1172. LIBBUILTIN(asinhf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1173. LIBBUILTIN(asinhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1174. LIBBUILTIN(atan, "dd", "fne", "math.h", ALL_LANGUAGES)
  1175. LIBBUILTIN(atanf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1176. LIBBUILTIN(atanl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1177. LIBBUILTIN(atanh, "dd", "fne", "math.h", ALL_LANGUAGES)
  1178. LIBBUILTIN(atanhf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1179. LIBBUILTIN(atanhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1180. LIBBUILTIN(cbrt, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1181. LIBBUILTIN(cbrtf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1182. LIBBUILTIN(cbrtl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1183. LIBBUILTIN(ceil, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1184. LIBBUILTIN(ceilf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1185. LIBBUILTIN(ceill, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1186. LIBBUILTIN(cos, "dd", "fne", "math.h", ALL_LANGUAGES)
  1187. LIBBUILTIN(cosf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1188. LIBBUILTIN(cosl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1189. LIBBUILTIN(cosh, "dd", "fne", "math.h", ALL_LANGUAGES)
  1190. LIBBUILTIN(coshf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1191. LIBBUILTIN(coshl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1192. LIBBUILTIN(erf, "dd", "fne", "math.h", ALL_LANGUAGES)
  1193. LIBBUILTIN(erff, "ff", "fne", "math.h", ALL_LANGUAGES)
  1194. LIBBUILTIN(erfl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1195. LIBBUILTIN(erfc, "dd", "fne", "math.h", ALL_LANGUAGES)
  1196. LIBBUILTIN(erfcf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1197. LIBBUILTIN(erfcl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1198. LIBBUILTIN(exp, "dd", "fne", "math.h", ALL_LANGUAGES)
  1199. LIBBUILTIN(expf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1200. LIBBUILTIN(expl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1201. LIBBUILTIN(exp2, "dd", "fne", "math.h", ALL_LANGUAGES)
  1202. LIBBUILTIN(exp2f, "ff", "fne", "math.h", ALL_LANGUAGES)
  1203. LIBBUILTIN(exp2l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1204. LIBBUILTIN(expm1, "dd", "fne", "math.h", ALL_LANGUAGES)
  1205. LIBBUILTIN(expm1f, "ff", "fne", "math.h", ALL_LANGUAGES)
  1206. LIBBUILTIN(expm1l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1207. LIBBUILTIN(fdim, "ddd", "fne", "math.h", ALL_LANGUAGES)
  1208. LIBBUILTIN(fdimf, "fff", "fne", "math.h", ALL_LANGUAGES)
  1209. LIBBUILTIN(fdiml, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1210. LIBBUILTIN(floor, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1211. LIBBUILTIN(floorf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1212. LIBBUILTIN(floorl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1213. LIBBUILTIN(fma, "dddd", "fne", "math.h", ALL_LANGUAGES)
  1214. LIBBUILTIN(fmaf, "ffff", "fne", "math.h", ALL_LANGUAGES)
  1215. LIBBUILTIN(fmal, "LdLdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1216. LIBBUILTIN(fmax, "ddd", "fnc", "math.h", ALL_LANGUAGES)
  1217. LIBBUILTIN(fmaxf, "fff", "fnc", "math.h", ALL_LANGUAGES)
  1218. LIBBUILTIN(fmaxl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES)
  1219. LIBBUILTIN(fmin, "ddd", "fnc", "math.h", ALL_LANGUAGES)
  1220. LIBBUILTIN(fminf, "fff", "fnc", "math.h", ALL_LANGUAGES)
  1221. LIBBUILTIN(fminl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES)
  1222. LIBBUILTIN(hypot, "ddd", "fne", "math.h", ALL_LANGUAGES)
  1223. LIBBUILTIN(hypotf, "fff", "fne", "math.h", ALL_LANGUAGES)
  1224. LIBBUILTIN(hypotl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1225. LIBBUILTIN(ilogb, "id", "fne", "math.h", ALL_LANGUAGES)
  1226. LIBBUILTIN(ilogbf, "if", "fne", "math.h", ALL_LANGUAGES)
  1227. LIBBUILTIN(ilogbl, "iLd", "fne", "math.h", ALL_LANGUAGES)
  1228. // POSIX math.h declares a global, signgam, that lgamma writes to, so these
  1229. // shouldn't have "e" or "c" attributes
  1230. LIBBUILTIN(lgamma, "dd", "fn", "math.h", ALL_LANGUAGES)
  1231. LIBBUILTIN(lgammaf, "ff", "fn", "math.h", ALL_LANGUAGES)
  1232. LIBBUILTIN(lgammal, "LdLd", "fn", "math.h", ALL_LANGUAGES)
  1233. LIBBUILTIN(llrint, "LLid", "fne", "math.h", ALL_LANGUAGES)
  1234. LIBBUILTIN(llrintf, "LLif", "fne", "math.h", ALL_LANGUAGES)
  1235. LIBBUILTIN(llrintl, "LLiLd", "fne", "math.h", ALL_LANGUAGES)
  1236. LIBBUILTIN(llround, "LLid", "fne", "math.h", ALL_LANGUAGES)
  1237. LIBBUILTIN(llroundf, "LLif", "fne", "math.h", ALL_LANGUAGES)
  1238. LIBBUILTIN(llroundl, "LLiLd", "fne", "math.h", ALL_LANGUAGES)
  1239. LIBBUILTIN(log, "dd", "fne", "math.h", ALL_LANGUAGES)
  1240. LIBBUILTIN(logf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1241. LIBBUILTIN(logl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1242. LIBBUILTIN(log10, "dd", "fne", "math.h", ALL_LANGUAGES)
  1243. LIBBUILTIN(log10f, "ff", "fne", "math.h", ALL_LANGUAGES)
  1244. LIBBUILTIN(log10l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1245. LIBBUILTIN(log1p, "dd", "fne", "math.h", ALL_LANGUAGES)
  1246. LIBBUILTIN(log1pf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1247. LIBBUILTIN(log1pl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1248. LIBBUILTIN(log2, "dd", "fne", "math.h", ALL_LANGUAGES)
  1249. LIBBUILTIN(log2f, "ff", "fne", "math.h", ALL_LANGUAGES)
  1250. LIBBUILTIN(log2l, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1251. LIBBUILTIN(logb, "dd", "fne", "math.h", ALL_LANGUAGES)
  1252. LIBBUILTIN(logbf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1253. LIBBUILTIN(logbl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1254. LIBBUILTIN(lrint, "Lid", "fne", "math.h", ALL_LANGUAGES)
  1255. LIBBUILTIN(lrintf, "Lif", "fne", "math.h", ALL_LANGUAGES)
  1256. LIBBUILTIN(lrintl, "LiLd", "fne", "math.h", ALL_LANGUAGES)
  1257. LIBBUILTIN(lround, "Lid", "fne", "math.h", ALL_LANGUAGES)
  1258. LIBBUILTIN(lroundf, "Lif", "fne", "math.h", ALL_LANGUAGES)
  1259. LIBBUILTIN(lroundl, "LiLd", "fne", "math.h", ALL_LANGUAGES)
  1260. LIBBUILTIN(nearbyint, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1261. LIBBUILTIN(nearbyintf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1262. LIBBUILTIN(nearbyintl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1263. LIBBUILTIN(nextafter, "ddd", "fne", "math.h", ALL_LANGUAGES)
  1264. LIBBUILTIN(nextafterf, "fff", "fne", "math.h", ALL_LANGUAGES)
  1265. LIBBUILTIN(nextafterl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1266. LIBBUILTIN(nexttoward, "ddLd", "fne", "math.h", ALL_LANGUAGES)
  1267. LIBBUILTIN(nexttowardf, "ffLd", "fne", "math.h", ALL_LANGUAGES)
  1268. LIBBUILTIN(nexttowardl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1269. LIBBUILTIN(remainder, "ddd", "fne", "math.h", ALL_LANGUAGES)
  1270. LIBBUILTIN(remainderf, "fff", "fne", "math.h", ALL_LANGUAGES)
  1271. LIBBUILTIN(remainderl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES)
  1272. LIBBUILTIN(remquo, "dddi*", "fn", "math.h", ALL_LANGUAGES)
  1273. LIBBUILTIN(remquof, "fffi*", "fn", "math.h", ALL_LANGUAGES)
  1274. LIBBUILTIN(remquol, "LdLdLdi*", "fn", "math.h", ALL_LANGUAGES)
  1275. LIBBUILTIN(rint, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1276. LIBBUILTIN(rintf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1277. LIBBUILTIN(rintl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1278. LIBBUILTIN(round, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1279. LIBBUILTIN(roundf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1280. LIBBUILTIN(roundl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1281. LIBBUILTIN(scalbln, "ddLi", "fne", "math.h", ALL_LANGUAGES)
  1282. LIBBUILTIN(scalblnf, "ffLi", "fne", "math.h", ALL_LANGUAGES)
  1283. LIBBUILTIN(scalblnl, "LdLdLi", "fne", "math.h", ALL_LANGUAGES)
  1284. LIBBUILTIN(scalbn, "ddi", "fne", "math.h", ALL_LANGUAGES)
  1285. LIBBUILTIN(scalbnf, "ffi", "fne", "math.h", ALL_LANGUAGES)
  1286. LIBBUILTIN(scalbnl, "LdLdi", "fne", "math.h", ALL_LANGUAGES)
  1287. LIBBUILTIN(sin, "dd", "fne", "math.h", ALL_LANGUAGES)
  1288. LIBBUILTIN(sinf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1289. LIBBUILTIN(sinl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1290. LIBBUILTIN(sinh, "dd", "fne", "math.h", ALL_LANGUAGES)
  1291. LIBBUILTIN(sinhf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1292. LIBBUILTIN(sinhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1293. LIBBUILTIN(sqrt, "dd", "fne", "math.h", ALL_LANGUAGES)
  1294. LIBBUILTIN(sqrtf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1295. LIBBUILTIN(sqrtl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1296. LIBBUILTIN(tan, "dd", "fne", "math.h", ALL_LANGUAGES)
  1297. LIBBUILTIN(tanf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1298. LIBBUILTIN(tanl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1299. LIBBUILTIN(tanh, "dd", "fne", "math.h", ALL_LANGUAGES)
  1300. LIBBUILTIN(tanhf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1301. LIBBUILTIN(tanhl, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1302. LIBBUILTIN(tgamma, "dd", "fne", "math.h", ALL_LANGUAGES)
  1303. LIBBUILTIN(tgammaf, "ff", "fne", "math.h", ALL_LANGUAGES)
  1304. LIBBUILTIN(tgammal, "LdLd", "fne", "math.h", ALL_LANGUAGES)
  1305. LIBBUILTIN(trunc, "dd", "fnc", "math.h", ALL_LANGUAGES)
  1306. LIBBUILTIN(truncf, "ff", "fnc", "math.h", ALL_LANGUAGES)
  1307. LIBBUILTIN(truncl, "LdLd", "fnc", "math.h", ALL_LANGUAGES)
  1308. LIBBUILTIN(cabs, "dXd", "fne", "complex.h", ALL_LANGUAGES)
  1309. LIBBUILTIN(cabsf, "fXf", "fne", "complex.h", ALL_LANGUAGES)
  1310. LIBBUILTIN(cabsl, "LdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1311. LIBBUILTIN(cacos, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1312. LIBBUILTIN(cacosf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1313. LIBBUILTIN(cacosl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1314. LIBBUILTIN(cacosh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1315. LIBBUILTIN(cacoshf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1316. LIBBUILTIN(cacoshl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1317. LIBBUILTIN(carg, "dXd", "fne", "complex.h", ALL_LANGUAGES)
  1318. LIBBUILTIN(cargf, "fXf", "fne", "complex.h", ALL_LANGUAGES)
  1319. LIBBUILTIN(cargl, "LdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1320. LIBBUILTIN(casin, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1321. LIBBUILTIN(casinf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1322. LIBBUILTIN(casinl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1323. LIBBUILTIN(casinh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1324. LIBBUILTIN(casinhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1325. LIBBUILTIN(casinhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1326. LIBBUILTIN(catan, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1327. LIBBUILTIN(catanf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1328. LIBBUILTIN(catanl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1329. LIBBUILTIN(catanh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1330. LIBBUILTIN(catanhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1331. LIBBUILTIN(catanhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1332. LIBBUILTIN(ccos, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1333. LIBBUILTIN(ccosf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1334. LIBBUILTIN(ccosl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1335. LIBBUILTIN(ccosh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1336. LIBBUILTIN(ccoshf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1337. LIBBUILTIN(ccoshl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1338. LIBBUILTIN(cexp, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1339. LIBBUILTIN(cexpf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1340. LIBBUILTIN(cexpl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1341. LIBBUILTIN(cimag, "dXd", "fnc", "complex.h", ALL_LANGUAGES)
  1342. LIBBUILTIN(cimagf, "fXf", "fnc", "complex.h", ALL_LANGUAGES)
  1343. LIBBUILTIN(cimagl, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES)
  1344. LIBBUILTIN(conj, "XdXd", "fnc", "complex.h", ALL_LANGUAGES)
  1345. LIBBUILTIN(conjf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES)
  1346. LIBBUILTIN(conjl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES)
  1347. LIBBUILTIN(clog, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1348. LIBBUILTIN(clogf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1349. LIBBUILTIN(clogl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1350. LIBBUILTIN(cproj, "XdXd", "fnc", "complex.h", ALL_LANGUAGES)
  1351. LIBBUILTIN(cprojf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES)
  1352. LIBBUILTIN(cprojl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES)
  1353. LIBBUILTIN(cpow, "XdXdXd", "fne", "complex.h", ALL_LANGUAGES)
  1354. LIBBUILTIN(cpowf, "XfXfXf", "fne", "complex.h", ALL_LANGUAGES)
  1355. LIBBUILTIN(cpowl, "XLdXLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1356. LIBBUILTIN(creal, "dXd", "fnc", "complex.h", ALL_LANGUAGES)
  1357. LIBBUILTIN(crealf, "fXf", "fnc", "complex.h", ALL_LANGUAGES)
  1358. LIBBUILTIN(creall, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES)
  1359. LIBBUILTIN(csin, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1360. LIBBUILTIN(csinf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1361. LIBBUILTIN(csinl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1362. LIBBUILTIN(csinh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1363. LIBBUILTIN(csinhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1364. LIBBUILTIN(csinhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1365. LIBBUILTIN(csqrt, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1366. LIBBUILTIN(csqrtf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1367. LIBBUILTIN(csqrtl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1368. LIBBUILTIN(ctan, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1369. LIBBUILTIN(ctanf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1370. LIBBUILTIN(ctanl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1371. LIBBUILTIN(ctanh, "XdXd", "fne", "complex.h", ALL_LANGUAGES)
  1372. LIBBUILTIN(ctanhf, "XfXf", "fne", "complex.h", ALL_LANGUAGES)
  1373. LIBBUILTIN(ctanhl, "XLdXLd", "fne", "complex.h", ALL_LANGUAGES)
  1374. // __sinpi and friends are OS X specific library functions, but otherwise much
  1375. // like the standard (non-complex) sin (etc).
  1376. LIBBUILTIN(__sinpi, "dd", "fne", "math.h", ALL_LANGUAGES)
  1377. LIBBUILTIN(__sinpif, "ff", "fne", "math.h", ALL_LANGUAGES)
  1378. LIBBUILTIN(__cospi, "dd", "fne", "math.h", ALL_LANGUAGES)
  1379. LIBBUILTIN(__cospif, "ff", "fne", "math.h", ALL_LANGUAGES)
  1380. LIBBUILTIN(__tanpi, "dd", "fne", "math.h", ALL_LANGUAGES)
  1381. LIBBUILTIN(__tanpif, "ff", "fne", "math.h", ALL_LANGUAGES)
  1382. // Similarly, __exp10 is OS X only
  1383. LIBBUILTIN(__exp10, "dd", "fne", "math.h", ALL_LANGUAGES)
  1384. LIBBUILTIN(__exp10f, "ff", "fne", "math.h", ALL_LANGUAGES)
  1385. // Blocks runtime Builtin math library functions
  1386. LIBBUILTIN(_Block_object_assign, "vv*vC*iC", "f", "Blocks.h", ALL_LANGUAGES)
  1387. LIBBUILTIN(_Block_object_dispose, "vvC*iC", "f", "Blocks.h", ALL_LANGUAGES)
  1388. // FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock.
  1389. // Annotation function
  1390. BUILTIN(__builtin_annotation, "v.", "tn")
  1391. // Invariants
  1392. BUILTIN(__builtin_assume, "vb", "n")
  1393. // Multiprecision Arithmetic Builtins.
  1394. BUILTIN(__builtin_addcb, "UcUcCUcCUcCUc*", "n")
  1395. BUILTIN(__builtin_addcs, "UsUsCUsCUsCUs*", "n")
  1396. BUILTIN(__builtin_addc, "UiUiCUiCUiCUi*", "n")
  1397. BUILTIN(__builtin_addcl, "ULiULiCULiCULiCULi*", "n")
  1398. BUILTIN(__builtin_addcll, "ULLiULLiCULLiCULLiCULLi*", "n")
  1399. BUILTIN(__builtin_subcb, "UcUcCUcCUcCUc*", "n")
  1400. BUILTIN(__builtin_subcs, "UsUsCUsCUsCUs*", "n")
  1401. BUILTIN(__builtin_subc, "UiUiCUiCUiCUi*", "n")
  1402. BUILTIN(__builtin_subcl, "ULiULiCULiCULiCULi*", "n")
  1403. BUILTIN(__builtin_subcll, "ULLiULLiCULLiCULLiCULLi*", "n")
  1404. // Checked Arithmetic Builtins for Security.
  1405. BUILTIN(__builtin_add_overflow, "b.", "nt")
  1406. BUILTIN(__builtin_sub_overflow, "b.", "nt")
  1407. BUILTIN(__builtin_mul_overflow, "b.", "nt")
  1408. BUILTIN(__builtin_uadd_overflow, "bUiCUiCUi*", "n")
  1409. BUILTIN(__builtin_uaddl_overflow, "bULiCULiCULi*", "n")
  1410. BUILTIN(__builtin_uaddll_overflow, "bULLiCULLiCULLi*", "n")
  1411. BUILTIN(__builtin_usub_overflow, "bUiCUiCUi*", "n")
  1412. BUILTIN(__builtin_usubl_overflow, "bULiCULiCULi*", "n")
  1413. BUILTIN(__builtin_usubll_overflow, "bULLiCULLiCULLi*", "n")
  1414. BUILTIN(__builtin_umul_overflow, "bUiCUiCUi*", "n")
  1415. BUILTIN(__builtin_umull_overflow, "bULiCULiCULi*", "n")
  1416. BUILTIN(__builtin_umulll_overflow, "bULLiCULLiCULLi*", "n")
  1417. BUILTIN(__builtin_sadd_overflow, "bSiCSiCSi*", "n")
  1418. BUILTIN(__builtin_saddl_overflow, "bSLiCSLiCSLi*", "n")
  1419. BUILTIN(__builtin_saddll_overflow, "bSLLiCSLLiCSLLi*", "n")
  1420. BUILTIN(__builtin_ssub_overflow, "bSiCSiCSi*", "n")
  1421. BUILTIN(__builtin_ssubl_overflow, "bSLiCSLiCSLi*", "n")
  1422. BUILTIN(__builtin_ssubll_overflow, "bSLLiCSLLiCSLLi*", "n")
  1423. BUILTIN(__builtin_smul_overflow, "bSiCSiCSi*", "n")
  1424. BUILTIN(__builtin_smull_overflow, "bSLiCSLiCSLi*", "n")
  1425. BUILTIN(__builtin_smulll_overflow, "bSLLiCSLLiCSLLi*", "n")
  1426. // Clang builtins (not available in GCC).
  1427. BUILTIN(__builtin_addressof, "v*v&", "nct")
  1428. BUILTIN(__builtin_function_start, "v*v&", "nct")
  1429. BUILTIN(__builtin_operator_new, "v*z", "tc")
  1430. BUILTIN(__builtin_operator_delete, "vv*", "tn")
  1431. BUILTIN(__builtin_char_memchr, "c*cC*iz", "n")
  1432. BUILTIN(__builtin_dump_struct, "ivC*v*", "tn")
  1433. BUILTIN(__builtin_preserve_access_index, "v.", "t")
  1434. // Alignment builtins (uses custom parsing to support pointers and integers)
  1435. BUILTIN(__builtin_is_aligned, "bvC*z", "nct")
  1436. BUILTIN(__builtin_align_up, "v*vC*z", "nct")
  1437. BUILTIN(__builtin_align_down, "v*vC*z", "nct")
  1438. // Safestack builtins
  1439. BUILTIN(__builtin___get_unsafe_stack_start, "v*", "Fn")
  1440. BUILTIN(__builtin___get_unsafe_stack_bottom, "v*", "Fn")
  1441. BUILTIN(__builtin___get_unsafe_stack_top, "v*", "Fn")
  1442. BUILTIN(__builtin___get_unsafe_stack_ptr, "v*", "Fn")
  1443. // Nontemporal loads/stores builtins
  1444. BUILTIN(__builtin_nontemporal_store, "v.", "t")
  1445. BUILTIN(__builtin_nontemporal_load, "v.", "t")
  1446. // Coroutine intrinsics.
  1447. LANGBUILTIN(__builtin_coro_resume, "vv*", "", COR_LANG)
  1448. LANGBUILTIN(__builtin_coro_destroy, "vv*", "", COR_LANG)
  1449. LANGBUILTIN(__builtin_coro_done, "bv*", "n", COR_LANG)
  1450. LANGBUILTIN(__builtin_coro_promise, "v*v*IiIb", "n", COR_LANG)
  1451. LANGBUILTIN(__builtin_coro_size, "z", "n", COR_LANG)
  1452. LANGBUILTIN(__builtin_coro_frame, "v*", "n", COR_LANG)
  1453. LANGBUILTIN(__builtin_coro_noop, "v*", "n", COR_LANG)
  1454. LANGBUILTIN(__builtin_coro_free, "v*v*", "n", COR_LANG)
  1455. LANGBUILTIN(__builtin_coro_id, "v*Iiv*v*v*", "n", COR_LANG)
  1456. LANGBUILTIN(__builtin_coro_alloc, "b", "n", COR_LANG)
  1457. LANGBUILTIN(__builtin_coro_begin, "v*v*", "n", COR_LANG)
  1458. LANGBUILTIN(__builtin_coro_end, "bv*Ib", "n", COR_LANG)
  1459. LANGBUILTIN(__builtin_coro_suspend, "cIb", "n", COR_LANG)
  1460. // OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions.
  1461. // We need the generic prototype, since the packet type could be anything.
  1462. LANGBUILTIN(read_pipe, "i.", "tn", OCL_PIPE)
  1463. LANGBUILTIN(write_pipe, "i.", "tn", OCL_PIPE)
  1464. LANGBUILTIN(reserve_read_pipe, "i.", "tn", OCL_PIPE)
  1465. LANGBUILTIN(reserve_write_pipe, "i.", "tn", OCL_PIPE)
  1466. LANGBUILTIN(commit_write_pipe, "v.", "tn", OCL_PIPE)
  1467. LANGBUILTIN(commit_read_pipe, "v.", "tn", OCL_PIPE)
  1468. LANGBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCL_PIPE)
  1469. LANGBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCL_PIPE)
  1470. LANGBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCL_PIPE)
  1471. LANGBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCL_PIPE)
  1472. LANGBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCL_PIPE)
  1473. LANGBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCL_PIPE)
  1474. LANGBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCL_PIPE)
  1475. LANGBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCL_PIPE)
  1476. LANGBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCL_PIPE)
  1477. LANGBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCL_PIPE)
  1478. // OpenCL v2.0 s6.13.17 - Enqueue kernel functions.
  1479. // Custom builtin check allows to perform special check of passed block arguments.
  1480. LANGBUILTIN(enqueue_kernel, "i.", "tn", OCL_DSE)
  1481. LANGBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCL_DSE)
  1482. LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn", OCL_DSE)
  1483. LANGBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn", OCL_DSE)
  1484. LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCL_DSE)
  1485. // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
  1486. // FIXME: Pointer parameters of OpenCL builtins should have their address space
  1487. // requirement defined.
  1488. LANGBUILTIN(to_global, "v*v*", "tn", OCL_GAS)
  1489. LANGBUILTIN(to_local, "v*v*", "tn", OCL_GAS)
  1490. LANGBUILTIN(to_private, "v*v*", "tn", OCL_GAS)
  1491. // OpenCL half load/store builtin
  1492. LANGBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCL_LANGUAGES)
  1493. LANGBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCL_LANGUAGES)
  1494. LANGBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCL_LANGUAGES)
  1495. LANGBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCL_LANGUAGES)
  1496. // Builtins for os_log/os_trace
  1497. BUILTIN(__builtin_os_log_format_buffer_size, "zcC*.", "p:0:nut")
  1498. BUILTIN(__builtin_os_log_format, "v*v*cC*.", "p:0:nt")
  1499. // CUDA/HIP
  1500. LANGBUILTIN(__builtin_get_device_side_mangled_name, "cC*.", "ncT", CUDA_LANG)
  1501. // Builtins for XRay
  1502. BUILTIN(__xray_customevent, "vcC*z", "")
  1503. BUILTIN(__xray_typedevent, "vzcC*z", "")
  1504. // Win64-compatible va_list functions
  1505. BUILTIN(__builtin_ms_va_start, "vc*&.", "nt")
  1506. BUILTIN(__builtin_ms_va_end, "vc*&", "n")
  1507. BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n")
  1508. // Arithmetic Fence: to prevent FP reordering and reassociation optimizations
  1509. LANGBUILTIN(__arithmetic_fence, "v.", "t", ALL_LANGUAGES)
  1510. #undef BUILTIN
  1511. #undef LIBBUILTIN
  1512. #undef LANGBUILTIN