RuntimeLibcalls.def 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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_F32_F64, "__extendsfdf2")
  285. HANDLE_LIBCALL(FPEXT_F16_F64, "__extendhfdf2")
  286. HANDLE_LIBCALL(FPEXT_F16_F32, "__gnu_h2f_ieee")
  287. HANDLE_LIBCALL(FPROUND_F32_F16, "__gnu_f2h_ieee")
  288. HANDLE_LIBCALL(FPROUND_F64_F16, "__truncdfhf2")
  289. HANDLE_LIBCALL(FPROUND_F80_F16, "__truncxfhf2")
  290. HANDLE_LIBCALL(FPROUND_F128_F16, "__trunctfhf2")
  291. HANDLE_LIBCALL(FPROUND_PPCF128_F16, "__trunctfhf2")
  292. HANDLE_LIBCALL(FPROUND_F64_F32, "__truncdfsf2")
  293. HANDLE_LIBCALL(FPROUND_F80_F32, "__truncxfsf2")
  294. HANDLE_LIBCALL(FPROUND_F128_F32, "__trunctfsf2")
  295. HANDLE_LIBCALL(FPROUND_PPCF128_F32, "__gcc_qtos")
  296. HANDLE_LIBCALL(FPROUND_F80_F64, "__truncxfdf2")
  297. HANDLE_LIBCALL(FPROUND_F128_F64, "__trunctfdf2")
  298. HANDLE_LIBCALL(FPROUND_PPCF128_F64, "__gcc_qtod")
  299. HANDLE_LIBCALL(FPROUND_F128_F80, "__trunctfxf2")
  300. HANDLE_LIBCALL(FPTOSINT_F16_I32, "__fixhfsi")
  301. HANDLE_LIBCALL(FPTOSINT_F16_I64, "__fixhfdi")
  302. HANDLE_LIBCALL(FPTOSINT_F16_I128, "__fixhfti")
  303. HANDLE_LIBCALL(FPTOSINT_F32_I32, "__fixsfsi")
  304. HANDLE_LIBCALL(FPTOSINT_F32_I64, "__fixsfdi")
  305. HANDLE_LIBCALL(FPTOSINT_F32_I128, "__fixsfti")
  306. HANDLE_LIBCALL(FPTOSINT_F64_I32, "__fixdfsi")
  307. HANDLE_LIBCALL(FPTOSINT_F64_I64, "__fixdfdi")
  308. HANDLE_LIBCALL(FPTOSINT_F64_I128, "__fixdfti")
  309. HANDLE_LIBCALL(FPTOSINT_F80_I32, "__fixxfsi")
  310. HANDLE_LIBCALL(FPTOSINT_F80_I64, "__fixxfdi")
  311. HANDLE_LIBCALL(FPTOSINT_F80_I128, "__fixxfti")
  312. HANDLE_LIBCALL(FPTOSINT_F128_I32, "__fixtfsi")
  313. HANDLE_LIBCALL(FPTOSINT_F128_I64, "__fixtfdi")
  314. HANDLE_LIBCALL(FPTOSINT_F128_I128, "__fixtfti")
  315. HANDLE_LIBCALL(FPTOSINT_PPCF128_I32, "__gcc_qtou")
  316. HANDLE_LIBCALL(FPTOSINT_PPCF128_I64, "__fixtfdi")
  317. HANDLE_LIBCALL(FPTOSINT_PPCF128_I128, "__fixtfti")
  318. HANDLE_LIBCALL(FPTOUINT_F16_I32, "__fixunshfsi")
  319. HANDLE_LIBCALL(FPTOUINT_F16_I64, "__fixunshfdi")
  320. HANDLE_LIBCALL(FPTOUINT_F16_I128, "__fixunshfti")
  321. HANDLE_LIBCALL(FPTOUINT_F32_I32, "__fixunssfsi")
  322. HANDLE_LIBCALL(FPTOUINT_F32_I64, "__fixunssfdi")
  323. HANDLE_LIBCALL(FPTOUINT_F32_I128, "__fixunssfti")
  324. HANDLE_LIBCALL(FPTOUINT_F64_I32, "__fixunsdfsi")
  325. HANDLE_LIBCALL(FPTOUINT_F64_I64, "__fixunsdfdi")
  326. HANDLE_LIBCALL(FPTOUINT_F64_I128, "__fixunsdfti")
  327. HANDLE_LIBCALL(FPTOUINT_F80_I32, "__fixunsxfsi")
  328. HANDLE_LIBCALL(FPTOUINT_F80_I64, "__fixunsxfdi")
  329. HANDLE_LIBCALL(FPTOUINT_F80_I128, "__fixunsxfti")
  330. HANDLE_LIBCALL(FPTOUINT_F128_I32, "__fixunstfsi")
  331. HANDLE_LIBCALL(FPTOUINT_F128_I64, "__fixunstfdi")
  332. HANDLE_LIBCALL(FPTOUINT_F128_I128, "__fixunstfti")
  333. HANDLE_LIBCALL(FPTOUINT_PPCF128_I32, "__fixunstfsi")
  334. HANDLE_LIBCALL(FPTOUINT_PPCF128_I64, "__fixunstfdi")
  335. HANDLE_LIBCALL(FPTOUINT_PPCF128_I128, "__fixunstfti")
  336. HANDLE_LIBCALL(SINTTOFP_I32_F16, "__floatsihf")
  337. HANDLE_LIBCALL(SINTTOFP_I32_F32, "__floatsisf")
  338. HANDLE_LIBCALL(SINTTOFP_I32_F64, "__floatsidf")
  339. HANDLE_LIBCALL(SINTTOFP_I32_F80, "__floatsixf")
  340. HANDLE_LIBCALL(SINTTOFP_I32_F128, "__floatsitf")
  341. HANDLE_LIBCALL(SINTTOFP_I32_PPCF128, "__gcc_itoq")
  342. HANDLE_LIBCALL(SINTTOFP_I64_F16, "__floatdihf")
  343. HANDLE_LIBCALL(SINTTOFP_I64_F32, "__floatdisf")
  344. HANDLE_LIBCALL(SINTTOFP_I64_F64, "__floatdidf")
  345. HANDLE_LIBCALL(SINTTOFP_I64_F80, "__floatdixf")
  346. HANDLE_LIBCALL(SINTTOFP_I64_F128, "__floatditf")
  347. HANDLE_LIBCALL(SINTTOFP_I64_PPCF128, "__floatditf")
  348. HANDLE_LIBCALL(SINTTOFP_I128_F16, "__floattihf")
  349. HANDLE_LIBCALL(SINTTOFP_I128_F32, "__floattisf")
  350. HANDLE_LIBCALL(SINTTOFP_I128_F64, "__floattidf")
  351. HANDLE_LIBCALL(SINTTOFP_I128_F80, "__floattixf")
  352. HANDLE_LIBCALL(SINTTOFP_I128_F128, "__floattitf")
  353. HANDLE_LIBCALL(SINTTOFP_I128_PPCF128, "__floattitf")
  354. HANDLE_LIBCALL(UINTTOFP_I32_F16, "__floatunsihf")
  355. HANDLE_LIBCALL(UINTTOFP_I32_F32, "__floatunsisf")
  356. HANDLE_LIBCALL(UINTTOFP_I32_F64, "__floatunsidf")
  357. HANDLE_LIBCALL(UINTTOFP_I32_F80, "__floatunsixf")
  358. HANDLE_LIBCALL(UINTTOFP_I32_F128, "__floatunsitf")
  359. HANDLE_LIBCALL(UINTTOFP_I32_PPCF128, "__gcc_utoq")
  360. HANDLE_LIBCALL(UINTTOFP_I64_F16, "__floatundihf")
  361. HANDLE_LIBCALL(UINTTOFP_I64_F32, "__floatundisf")
  362. HANDLE_LIBCALL(UINTTOFP_I64_F64, "__floatundidf")
  363. HANDLE_LIBCALL(UINTTOFP_I64_F80, "__floatundixf")
  364. HANDLE_LIBCALL(UINTTOFP_I64_F128, "__floatunditf")
  365. HANDLE_LIBCALL(UINTTOFP_I64_PPCF128, "__floatunditf")
  366. HANDLE_LIBCALL(UINTTOFP_I128_F16, "__floatuntihf")
  367. HANDLE_LIBCALL(UINTTOFP_I128_F32, "__floatuntisf")
  368. HANDLE_LIBCALL(UINTTOFP_I128_F64, "__floatuntidf")
  369. HANDLE_LIBCALL(UINTTOFP_I128_F80, "__floatuntixf")
  370. HANDLE_LIBCALL(UINTTOFP_I128_F128, "__floatuntitf")
  371. HANDLE_LIBCALL(UINTTOFP_I128_PPCF128, "__floatuntitf")
  372. // Comparison
  373. HANDLE_LIBCALL(OEQ_F32, "__eqsf2")
  374. HANDLE_LIBCALL(OEQ_F64, "__eqdf2")
  375. HANDLE_LIBCALL(OEQ_F128, "__eqtf2")
  376. HANDLE_LIBCALL(OEQ_PPCF128, "__gcc_qeq")
  377. HANDLE_LIBCALL(UNE_F32, "__nesf2")
  378. HANDLE_LIBCALL(UNE_F64, "__nedf2")
  379. HANDLE_LIBCALL(UNE_F128, "__netf2")
  380. HANDLE_LIBCALL(UNE_PPCF128, "__gcc_qne")
  381. HANDLE_LIBCALL(OGE_F32, "__gesf2")
  382. HANDLE_LIBCALL(OGE_F64, "__gedf2")
  383. HANDLE_LIBCALL(OGE_F128, "__getf2")
  384. HANDLE_LIBCALL(OGE_PPCF128, "__gcc_qge")
  385. HANDLE_LIBCALL(OLT_F32, "__ltsf2")
  386. HANDLE_LIBCALL(OLT_F64, "__ltdf2")
  387. HANDLE_LIBCALL(OLT_F128, "__lttf2")
  388. HANDLE_LIBCALL(OLT_PPCF128, "__gcc_qlt")
  389. HANDLE_LIBCALL(OLE_F32, "__lesf2")
  390. HANDLE_LIBCALL(OLE_F64, "__ledf2")
  391. HANDLE_LIBCALL(OLE_F128, "__letf2")
  392. HANDLE_LIBCALL(OLE_PPCF128, "__gcc_qle")
  393. HANDLE_LIBCALL(OGT_F32, "__gtsf2")
  394. HANDLE_LIBCALL(OGT_F64, "__gtdf2")
  395. HANDLE_LIBCALL(OGT_F128, "__gttf2")
  396. HANDLE_LIBCALL(OGT_PPCF128, "__gcc_qgt")
  397. HANDLE_LIBCALL(UO_F32, "__unordsf2")
  398. HANDLE_LIBCALL(UO_F64, "__unorddf2")
  399. HANDLE_LIBCALL(UO_F128, "__unordtf2")
  400. HANDLE_LIBCALL(UO_PPCF128, "__gcc_qunord")
  401. // Memory
  402. HANDLE_LIBCALL(MEMCPY, "memcpy")
  403. HANDLE_LIBCALL(MEMMOVE, "memmove")
  404. HANDLE_LIBCALL(MEMSET, "memset")
  405. HANDLE_LIBCALL(BZERO, nullptr)
  406. // Element-wise unordered-atomic memory of different sizes
  407. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memcpy_element_unordered_atomic_1")
  408. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memcpy_element_unordered_atomic_2")
  409. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memcpy_element_unordered_atomic_4")
  410. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memcpy_element_unordered_atomic_8")
  411. HANDLE_LIBCALL(MEMCPY_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memcpy_element_unordered_atomic_16")
  412. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memmove_element_unordered_atomic_1")
  413. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memmove_element_unordered_atomic_2")
  414. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memmove_element_unordered_atomic_4")
  415. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memmove_element_unordered_atomic_8")
  416. HANDLE_LIBCALL(MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memmove_element_unordered_atomic_16")
  417. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_1, "__llvm_memset_element_unordered_atomic_1")
  418. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_2, "__llvm_memset_element_unordered_atomic_2")
  419. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_4, "__llvm_memset_element_unordered_atomic_4")
  420. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_8, "__llvm_memset_element_unordered_atomic_8")
  421. HANDLE_LIBCALL(MEMSET_ELEMENT_UNORDERED_ATOMIC_16, "__llvm_memset_element_unordered_atomic_16")
  422. // Exception handling
  423. HANDLE_LIBCALL(UNWIND_RESUME, "_Unwind_Resume")
  424. // Note: there are two sets of atomics libcalls; see
  425. // <https://llvm.org/docs/Atomics.html> for more info on the
  426. // difference between them.
  427. // Atomic '__sync_*' libcalls.
  428. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_1, "__sync_val_compare_and_swap_1")
  429. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_2, "__sync_val_compare_and_swap_2")
  430. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_4, "__sync_val_compare_and_swap_4")
  431. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_8, "__sync_val_compare_and_swap_8")
  432. HANDLE_LIBCALL(SYNC_VAL_COMPARE_AND_SWAP_16, "__sync_val_compare_and_swap_16")
  433. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_1, "__sync_lock_test_and_set_1")
  434. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_2, "__sync_lock_test_and_set_2")
  435. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_4, "__sync_lock_test_and_set_4")
  436. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_8, "__sync_lock_test_and_set_8")
  437. HANDLE_LIBCALL(SYNC_LOCK_TEST_AND_SET_16, "__sync_lock_test_and_set_16")
  438. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_1, "__sync_fetch_and_add_1")
  439. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_2, "__sync_fetch_and_add_2")
  440. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_4, "__sync_fetch_and_add_4")
  441. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_8, "__sync_fetch_and_add_8")
  442. HANDLE_LIBCALL(SYNC_FETCH_AND_ADD_16, "__sync_fetch_and_add_16")
  443. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_1, "__sync_fetch_and_sub_1")
  444. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_2, "__sync_fetch_and_sub_2")
  445. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_4, "__sync_fetch_and_sub_4")
  446. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_8, "__sync_fetch_and_sub_8")
  447. HANDLE_LIBCALL(SYNC_FETCH_AND_SUB_16, "__sync_fetch_and_sub_16")
  448. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_1, "__sync_fetch_and_and_1")
  449. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_2, "__sync_fetch_and_and_2")
  450. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_4, "__sync_fetch_and_and_4")
  451. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_8, "__sync_fetch_and_and_8")
  452. HANDLE_LIBCALL(SYNC_FETCH_AND_AND_16, "__sync_fetch_and_and_16")
  453. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_1, "__sync_fetch_and_or_1")
  454. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_2, "__sync_fetch_and_or_2")
  455. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_4, "__sync_fetch_and_or_4")
  456. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_8, "__sync_fetch_and_or_8")
  457. HANDLE_LIBCALL(SYNC_FETCH_AND_OR_16, "__sync_fetch_and_or_16")
  458. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_1, "__sync_fetch_and_xor_1")
  459. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_2, "__sync_fetch_and_xor_2")
  460. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_4, "__sync_fetch_and_xor_4")
  461. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_8, "__sync_fetch_and_xor_8")
  462. HANDLE_LIBCALL(SYNC_FETCH_AND_XOR_16, "__sync_fetch_and_xor_16")
  463. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_1, "__sync_fetch_and_nand_1")
  464. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_2, "__sync_fetch_and_nand_2")
  465. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_4, "__sync_fetch_and_nand_4")
  466. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_8, "__sync_fetch_and_nand_8")
  467. HANDLE_LIBCALL(SYNC_FETCH_AND_NAND_16, "__sync_fetch_and_nand_16")
  468. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_1, "__sync_fetch_and_max_1")
  469. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_2, "__sync_fetch_and_max_2")
  470. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_4, "__sync_fetch_and_max_4")
  471. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_8, "__sync_fetch_and_max_8")
  472. HANDLE_LIBCALL(SYNC_FETCH_AND_MAX_16, "__sync_fetch_and_max_16")
  473. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_1, "__sync_fetch_and_umax_1")
  474. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_2, "__sync_fetch_and_umax_2")
  475. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_4, "__sync_fetch_and_umax_4")
  476. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_8, "__sync_fetch_and_umax_8")
  477. HANDLE_LIBCALL(SYNC_FETCH_AND_UMAX_16, "__sync_fetch_and_umax_16")
  478. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_1, "__sync_fetch_and_min_1")
  479. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_2, "__sync_fetch_and_min_2")
  480. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_4, "__sync_fetch_and_min_4")
  481. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_8, "__sync_fetch_and_min_8")
  482. HANDLE_LIBCALL(SYNC_FETCH_AND_MIN_16, "__sync_fetch_and_min_16")
  483. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_1, "__sync_fetch_and_umin_1")
  484. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_2, "__sync_fetch_and_umin_2")
  485. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_4, "__sync_fetch_and_umin_4")
  486. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_8, "__sync_fetch_and_umin_8")
  487. HANDLE_LIBCALL(SYNC_FETCH_AND_UMIN_16, "__sync_fetch_and_umin_16")
  488. // Atomic `__atomic_*' libcalls.
  489. HANDLE_LIBCALL(ATOMIC_LOAD, "__atomic_load")
  490. HANDLE_LIBCALL(ATOMIC_LOAD_1, "__atomic_load_1")
  491. HANDLE_LIBCALL(ATOMIC_LOAD_2, "__atomic_load_2")
  492. HANDLE_LIBCALL(ATOMIC_LOAD_4, "__atomic_load_4")
  493. HANDLE_LIBCALL(ATOMIC_LOAD_8, "__atomic_load_8")
  494. HANDLE_LIBCALL(ATOMIC_LOAD_16, "__atomic_load_16")
  495. HANDLE_LIBCALL(ATOMIC_STORE, "__atomic_store")
  496. HANDLE_LIBCALL(ATOMIC_STORE_1, "__atomic_store_1")
  497. HANDLE_LIBCALL(ATOMIC_STORE_2, "__atomic_store_2")
  498. HANDLE_LIBCALL(ATOMIC_STORE_4, "__atomic_store_4")
  499. HANDLE_LIBCALL(ATOMIC_STORE_8, "__atomic_store_8")
  500. HANDLE_LIBCALL(ATOMIC_STORE_16, "__atomic_store_16")
  501. HANDLE_LIBCALL(ATOMIC_EXCHANGE, "__atomic_exchange")
  502. HANDLE_LIBCALL(ATOMIC_EXCHANGE_1, "__atomic_exchange_1")
  503. HANDLE_LIBCALL(ATOMIC_EXCHANGE_2, "__atomic_exchange_2")
  504. HANDLE_LIBCALL(ATOMIC_EXCHANGE_4, "__atomic_exchange_4")
  505. HANDLE_LIBCALL(ATOMIC_EXCHANGE_8, "__atomic_exchange_8")
  506. HANDLE_LIBCALL(ATOMIC_EXCHANGE_16, "__atomic_exchange_16")
  507. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE, "__atomic_compare_exchange")
  508. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_1, "__atomic_compare_exchange_1")
  509. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_2, "__atomic_compare_exchange_2")
  510. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_4, "__atomic_compare_exchange_4")
  511. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_8, "__atomic_compare_exchange_8")
  512. HANDLE_LIBCALL(ATOMIC_COMPARE_EXCHANGE_16, "__atomic_compare_exchange_16")
  513. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_1, "__atomic_fetch_add_1")
  514. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_2, "__atomic_fetch_add_2")
  515. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_4, "__atomic_fetch_add_4")
  516. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_8, "__atomic_fetch_add_8")
  517. HANDLE_LIBCALL(ATOMIC_FETCH_ADD_16, "__atomic_fetch_add_16")
  518. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_1, "__atomic_fetch_sub_1")
  519. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_2, "__atomic_fetch_sub_2")
  520. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_4, "__atomic_fetch_sub_4")
  521. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_8, "__atomic_fetch_sub_8")
  522. HANDLE_LIBCALL(ATOMIC_FETCH_SUB_16, "__atomic_fetch_sub_16")
  523. HANDLE_LIBCALL(ATOMIC_FETCH_AND_1, "__atomic_fetch_and_1")
  524. HANDLE_LIBCALL(ATOMIC_FETCH_AND_2, "__atomic_fetch_and_2")
  525. HANDLE_LIBCALL(ATOMIC_FETCH_AND_4, "__atomic_fetch_and_4")
  526. HANDLE_LIBCALL(ATOMIC_FETCH_AND_8, "__atomic_fetch_and_8")
  527. HANDLE_LIBCALL(ATOMIC_FETCH_AND_16, "__atomic_fetch_and_16")
  528. HANDLE_LIBCALL(ATOMIC_FETCH_OR_1, "__atomic_fetch_or_1")
  529. HANDLE_LIBCALL(ATOMIC_FETCH_OR_2, "__atomic_fetch_or_2")
  530. HANDLE_LIBCALL(ATOMIC_FETCH_OR_4, "__atomic_fetch_or_4")
  531. HANDLE_LIBCALL(ATOMIC_FETCH_OR_8, "__atomic_fetch_or_8")
  532. HANDLE_LIBCALL(ATOMIC_FETCH_OR_16, "__atomic_fetch_or_16")
  533. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_1, "__atomic_fetch_xor_1")
  534. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_2, "__atomic_fetch_xor_2")
  535. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_4, "__atomic_fetch_xor_4")
  536. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_8, "__atomic_fetch_xor_8")
  537. HANDLE_LIBCALL(ATOMIC_FETCH_XOR_16, "__atomic_fetch_xor_16")
  538. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_1, "__atomic_fetch_nand_1")
  539. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_2, "__atomic_fetch_nand_2")
  540. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_4, "__atomic_fetch_nand_4")
  541. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_8, "__atomic_fetch_nand_8")
  542. HANDLE_LIBCALL(ATOMIC_FETCH_NAND_16, "__atomic_fetch_nand_16")
  543. // Out-of-line atomics libcalls
  544. #define HLCALLS(A, N) \
  545. HANDLE_LIBCALL(A##N##_RELAX, nullptr) \
  546. HANDLE_LIBCALL(A##N##_ACQ, nullptr) \
  547. HANDLE_LIBCALL(A##N##_REL, nullptr) \
  548. HANDLE_LIBCALL(A##N##_ACQ_REL, nullptr)
  549. #define HLCALL5(A) \
  550. HLCALLS(A, 1) HLCALLS(A, 2) HLCALLS(A, 4) HLCALLS(A, 8) HLCALLS(A, 16)
  551. HLCALL5(OUTLINE_ATOMIC_CAS)
  552. HLCALL5(OUTLINE_ATOMIC_SWP)
  553. HLCALL5(OUTLINE_ATOMIC_LDADD)
  554. HLCALL5(OUTLINE_ATOMIC_LDSET)
  555. HLCALL5(OUTLINE_ATOMIC_LDCLR)
  556. HLCALL5(OUTLINE_ATOMIC_LDEOR)
  557. #undef HLCALLS
  558. #undef HLCALL5
  559. // Stack Protector Fail
  560. HANDLE_LIBCALL(STACKPROTECTOR_CHECK_FAIL, "__stack_chk_fail")
  561. // Deoptimization
  562. HANDLE_LIBCALL(DEOPTIMIZE, "__llvm_deoptimize")
  563. // Return address
  564. HANDLE_LIBCALL(RETURN_ADDRESS, nullptr)
  565. HANDLE_LIBCALL(UNKNOWN_LIBCALL, nullptr)