RuntimeLibcalls.def 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. //===-- llvm/RuntimeLibcalls.def - File that describes libcalls -*- 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 all of the runtime library calls the backend can emit.
  10. // The various long double types cannot be merged, because 80-bit library
  11. // functions use "xf" and 128-bit use "tf".
  12. //
  13. // When adding PPCF128 functions here, note that their names generally need
  14. // to be overridden for Darwin with the xxx$LDBL128 form. See
  15. // PPCISelLowering.cpp.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. // NOTE: NO INCLUDE GUARD DESIRED!
  19. // Provide definitions of macros so that users of this file do not have to
  20. // define everything to use it...
  21. // Declare the enumerator for each libcall, along with its default name. Some
  22. // libcalls have different names on particular OSes or architectures. These
  23. // are set in InitLibcalls() in TargetLoweringBase.cpp and/or by targets
  24. // using TargetLoweringBase::setLibcallName()
  25. #ifndef HANDLE_LIBCALL
  26. #error "HANDLE_LIBCALL must be defined"
  27. #endif
  28. // Integer
  29. HANDLE_LIBCALL(SHL_I16, "__ashlhi3")
  30. HANDLE_LIBCALL(SHL_I32, "__ashlsi3")
  31. HANDLE_LIBCALL(SHL_I64, "__ashldi3")
  32. HANDLE_LIBCALL(SHL_I128, "__ashlti3")
  33. HANDLE_LIBCALL(SRL_I16, "__lshrhi3")
  34. HANDLE_LIBCALL(SRL_I32, "__lshrsi3")
  35. HANDLE_LIBCALL(SRL_I64, "__lshrdi3")
  36. HANDLE_LIBCALL(SRL_I128, "__lshrti3")
  37. HANDLE_LIBCALL(SRA_I16, "__ashrhi3")
  38. HANDLE_LIBCALL(SRA_I32, "__ashrsi3")
  39. HANDLE_LIBCALL(SRA_I64, "__ashrdi3")
  40. HANDLE_LIBCALL(SRA_I128, "__ashrti3")
  41. HANDLE_LIBCALL(MUL_I8, "__mulqi3")
  42. HANDLE_LIBCALL(MUL_I16, "__mulhi3")
  43. HANDLE_LIBCALL(MUL_I32, "__mulsi3")
  44. HANDLE_LIBCALL(MUL_I64, "__muldi3")
  45. HANDLE_LIBCALL(MUL_I128, "__multi3")
  46. HANDLE_LIBCALL(MULO_I32, "__mulosi4")
  47. HANDLE_LIBCALL(MULO_I64, "__mulodi4")
  48. HANDLE_LIBCALL(MULO_I128, "__muloti4")
  49. HANDLE_LIBCALL(SDIV_I8, "__divqi3")
  50. HANDLE_LIBCALL(SDIV_I16, "__divhi3")
  51. HANDLE_LIBCALL(SDIV_I32, "__divsi3")
  52. HANDLE_LIBCALL(SDIV_I64, "__divdi3")
  53. HANDLE_LIBCALL(SDIV_I128, "__divti3")
  54. HANDLE_LIBCALL(UDIV_I8, "__udivqi3")
  55. HANDLE_LIBCALL(UDIV_I16, "__udivhi3")
  56. HANDLE_LIBCALL(UDIV_I32, "__udivsi3")
  57. HANDLE_LIBCALL(UDIV_I64, "__udivdi3")
  58. HANDLE_LIBCALL(UDIV_I128, "__udivti3")
  59. HANDLE_LIBCALL(SREM_I8, "__modqi3")
  60. HANDLE_LIBCALL(SREM_I16, "__modhi3")
  61. HANDLE_LIBCALL(SREM_I32, "__modsi3")
  62. HANDLE_LIBCALL(SREM_I64, "__moddi3")
  63. HANDLE_LIBCALL(SREM_I128, "__modti3")
  64. HANDLE_LIBCALL(UREM_I8, "__umodqi3")
  65. HANDLE_LIBCALL(UREM_I16, "__umodhi3")
  66. HANDLE_LIBCALL(UREM_I32, "__umodsi3")
  67. HANDLE_LIBCALL(UREM_I64, "__umoddi3")
  68. HANDLE_LIBCALL(UREM_I128, "__umodti3")
  69. HANDLE_LIBCALL(SDIVREM_I8, nullptr)
  70. HANDLE_LIBCALL(SDIVREM_I16, nullptr)
  71. HANDLE_LIBCALL(SDIVREM_I32, nullptr)
  72. HANDLE_LIBCALL(SDIVREM_I64, nullptr)
  73. HANDLE_LIBCALL(SDIVREM_I128, nullptr)
  74. HANDLE_LIBCALL(UDIVREM_I8, nullptr)
  75. HANDLE_LIBCALL(UDIVREM_I16, nullptr)
  76. HANDLE_LIBCALL(UDIVREM_I32, nullptr)
  77. HANDLE_LIBCALL(UDIVREM_I64, nullptr)
  78. HANDLE_LIBCALL(UDIVREM_I128, nullptr)
  79. HANDLE_LIBCALL(NEG_I32, "__negsi2")
  80. HANDLE_LIBCALL(NEG_I64, "__negdi2")
  81. HANDLE_LIBCALL(CTLZ_I32, "__clzsi2")
  82. HANDLE_LIBCALL(CTLZ_I64, "__clzdi2")
  83. HANDLE_LIBCALL(CTLZ_I128, "__clzti2")
  84. // Floating-point
  85. HANDLE_LIBCALL(ADD_F32, "__addsf3")
  86. HANDLE_LIBCALL(ADD_F64, "__adddf3")
  87. HANDLE_LIBCALL(ADD_F80, "__addxf3")
  88. HANDLE_LIBCALL(ADD_F128, "__addtf3")
  89. HANDLE_LIBCALL(ADD_PPCF128, "__gcc_qadd")
  90. HANDLE_LIBCALL(SUB_F32, "__subsf3")
  91. HANDLE_LIBCALL(SUB_F64, "__subdf3")
  92. HANDLE_LIBCALL(SUB_F80, "__subxf3")
  93. HANDLE_LIBCALL(SUB_F128, "__subtf3")
  94. HANDLE_LIBCALL(SUB_PPCF128, "__gcc_qsub")
  95. HANDLE_LIBCALL(MUL_F32, "__mulsf3")
  96. HANDLE_LIBCALL(MUL_F64, "__muldf3")
  97. HANDLE_LIBCALL(MUL_F80, "__mulxf3")
  98. HANDLE_LIBCALL(MUL_F128, "__multf3")
  99. HANDLE_LIBCALL(MUL_PPCF128, "__gcc_qmul")
  100. HANDLE_LIBCALL(DIV_F32, "__divsf3")
  101. HANDLE_LIBCALL(DIV_F64, "__divdf3")
  102. HANDLE_LIBCALL(DIV_F80, "__divxf3")
  103. HANDLE_LIBCALL(DIV_F128, "__divtf3")
  104. HANDLE_LIBCALL(DIV_PPCF128, "__gcc_qdiv")
  105. HANDLE_LIBCALL(REM_F32, "fmodf")
  106. HANDLE_LIBCALL(REM_F64, "fmod")
  107. HANDLE_LIBCALL(REM_F80, "fmodl")
  108. HANDLE_LIBCALL(REM_F128, "fmodl")
  109. HANDLE_LIBCALL(REM_PPCF128, "fmodl")
  110. HANDLE_LIBCALL(FMA_F32, "fmaf")
  111. HANDLE_LIBCALL(FMA_F64, "fma")
  112. HANDLE_LIBCALL(FMA_F80, "fmal")
  113. HANDLE_LIBCALL(FMA_F128, "fmal")
  114. HANDLE_LIBCALL(FMA_PPCF128, "fmal")
  115. HANDLE_LIBCALL(POWI_F32, "__powisf2")
  116. HANDLE_LIBCALL(POWI_F64, "__powidf2")
  117. HANDLE_LIBCALL(POWI_F80, "__powixf2")
  118. HANDLE_LIBCALL(POWI_F128, "__powitf2")
  119. HANDLE_LIBCALL(POWI_PPCF128, "__powitf2")
  120. HANDLE_LIBCALL(SQRT_F32, "sqrtf")
  121. HANDLE_LIBCALL(SQRT_F64, "sqrt")
  122. HANDLE_LIBCALL(SQRT_F80, "sqrtl")
  123. HANDLE_LIBCALL(SQRT_F128, "sqrtl")
  124. HANDLE_LIBCALL(SQRT_PPCF128, "sqrtl")
  125. HANDLE_LIBCALL(CBRT_F32, "cbrtf")
  126. HANDLE_LIBCALL(CBRT_F64, "cbrt")
  127. HANDLE_LIBCALL(CBRT_F80, "cbrtl")
  128. HANDLE_LIBCALL(CBRT_F128, "cbrtl")
  129. HANDLE_LIBCALL(CBRT_PPCF128, "cbrtl")
  130. HANDLE_LIBCALL(LOG_F32, "logf")
  131. HANDLE_LIBCALL(LOG_F64, "log")
  132. HANDLE_LIBCALL(LOG_F80, "logl")
  133. HANDLE_LIBCALL(LOG_F128, "logl")
  134. HANDLE_LIBCALL(LOG_PPCF128, "logl")
  135. HANDLE_LIBCALL(LOG_FINITE_F32, "__logf_finite")
  136. HANDLE_LIBCALL(LOG_FINITE_F64, "__log_finite")
  137. HANDLE_LIBCALL(LOG_FINITE_F80, "__logl_finite")
  138. HANDLE_LIBCALL(LOG_FINITE_F128, "__logl_finite")
  139. HANDLE_LIBCALL(LOG_FINITE_PPCF128, "__logl_finite")
  140. HANDLE_LIBCALL(LOG2_F32, "log2f")
  141. HANDLE_LIBCALL(LOG2_F64, "log2")
  142. HANDLE_LIBCALL(LOG2_F80, "log2l")
  143. HANDLE_LIBCALL(LOG2_F128, "log2l")
  144. HANDLE_LIBCALL(LOG2_PPCF128, "log2l")
  145. HANDLE_LIBCALL(LOG2_FINITE_F32, "__log2f_finite")
  146. HANDLE_LIBCALL(LOG2_FINITE_F64, "__log2_finite")
  147. HANDLE_LIBCALL(LOG2_FINITE_F80, "__log2l_finite")
  148. HANDLE_LIBCALL(LOG2_FINITE_F128, "__log2l_finite")
  149. HANDLE_LIBCALL(LOG2_FINITE_PPCF128, "__log2l_finite")
  150. HANDLE_LIBCALL(LOG10_F32, "log10f")
  151. HANDLE_LIBCALL(LOG10_F64, "log10")
  152. HANDLE_LIBCALL(LOG10_F80, "log10l")
  153. HANDLE_LIBCALL(LOG10_F128, "log10l")
  154. HANDLE_LIBCALL(LOG10_PPCF128, "log10l")
  155. HANDLE_LIBCALL(LOG10_FINITE_F32, "__log10f_finite")
  156. HANDLE_LIBCALL(LOG10_FINITE_F64, "__log10_finite")
  157. HANDLE_LIBCALL(LOG10_FINITE_F80, "__log10l_finite")
  158. HANDLE_LIBCALL(LOG10_FINITE_F128, "__log10l_finite")
  159. HANDLE_LIBCALL(LOG10_FINITE_PPCF128, "__log10l_finite")
  160. HANDLE_LIBCALL(EXP_F32, "expf")
  161. HANDLE_LIBCALL(EXP_F64, "exp")
  162. HANDLE_LIBCALL(EXP_F80, "expl")
  163. HANDLE_LIBCALL(EXP_F128, "expl")
  164. HANDLE_LIBCALL(EXP_PPCF128, "expl")
  165. HANDLE_LIBCALL(EXP_FINITE_F32, "__expf_finite")
  166. HANDLE_LIBCALL(EXP_FINITE_F64, "__exp_finite")
  167. HANDLE_LIBCALL(EXP_FINITE_F80, "__expl_finite")
  168. HANDLE_LIBCALL(EXP_FINITE_F128, "__expl_finite")
  169. HANDLE_LIBCALL(EXP_FINITE_PPCF128, "__expl_finite")
  170. HANDLE_LIBCALL(EXP2_F32, "exp2f")
  171. HANDLE_LIBCALL(EXP2_F64, "exp2")
  172. HANDLE_LIBCALL(EXP2_F80, "exp2l")
  173. HANDLE_LIBCALL(EXP2_F128, "exp2l")
  174. HANDLE_LIBCALL(EXP2_PPCF128, "exp2l")
  175. HANDLE_LIBCALL(EXP2_FINITE_F32, "__exp2f_finite")
  176. HANDLE_LIBCALL(EXP2_FINITE_F64, "__exp2_finite")
  177. HANDLE_LIBCALL(EXP2_FINITE_F80, "__exp2l_finite")
  178. HANDLE_LIBCALL(EXP2_FINITE_F128, "__exp2l_finite")
  179. HANDLE_LIBCALL(EXP2_FINITE_PPCF128, "__exp2l_finite")
  180. HANDLE_LIBCALL(SIN_F32, "sinf")
  181. HANDLE_LIBCALL(SIN_F64, "sin")
  182. HANDLE_LIBCALL(SIN_F80, "sinl")
  183. HANDLE_LIBCALL(SIN_F128, "sinl")
  184. HANDLE_LIBCALL(SIN_PPCF128, "sinl")
  185. HANDLE_LIBCALL(COS_F32, "cosf")
  186. HANDLE_LIBCALL(COS_F64, "cos")
  187. HANDLE_LIBCALL(COS_F80, "cosl")
  188. HANDLE_LIBCALL(COS_F128, "cosl")
  189. HANDLE_LIBCALL(COS_PPCF128, "cosl")
  190. HANDLE_LIBCALL(SINCOS_F32, nullptr)
  191. HANDLE_LIBCALL(SINCOS_F64, nullptr)
  192. HANDLE_LIBCALL(SINCOS_F80, nullptr)
  193. HANDLE_LIBCALL(SINCOS_F128, nullptr)
  194. HANDLE_LIBCALL(SINCOS_PPCF128, nullptr)
  195. HANDLE_LIBCALL(SINCOS_STRET_F32, nullptr)
  196. HANDLE_LIBCALL(SINCOS_STRET_F64, nullptr)
  197. HANDLE_LIBCALL(POW_F32, "powf")
  198. HANDLE_LIBCALL(POW_F64, "pow")
  199. HANDLE_LIBCALL(POW_F80, "powl")
  200. HANDLE_LIBCALL(POW_F128, "powl")
  201. HANDLE_LIBCALL(POW_PPCF128, "powl")
  202. HANDLE_LIBCALL(POW_FINITE_F32, "__powf_finite")
  203. HANDLE_LIBCALL(POW_FINITE_F64, "__pow_finite")
  204. HANDLE_LIBCALL(POW_FINITE_F80, "__powl_finite")
  205. HANDLE_LIBCALL(POW_FINITE_F128, "__powl_finite")
  206. HANDLE_LIBCALL(POW_FINITE_PPCF128, "__powl_finite")
  207. HANDLE_LIBCALL(CEIL_F32, "ceilf")
  208. HANDLE_LIBCALL(CEIL_F64, "ceil")
  209. HANDLE_LIBCALL(CEIL_F80, "ceill")
  210. HANDLE_LIBCALL(CEIL_F128, "ceill")
  211. HANDLE_LIBCALL(CEIL_PPCF128, "ceill")
  212. HANDLE_LIBCALL(TRUNC_F32, "truncf")
  213. HANDLE_LIBCALL(TRUNC_F64, "trunc")
  214. HANDLE_LIBCALL(TRUNC_F80, "truncl")
  215. HANDLE_LIBCALL(TRUNC_F128, "truncl")
  216. HANDLE_LIBCALL(TRUNC_PPCF128, "truncl")
  217. HANDLE_LIBCALL(RINT_F32, "rintf")
  218. HANDLE_LIBCALL(RINT_F64, "rint")
  219. HANDLE_LIBCALL(RINT_F80, "rintl")
  220. HANDLE_LIBCALL(RINT_F128, "rintl")
  221. HANDLE_LIBCALL(RINT_PPCF128, "rintl")
  222. HANDLE_LIBCALL(NEARBYINT_F32, "nearbyintf")
  223. HANDLE_LIBCALL(NEARBYINT_F64, "nearbyint")
  224. HANDLE_LIBCALL(NEARBYINT_F80, "nearbyintl")
  225. HANDLE_LIBCALL(NEARBYINT_F128, "nearbyintl")
  226. HANDLE_LIBCALL(NEARBYINT_PPCF128, "nearbyintl")
  227. HANDLE_LIBCALL(ROUND_F32, "roundf")
  228. HANDLE_LIBCALL(ROUND_F64, "round")
  229. HANDLE_LIBCALL(ROUND_F80, "roundl")
  230. HANDLE_LIBCALL(ROUND_F128, "roundl")
  231. HANDLE_LIBCALL(ROUND_PPCF128, "roundl")
  232. HANDLE_LIBCALL(ROUNDEVEN_F32, "roundevenf")
  233. HANDLE_LIBCALL(ROUNDEVEN_F64, "roundeven")
  234. HANDLE_LIBCALL(ROUNDEVEN_F80, "roundevenl")
  235. HANDLE_LIBCALL(ROUNDEVEN_F128, "roundevenl")
  236. HANDLE_LIBCALL(ROUNDEVEN_PPCF128, "roundevenl")
  237. HANDLE_LIBCALL(FLOOR_F32, "floorf")
  238. HANDLE_LIBCALL(FLOOR_F64, "floor")
  239. HANDLE_LIBCALL(FLOOR_F80, "floorl")
  240. HANDLE_LIBCALL(FLOOR_F128, "floorl")
  241. HANDLE_LIBCALL(FLOOR_PPCF128, "floorl")
  242. HANDLE_LIBCALL(COPYSIGN_F32, "copysignf")
  243. HANDLE_LIBCALL(COPYSIGN_F64, "copysign")
  244. HANDLE_LIBCALL(COPYSIGN_F80, "copysignl")
  245. HANDLE_LIBCALL(COPYSIGN_F128, "copysignl")
  246. HANDLE_LIBCALL(COPYSIGN_PPCF128, "copysignl")
  247. HANDLE_LIBCALL(FMIN_F32, "fminf")
  248. HANDLE_LIBCALL(FMIN_F64, "fmin")
  249. HANDLE_LIBCALL(FMIN_F80, "fminl")
  250. HANDLE_LIBCALL(FMIN_F128, "fminl")
  251. HANDLE_LIBCALL(FMIN_PPCF128, "fminl")
  252. HANDLE_LIBCALL(FMAX_F32, "fmaxf")
  253. HANDLE_LIBCALL(FMAX_F64, "fmax")
  254. HANDLE_LIBCALL(FMAX_F80, "fmaxl")
  255. HANDLE_LIBCALL(FMAX_F128, "fmaxl")
  256. HANDLE_LIBCALL(FMAX_PPCF128, "fmaxl")
  257. HANDLE_LIBCALL(LROUND_F32, "lroundf")
  258. HANDLE_LIBCALL(LROUND_F64, "lround")
  259. HANDLE_LIBCALL(LROUND_F80, "lroundl")
  260. HANDLE_LIBCALL(LROUND_F128, "lroundl")
  261. HANDLE_LIBCALL(LROUND_PPCF128, "lroundl")
  262. HANDLE_LIBCALL(LLROUND_F32, "llroundf")
  263. HANDLE_LIBCALL(LLROUND_F64, "llround")
  264. HANDLE_LIBCALL(LLROUND_F80, "llroundl")
  265. HANDLE_LIBCALL(LLROUND_F128, "llroundl")
  266. HANDLE_LIBCALL(LLROUND_PPCF128, "llroundl")
  267. HANDLE_LIBCALL(LRINT_F32, "lrintf")
  268. HANDLE_LIBCALL(LRINT_F64, "lrint")
  269. HANDLE_LIBCALL(LRINT_F80, "lrintl")
  270. HANDLE_LIBCALL(LRINT_F128, "lrintl")
  271. HANDLE_LIBCALL(LRINT_PPCF128, "lrintl")
  272. HANDLE_LIBCALL(LLRINT_F32, "llrintf")
  273. HANDLE_LIBCALL(LLRINT_F64, "llrint")
  274. HANDLE_LIBCALL(LLRINT_F80, "llrintl")
  275. HANDLE_LIBCALL(LLRINT_F128, "llrintl")
  276. HANDLE_LIBCALL(LLRINT_PPCF128, "llrintl")
  277. // Conversion
  278. HANDLE_LIBCALL(FPEXT_F32_PPCF128, "__gcc_stoq")
  279. HANDLE_LIBCALL(FPEXT_F64_PPCF128, "__gcc_dtoq")
  280. HANDLE_LIBCALL(FPEXT_F80_F128, "__extendxftf2")
  281. HANDLE_LIBCALL(FPEXT_F64_F128, "__extenddftf2")
  282. HANDLE_LIBCALL(FPEXT_F32_F128, "__extendsftf2")
  283. HANDLE_LIBCALL(FPEXT_F16_F128, "__extendhftf2")
  284. HANDLE_LIBCALL(FPEXT_F16_F80, "__extendhfxf2")
  285. HANDLE_LIBCALL(FPEXT_F32_F64, "__extendsfdf2")
  286. HANDLE_LIBCALL(FPEXT_F16_F64, "__extendhfdf2")
  287. HANDLE_LIBCALL(FPEXT_F16_F32, "__gnu_h2f_ieee")
  288. HANDLE_LIBCALL(FPROUND_F32_F16, "__gnu_f2h_ieee")
  289. HANDLE_LIBCALL(FPROUND_F64_F16, "__truncdfhf2")
  290. HANDLE_LIBCALL(FPROUND_F80_F16, "__truncxfhf2")
  291. HANDLE_LIBCALL(FPROUND_F128_F16, "__trunctfhf2")
  292. HANDLE_LIBCALL(FPROUND_PPCF128_F16, "__trunctfhf2")
  293. HANDLE_LIBCALL(FPROUND_F32_BF16, "__truncsfbf2")
  294. HANDLE_LIBCALL(FPROUND_F64_BF16, "__truncdfbf2")
  295. HANDLE_LIBCALL(FPROUND_F64_F32, "__truncdfsf2")
  296. HANDLE_LIBCALL(FPROUND_F80_F32, "__truncxfsf2")
  297. HANDLE_LIBCALL(FPROUND_F128_F32, "__trunctfsf2")
  298. HANDLE_LIBCALL(FPROUND_PPCF128_F32, "__gcc_qtos")
  299. HANDLE_LIBCALL(FPROUND_F80_F64, "__truncxfdf2")
  300. HANDLE_LIBCALL(FPROUND_F128_F64, "__trunctfdf2")
  301. HANDLE_LIBCALL(FPROUND_PPCF128_F64, "__gcc_qtod")
  302. HANDLE_LIBCALL(FPROUND_F128_F80, "__trunctfxf2")
  303. HANDLE_LIBCALL(FPTOSINT_F16_I32, "__fixhfsi")
  304. HANDLE_LIBCALL(FPTOSINT_F16_I64, "__fixhfdi")
  305. HANDLE_LIBCALL(FPTOSINT_F16_I128, "__fixhfti")
  306. HANDLE_LIBCALL(FPTOSINT_F32_I32, "__fixsfsi")
  307. HANDLE_LIBCALL(FPTOSINT_F32_I64, "__fixsfdi")
  308. HANDLE_LIBCALL(FPTOSINT_F32_I128, "__fixsfti")
  309. HANDLE_LIBCALL(FPTOSINT_F64_I32, "__fixdfsi")
  310. HANDLE_LIBCALL(FPTOSINT_F64_I64, "__fixdfdi")
  311. HANDLE_LIBCALL(FPTOSINT_F64_I128, "__fixdfti")
  312. HANDLE_LIBCALL(FPTOSINT_F80_I32, "__fixxfsi")
  313. HANDLE_LIBCALL(FPTOSINT_F80_I64, "__fixxfdi")
  314. HANDLE_LIBCALL(FPTOSINT_F80_I128, "__fixxfti")
  315. HANDLE_LIBCALL(FPTOSINT_F128_I32, "__fixtfsi")
  316. HANDLE_LIBCALL(FPTOSINT_F128_I64, "__fixtfdi")
  317. HANDLE_LIBCALL(FPTOSINT_F128_I128, "__fixtfti")
  318. HANDLE_LIBCALL(FPTOSINT_PPCF128_I32, "__gcc_qtou")
  319. HANDLE_LIBCALL(FPTOSINT_PPCF128_I64, "__fixtfdi")
  320. HANDLE_LIBCALL(FPTOSINT_PPCF128_I128, "__fixtfti")
  321. HANDLE_LIBCALL(FPTOUINT_F16_I32, "__fixunshfsi")
  322. HANDLE_LIBCALL(FPTOUINT_F16_I64, "__fixunshfdi")
  323. HANDLE_LIBCALL(FPTOUINT_F16_I128, "__fixunshfti")
  324. HANDLE_LIBCALL(FPTOUINT_F32_I32, "__fixunssfsi")
  325. HANDLE_LIBCALL(FPTOUINT_F32_I64, "__fixunssfdi")
  326. HANDLE_LIBCALL(FPTOUINT_F32_I128, "__fixunssfti")
  327. HANDLE_LIBCALL(FPTOUINT_F64_I32, "__fixunsdfsi")
  328. HANDLE_LIBCALL(FPTOUINT_F64_I64, "__fixunsdfdi")
  329. HANDLE_LIBCALL(FPTOUINT_F64_I128, "__fixunsdfti")
  330. HANDLE_LIBCALL(FPTOUINT_F80_I32, "__fixunsxfsi")
  331. HANDLE_LIBCALL(FPTOUINT_F80_I64, "__fixunsxfdi")
  332. HANDLE_LIBCALL(FPTOUINT_F80_I128, "__fixunsxfti")
  333. HANDLE_LIBCALL(FPTOUINT_F128_I32, "__fixunstfsi")
  334. HANDLE_LIBCALL(FPTOUINT_F128_I64, "__fixunstfdi")
  335. HANDLE_LIBCALL(FPTOUINT_F128_I128, "__fixunstfti")
  336. HANDLE_LIBCALL(FPTOUINT_PPCF128_I32, "__fixunstfsi")
  337. HANDLE_LIBCALL(FPTOUINT_PPCF128_I64, "__fixunstfdi")
  338. HANDLE_LIBCALL(FPTOUINT_PPCF128_I128, "__fixunstfti")
  339. HANDLE_LIBCALL(SINTTOFP_I32_F16, "__floatsihf")
  340. HANDLE_LIBCALL(SINTTOFP_I32_F32, "__floatsisf")
  341. HANDLE_LIBCALL(SINTTOFP_I32_F64, "__floatsidf")
  342. HANDLE_LIBCALL(SINTTOFP_I32_F80, "__floatsixf")
  343. HANDLE_LIBCALL(SINTTOFP_I32_F128, "__floatsitf")
  344. HANDLE_LIBCALL(SINTTOFP_I32_PPCF128, "__gcc_itoq")
  345. HANDLE_LIBCALL(SINTTOFP_I64_F16, "__floatdihf")
  346. HANDLE_LIBCALL(SINTTOFP_I64_F32, "__floatdisf")
  347. HANDLE_LIBCALL(SINTTOFP_I64_F64, "__floatdidf")
  348. HANDLE_LIBCALL(SINTTOFP_I64_F80, "__floatdixf")
  349. HANDLE_LIBCALL(SINTTOFP_I64_F128, "__floatditf")
  350. HANDLE_LIBCALL(SINTTOFP_I64_PPCF128, "__floatditf")
  351. HANDLE_LIBCALL(SINTTOFP_I128_F16, "__floattihf")
  352. HANDLE_LIBCALL(SINTTOFP_I128_F32, "__floattisf")
  353. HANDLE_LIBCALL(SINTTOFP_I128_F64, "__floattidf")
  354. HANDLE_LIBCALL(SINTTOFP_I128_F80, "__floattixf")
  355. HANDLE_LIBCALL(SINTTOFP_I128_F128, "__floattitf")
  356. HANDLE_LIBCALL(SINTTOFP_I128_PPCF128, "__floattitf")
  357. HANDLE_LIBCALL(UINTTOFP_I32_F16, "__floatunsihf")
  358. HANDLE_LIBCALL(UINTTOFP_I32_F32, "__floatunsisf")
  359. HANDLE_LIBCALL(UINTTOFP_I32_F64, "__floatunsidf")
  360. HANDLE_LIBCALL(UINTTOFP_I32_F80, "__floatunsixf")
  361. HANDLE_LIBCALL(UINTTOFP_I32_F128, "__floatunsitf")
  362. HANDLE_LIBCALL(UINTTOFP_I32_PPCF128, "__gcc_utoq")
  363. HANDLE_LIBCALL(UINTTOFP_I64_F16, "__floatundihf")
  364. HANDLE_LIBCALL(UINTTOFP_I64_F32, "__floatundisf")
  365. HANDLE_LIBCALL(UINTTOFP_I64_F64, "__floatundidf")
  366. HANDLE_LIBCALL(UINTTOFP_I64_F80, "__floatundixf")
  367. HANDLE_LIBCALL(UINTTOFP_I64_F128, "__floatunditf")
  368. HANDLE_LIBCALL(UINTTOFP_I64_PPCF128, "__floatunditf")
  369. HANDLE_LIBCALL(UINTTOFP_I128_F16, "__floatuntihf")
  370. HANDLE_LIBCALL(UINTTOFP_I128_F32, "__floatuntisf")
  371. HANDLE_LIBCALL(UINTTOFP_I128_F64, "__floatuntidf")
  372. HANDLE_LIBCALL(UINTTOFP_I128_F80, "__floatuntixf")
  373. HANDLE_LIBCALL(UINTTOFP_I128_F128, "__floatuntitf")
  374. HANDLE_LIBCALL(UINTTOFP_I128_PPCF128, "__floatuntitf")
  375. HANDLE_LIBCALL(CONVERT_F128_PPCF128, "__extendkftf2")
  376. HANDLE_LIBCALL(CONVERT_PPCF128_F128, "__trunctfkf2")
  377. // Comparison
  378. HANDLE_LIBCALL(OEQ_F32, "__eqsf2")
  379. HANDLE_LIBCALL(OEQ_F64, "__eqdf2")
  380. HANDLE_LIBCALL(OEQ_F128, "__eqtf2")
  381. HANDLE_LIBCALL(OEQ_PPCF128, "__gcc_qeq")
  382. HANDLE_LIBCALL(UNE_F32, "__nesf2")
  383. HANDLE_LIBCALL(UNE_F64, "__nedf2")
  384. HANDLE_LIBCALL(UNE_F128, "__netf2")
  385. HANDLE_LIBCALL(UNE_PPCF128, "__gcc_qne")
  386. HANDLE_LIBCALL(OGE_F32, "__gesf2")
  387. HANDLE_LIBCALL(OGE_F64, "__gedf2")
  388. HANDLE_LIBCALL(OGE_F128, "__getf2")
  389. HANDLE_LIBCALL(OGE_PPCF128, "__gcc_qge")
  390. HANDLE_LIBCALL(OLT_F32, "__ltsf2")
  391. HANDLE_LIBCALL(OLT_F64, "__ltdf2")
  392. HANDLE_LIBCALL(OLT_F128, "__lttf2")
  393. HANDLE_LIBCALL(OLT_PPCF128, "__gcc_qlt")
  394. HANDLE_LIBCALL(OLE_F32, "__lesf2")
  395. HANDLE_LIBCALL(OLE_F64, "__ledf2")
  396. HANDLE_LIBCALL(OLE_F128, "__letf2")
  397. HANDLE_LIBCALL(OLE_PPCF128, "__gcc_qle")
  398. HANDLE_LIBCALL(OGT_F32, "__gtsf2")
  399. HANDLE_LIBCALL(OGT_F64, "__gtdf2")
  400. HANDLE_LIBCALL(OGT_F128, "__gttf2")
  401. HANDLE_LIBCALL(OGT_PPCF128, "__gcc_qgt")
  402. HANDLE_LIBCALL(UO_F32, "__unordsf2")
  403. HANDLE_LIBCALL(UO_F64, "__unorddf2")
  404. HANDLE_LIBCALL(UO_F128, "__unordtf2")
  405. HANDLE_LIBCALL(UO_PPCF128, "__gcc_qunord")
  406. // Memory
  407. HANDLE_LIBCALL(MEMCPY, "memcpy")
  408. HANDLE_LIBCALL(MEMMOVE, "memmove")
  409. HANDLE_LIBCALL(MEMSET, "memset")
  410. HANDLE_LIBCALL(BZERO, nullptr)
  411. // Element-wise unordered-atomic memory of different sizes
  412. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memcpy_element_unordered_atomic_1")
  413. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memcpy_element_unordered_atomic_2")
  414. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memcpy_element_unordered_atomic_4")
  415. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memcpy_element_unordered_atomic_8")
  416. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memcpy_element_unordered_atomic_16")
  417. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memmove_element_unordered_atomic_1")
  418. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memmove_element_unordered_atomic_2")
  419. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memmove_element_unordered_atomic_4")
  420. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memmove_element_unordered_atomic_8")
  421. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memmove_element_unordered_atomic_16")
  422. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memset_element_unordered_atomic_1")
  423. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memset_element_unordered_atomic_2")
  424. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memset_element_unordered_atomic_4")
  425. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memset_element_unordered_atomic_8")
  426. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memset_element_unordered_atomic_16")
  427. // Exception handling
  428. HANDLE_LIBCALL(UNWIND_RESUME, "_Unwind_Resume")
  429. HANDLE_LIBCALL(CXA_END_CLEANUP, "__cxa_end_cleanup")
  430. // Note: there are two sets of atomics libcalls; see
  431. // <https://llvm.org/docs/Atomics.html> for more info on the
  432. // difference between them.
  433. // Atomic '__sync_*' libcalls.
  434. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_1, "__sync_val_compare_and_swap_1")
  435. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_2, "__sync_val_compare_and_swap_2")
  436. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_4, "__sync_val_compare_and_swap_4")
  437. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_8, "__sync_val_compare_and_swap_8")
  438. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_16, "__sync_val_compare_and_swap_16")
  439. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_1, "__sync_lock_test_and_set_1")
  440. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_2, "__sync_lock_test_and_set_2")
  441. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_4, "__sync_lock_test_and_set_4")
  442. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_8, "__sync_lock_test_and_set_8")
  443. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_16, "__sync_lock_test_and_set_16")
  444. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_1, "__sync_fetch_and_add_1")
  445. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_2, "__sync_fetch_and_add_2")
  446. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_4, "__sync_fetch_and_add_4")
  447. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_8, "__sync_fetch_and_add_8")
  448. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_16, "__sync_fetch_and_add_16")
  449. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_1, "__sync_fetch_and_sub_1")
  450. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_2, "__sync_fetch_and_sub_2")
  451. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_4, "__sync_fetch_and_sub_4")
  452. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_8, "__sync_fetch_and_sub_8")
  453. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_16, "__sync_fetch_and_sub_16")
  454. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_1, "__sync_fetch_and_and_1")
  455. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_2, "__sync_fetch_and_and_2")
  456. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_4, "__sync_fetch_and_and_4")
  457. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_8, "__sync_fetch_and_and_8")
  458. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_16, "__sync_fetch_and_and_16")
  459. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_1, "__sync_fetch_and_or_1")
  460. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_2, "__sync_fetch_and_or_2")
  461. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_4, "__sync_fetch_and_or_4")
  462. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_8, "__sync_fetch_and_or_8")
  463. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_16, "__sync_fetch_and_or_16")
  464. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_1, "__sync_fetch_and_xor_1")
  465. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_2, "__sync_fetch_and_xor_2")
  466. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_4, "__sync_fetch_and_xor_4")
  467. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_8, "__sync_fetch_and_xor_8")
  468. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_16, "__sync_fetch_and_xor_16")
  469. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_1, "__sync_fetch_and_nand_1")
  470. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_2, "__sync_fetch_and_nand_2")
  471. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_4, "__sync_fetch_and_nand_4")
  472. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_8, "__sync_fetch_and_nand_8")
  473. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_16, "__sync_fetch_and_nand_16")
  474. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_1, "__sync_fetch_and_max_1")
  475. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_2, "__sync_fetch_and_max_2")
  476. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_4, "__sync_fetch_and_max_4")
  477. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_8, "__sync_fetch_and_max_8")
  478. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_16, "__sync_fetch_and_max_16")
  479. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_1, "__sync_fetch_and_umax_1")
  480. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_2, "__sync_fetch_and_umax_2")
  481. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_4, "__sync_fetch_and_umax_4")
  482. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_8, "__sync_fetch_and_umax_8")
  483. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_16, "__sync_fetch_and_umax_16")
  484. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_1, "__sync_fetch_and_min_1")
  485. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_2, "__sync_fetch_and_min_2")
  486. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_4, "__sync_fetch_and_min_4")
  487. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_8, "__sync_fetch_and_min_8")
  488. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_16, "__sync_fetch_and_min_16")
  489. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_1, "__sync_fetch_and_umin_1")
  490. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_2, "__sync_fetch_and_umin_2")
  491. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_4, "__sync_fetch_and_umin_4")
  492. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_8, "__sync_fetch_and_umin_8")
  493. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_16, "__sync_fetch_and_umin_16")
  494. // Atomic `__atomic_*' libcalls.
  495. HANDLE_LIBCALL(ATOMIC_LOAD, "__atomic_load")
  496. HANDLE_LIBCALL(ATOMIC_LOAD_1, "__atomic_load_1")
  497. HANDLE_LIBCALL(ATOMIC_LOAD_2, "__atomic_load_2")
  498. HANDLE_LIBCALL(ATOMIC_LOAD_4, "__atomic_load_4")
  499. HANDLE_LIBCALL(ATOMIC_LOAD_8, "__atomic_load_8")
  500. HANDLE_LIBCALL(ATOMIC_LOAD_16, "__atomic_load_16")
  501. HANDLE_LIBCALL(ATOMIC_STORE, "__atomic_store")
  502. HANDLE_LIBCALL(ATOMIC_STORE_1, "__atomic_store_1")
  503. HANDLE_LIBCALL(ATOMIC_STORE_2, "__atomic_store_2")
  504. HANDLE_LIBCALL(ATOMIC_STORE_4, "__atomic_store_4")
  505. HANDLE_LIBCALL(ATOMIC_STORE_8, "__atomic_store_8")
  506. HANDLE_LIBCALL(ATOMIC_STORE_16, "__atomic_store_16")
  507. HANDLE_LIBCALL(ATOMIC_EXCHANGE, "__atomic_exchange")
  508. HANDLE_LIBCALL(ATOMIC_EXCHANGE_1, "__atomic_exchange_1")
  509. HANDLE_LIBCALL(ATOMIC_EXCHANGE_2, "__atomic_exchange_2")
  510. HANDLE_LIBCALL(ATOMIC_EXCHANGE_4, "__atomic_exchange_4")
  511. HANDLE_LIBCALL(ATOMIC_EXCHANGE_8, "__atomic_exchange_8")
  512. HANDLE_LIBCALL(ATOMIC_EXCHANGE_16, "__atomic_exchange_16")
  513. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE, "__atomic_compare_exchange")
  514. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_1, "__atomic_compare_exchange_1")
  515. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_2, "__atomic_compare_exchange_2")
  516. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_4, "__atomic_compare_exchange_4")
  517. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_8, "__atomic_compare_exchange_8")
  518. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_16, "__atomic_compare_exchange_16")
  519. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_1, "__atomic_fetch_add_1")
  520. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_2, "__atomic_fetch_add_2")
  521. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_4, "__atomic_fetch_add_4")
  522. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_8, "__atomic_fetch_add_8")
  523. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_16, "__atomic_fetch_add_16")
  524. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_1, "__atomic_fetch_sub_1")
  525. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_2, "__atomic_fetch_sub_2")
  526. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_4, "__atomic_fetch_sub_4")
  527. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_8, "__atomic_fetch_sub_8")
  528. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_16, "__atomic_fetch_sub_16")
  529. HANDLE_LIBCALL(ATOMIC_FETCH_AND_1, "__atomic_fetch_and_1")
  530. HANDLE_LIBCALL(ATOMIC_FETCH_AND_2, "__atomic_fetch_and_2")
  531. HANDLE_LIBCALL(ATOMIC_FETCH_AND_4, "__atomic_fetch_and_4")
  532. HANDLE_LIBCALL(ATOMIC_FETCH_AND_8, "__atomic_fetch_and_8")
  533. HANDLE_LIBCALL(ATOMIC_FETCH_AND_16, "__atomic_fetch_and_16")
  534. HANDLE_LIBCALL(ATOMIC_FETCH_OR_1, "__atomic_fetch_or_1")
  535. HANDLE_LIBCALL(ATOMIC_FETCH_OR_2, "__atomic_fetch_or_2")
  536. HANDLE_LIBCALL(ATOMIC_FETCH_OR_4, "__atomic_fetch_or_4")
  537. HANDLE_LIBCALL(ATOMIC_FETCH_OR_8, "__atomic_fetch_or_8")
  538. HANDLE_LIBCALL(ATOMIC_FETCH_OR_16, "__atomic_fetch_or_16")
  539. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_1, "__atomic_fetch_xor_1")
  540. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_2, "__atomic_fetch_xor_2")
  541. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_4, "__atomic_fetch_xor_4")
  542. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_8, "__atomic_fetch_xor_8")
  543. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_16, "__atomic_fetch_xor_16")
  544. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_1, "__atomic_fetch_nand_1")
  545. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_2, "__atomic_fetch_nand_2")
  546. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_4, "__atomic_fetch_nand_4")
  547. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_8, "__atomic_fetch_nand_8")
  548. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_16, "__atomic_fetch_nand_16")
  549. // Out-of-line atomics libcalls
  550. #define HLCALLS(A, N) \
  551. HANDLE_LIBCALL(A##N##_RELAX, nullptr) \
  552. HANDLE_LIBCALL(A##N##_ACQ, nullptr) \
  553. HANDLE_LIBCALL(A##N##_REL, nullptr) \
  554. HANDLE_LIBCALL(A##N##_ACQ_REL, nullptr)
  555. #define HLCALL5(A) \
  556. HLCALLS(A, 1) HLCALLS(A, 2) HLCALLS(A, 4) HLCALLS(A, 8) HLCALLS(A, 16)
  557. HLCALL5(OUTLINE_ATOMIC_CAS)
  558. HLCALL5(OUTLINE_ATOMIC_SWP)
  559. HLCALL5(OUTLINE_ATOMIC_LDADD)
  560. HLCALL5(OUTLINE_ATOMIC_LDSET)
  561. HLCALL5(OUTLINE_ATOMIC_LDCLR)
  562. HLCALL5(OUTLINE_ATOMIC_LDEOR)
  563. #undef HLCALLS
  564. #undef HLCALL5
  565. // Stack Protector Fail
  566. HANDLE_LIBCALL(STACKPROTECTOR_CHECK_FAIL, "__stack_chk_fail")
  567. // Deoptimization
  568. HANDLE_LIBCALL(DEOPTIMIZE, "__llvm_deoptimize")
  569. // Return address
  570. HANDLE_LIBCALL(RETURN_ADDRESS, nullptr)
  571. HANDLE_LIBCALL(UNKNOWN_LIBCALL, nullptr)