Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

381 lines
7.7 KiB

  1. //===-- CodeGen/RuntimeLibcall.h - Runtime Library Calls --------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file defines the enum representing the list of runtime library calls
  11. // the backend may emit during code generation, and also some helper functions.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_CODEGEN_RUNTIMELIBCALLS_H
  15. #define LLVM_CODEGEN_RUNTIMELIBCALLS_H
  16. #include "llvm/CodeGen/ValueTypes.h"
  17. namespace llvm {
  18. namespace RTLIB {
  19. /// RTLIB::Libcall enum - This enum defines all of the runtime library calls
  20. /// the backend can emit. The various long double types cannot be merged,
  21. /// because 80-bit library functions use "xf" and 128-bit use "tf".
  22. ///
  23. /// When adding PPCF128 functions here, note that their names generally need
  24. /// to be overridden for Darwin with the xxx$LDBL128 form. See
  25. /// PPCISelLowering.cpp.
  26. ///
  27. enum Libcall {
  28. // Integer
  29. SHL_I16,
  30. SHL_I32,
  31. SHL_I64,
  32. SHL_I128,
  33. SRL_I16,
  34. SRL_I32,
  35. SRL_I64,
  36. SRL_I128,
  37. SRA_I16,
  38. SRA_I32,
  39. SRA_I64,
  40. SRA_I128,
  41. MUL_I8,
  42. MUL_I16,
  43. MUL_I32,
  44. MUL_I64,
  45. MUL_I128,
  46. MULO_I32,
  47. MULO_I64,
  48. MULO_I128,
  49. SDIV_I8,
  50. SDIV_I16,
  51. SDIV_I32,
  52. SDIV_I64,
  53. SDIV_I128,
  54. UDIV_I8,
  55. UDIV_I16,
  56. UDIV_I32,
  57. UDIV_I64,
  58. UDIV_I128,
  59. SREM_I8,
  60. SREM_I16,
  61. SREM_I32,
  62. SREM_I64,
  63. SREM_I128,
  64. UREM_I8,
  65. UREM_I16,
  66. UREM_I32,
  67. UREM_I64,
  68. UREM_I128,
  69. SDIVREM_I8,
  70. SDIVREM_I16,
  71. SDIVREM_I32,
  72. SDIVREM_I64,
  73. SDIVREM_I128,
  74. UDIVREM_I8,
  75. UDIVREM_I16,
  76. UDIVREM_I32,
  77. UDIVREM_I64,
  78. UDIVREM_I128,
  79. NEG_I32,
  80. NEG_I64,
  81. // FLOATING POINT
  82. ADD_F32,
  83. ADD_F64,
  84. ADD_F80,
  85. ADD_F128,
  86. ADD_PPCF128,
  87. SUB_F32,
  88. SUB_F64,
  89. SUB_F80,
  90. SUB_F128,
  91. SUB_PPCF128,
  92. MUL_F32,
  93. MUL_F64,
  94. MUL_F80,
  95. MUL_F128,
  96. MUL_PPCF128,
  97. DIV_F32,
  98. DIV_F64,
  99. DIV_F80,
  100. DIV_F128,
  101. DIV_PPCF128,
  102. REM_F32,
  103. REM_F64,
  104. REM_F80,
  105. REM_F128,
  106. REM_PPCF128,
  107. FMA_F32,
  108. FMA_F64,
  109. FMA_F80,
  110. FMA_F128,
  111. FMA_PPCF128,
  112. POWI_F32,
  113. POWI_F64,
  114. POWI_F80,
  115. POWI_F128,
  116. POWI_PPCF128,
  117. SQRT_F32,
  118. SQRT_F64,
  119. SQRT_F80,
  120. SQRT_F128,
  121. SQRT_PPCF128,
  122. LOG_F32,
  123. LOG_F64,
  124. LOG_F80,
  125. LOG_F128,
  126. LOG_PPCF128,
  127. LOG2_F32,
  128. LOG2_F64,
  129. LOG2_F80,
  130. LOG2_F128,
  131. LOG2_PPCF128,
  132. LOG10_F32,
  133. LOG10_F64,
  134. LOG10_F80,
  135. LOG10_F128,
  136. LOG10_PPCF128,
  137. EXP_F32,
  138. EXP_F64,
  139. EXP_F80,
  140. EXP_F128,
  141. EXP_PPCF128,
  142. EXP2_F32,
  143. EXP2_F64,
  144. EXP2_F80,
  145. EXP2_F128,
  146. EXP2_PPCF128,
  147. SIN_F32,
  148. SIN_F64,
  149. SIN_F80,
  150. SIN_F128,
  151. SIN_PPCF128,
  152. COS_F32,
  153. COS_F64,
  154. COS_F80,
  155. COS_F128,
  156. COS_PPCF128,
  157. SINCOS_F32,
  158. SINCOS_F64,
  159. SINCOS_F80,
  160. SINCOS_F128,
  161. SINCOS_PPCF128,
  162. POW_F32,
  163. POW_F64,
  164. POW_F80,
  165. POW_F128,
  166. POW_PPCF128,
  167. CEIL_F32,
  168. CEIL_F64,
  169. CEIL_F80,
  170. CEIL_F128,
  171. CEIL_PPCF128,
  172. TRUNC_F32,
  173. TRUNC_F64,
  174. TRUNC_F80,
  175. TRUNC_F128,
  176. TRUNC_PPCF128,
  177. RINT_F32,
  178. RINT_F64,
  179. RINT_F80,
  180. RINT_F128,
  181. RINT_PPCF128,
  182. NEARBYINT_F32,
  183. NEARBYINT_F64,
  184. NEARBYINT_F80,
  185. NEARBYINT_F128,
  186. NEARBYINT_PPCF128,
  187. FLOOR_F32,
  188. FLOOR_F64,
  189. FLOOR_F80,
  190. FLOOR_F128,
  191. FLOOR_PPCF128,
  192. COPYSIGN_F32,
  193. COPYSIGN_F64,
  194. COPYSIGN_F80,
  195. COPYSIGN_F128,
  196. COPYSIGN_PPCF128,
  197. // CONVERSION
  198. FPEXT_F64_F128,
  199. FPEXT_F32_F128,
  200. FPEXT_F32_F64,
  201. FPEXT_F16_F32,
  202. FPROUND_F32_F16,
  203. FPROUND_F64_F32,
  204. FPROUND_F80_F32,
  205. FPROUND_F128_F32,
  206. FPROUND_PPCF128_F32,
  207. FPROUND_F80_F64,
  208. FPROUND_F128_F64,
  209. FPROUND_PPCF128_F64,
  210. FPTOSINT_F32_I8,
  211. FPTOSINT_F32_I16,
  212. FPTOSINT_F32_I32,
  213. FPTOSINT_F32_I64,
  214. FPTOSINT_F32_I128,
  215. FPTOSINT_F64_I8,
  216. FPTOSINT_F64_I16,
  217. FPTOSINT_F64_I32,
  218. FPTOSINT_F64_I64,
  219. FPTOSINT_F64_I128,
  220. FPTOSINT_F80_I32,
  221. FPTOSINT_F80_I64,
  222. FPTOSINT_F80_I128,
  223. FPTOSINT_F128_I32,
  224. FPTOSINT_F128_I64,
  225. FPTOSINT_F128_I128,
  226. FPTOSINT_PPCF128_I32,
  227. FPTOSINT_PPCF128_I64,
  228. FPTOSINT_PPCF128_I128,
  229. FPTOUINT_F32_I8,
  230. FPTOUINT_F32_I16,
  231. FPTOUINT_F32_I32,
  232. FPTOUINT_F32_I64,
  233. FPTOUINT_F32_I128,
  234. FPTOUINT_F64_I8,
  235. FPTOUINT_F64_I16,
  236. FPTOUINT_F64_I32,
  237. FPTOUINT_F64_I64,
  238. FPTOUINT_F64_I128,
  239. FPTOUINT_F80_I32,
  240. FPTOUINT_F80_I64,
  241. FPTOUINT_F80_I128,
  242. FPTOUINT_F128_I32,
  243. FPTOUINT_F128_I64,
  244. FPTOUINT_F128_I128,
  245. FPTOUINT_PPCF128_I32,
  246. FPTOUINT_PPCF128_I64,
  247. FPTOUINT_PPCF128_I128,
  248. SINTTOFP_I32_F32,
  249. SINTTOFP_I32_F64,
  250. SINTTOFP_I32_F80,
  251. SINTTOFP_I32_F128,
  252. SINTTOFP_I32_PPCF128,
  253. SINTTOFP_I64_F32,
  254. SINTTOFP_I64_F64,
  255. SINTTOFP_I64_F80,
  256. SINTTOFP_I64_F128,
  257. SINTTOFP_I64_PPCF128,
  258. SINTTOFP_I128_F32,
  259. SINTTOFP_I128_F64,
  260. SINTTOFP_I128_F80,
  261. SINTTOFP_I128_F128,
  262. SINTTOFP_I128_PPCF128,
  263. UINTTOFP_I32_F32,
  264. UINTTOFP_I32_F64,
  265. UINTTOFP_I32_F80,
  266. UINTTOFP_I32_F128,
  267. UINTTOFP_I32_PPCF128,
  268. UINTTOFP_I64_F32,
  269. UINTTOFP_I64_F64,
  270. UINTTOFP_I64_F80,
  271. UINTTOFP_I64_F128,
  272. UINTTOFP_I64_PPCF128,
  273. UINTTOFP_I128_F32,
  274. UINTTOFP_I128_F64,
  275. UINTTOFP_I128_F80,
  276. UINTTOFP_I128_F128,
  277. UINTTOFP_I128_PPCF128,
  278. // COMPARISON
  279. OEQ_F32,
  280. OEQ_F64,
  281. OEQ_F128,
  282. UNE_F32,
  283. UNE_F64,
  284. UNE_F128,
  285. OGE_F32,
  286. OGE_F64,
  287. OGE_F128,
  288. OLT_F32,
  289. OLT_F64,
  290. OLT_F128,
  291. OLE_F32,
  292. OLE_F64,
  293. OLE_F128,
  294. OGT_F32,
  295. OGT_F64,
  296. OGT_F128,
  297. UO_F32,
  298. UO_F64,
  299. UO_F128,
  300. O_F32,
  301. O_F64,
  302. O_F128,
  303. // MEMORY
  304. MEMCPY,
  305. MEMSET,
  306. MEMMOVE,
  307. // EXCEPTION HANDLING
  308. UNWIND_RESUME,
  309. // Family ATOMICs
  310. SYNC_VAL_COMPARE_AND_SWAP_1,
  311. SYNC_VAL_COMPARE_AND_SWAP_2,
  312. SYNC_VAL_COMPARE_AND_SWAP_4,
  313. SYNC_VAL_COMPARE_AND_SWAP_8,
  314. SYNC_LOCK_TEST_AND_SET_1,
  315. SYNC_LOCK_TEST_AND_SET_2,
  316. SYNC_LOCK_TEST_AND_SET_4,
  317. SYNC_LOCK_TEST_AND_SET_8,
  318. SYNC_FETCH_AND_ADD_1,
  319. SYNC_FETCH_AND_ADD_2,
  320. SYNC_FETCH_AND_ADD_4,
  321. SYNC_FETCH_AND_ADD_8,
  322. SYNC_FETCH_AND_SUB_1,
  323. SYNC_FETCH_AND_SUB_2,
  324. SYNC_FETCH_AND_SUB_4,
  325. SYNC_FETCH_AND_SUB_8,
  326. SYNC_FETCH_AND_AND_1,
  327. SYNC_FETCH_AND_AND_2,
  328. SYNC_FETCH_AND_AND_4,
  329. SYNC_FETCH_AND_AND_8,
  330. SYNC_FETCH_AND_OR_1,
  331. SYNC_FETCH_AND_OR_2,
  332. SYNC_FETCH_AND_OR_4,
  333. SYNC_FETCH_AND_OR_8,
  334. SYNC_FETCH_AND_XOR_1,
  335. SYNC_FETCH_AND_XOR_2,
  336. SYNC_FETCH_AND_XOR_4,
  337. SYNC_FETCH_AND_XOR_8,
  338. SYNC_FETCH_AND_NAND_1,
  339. SYNC_FETCH_AND_NAND_2,
  340. SYNC_FETCH_AND_NAND_4,
  341. SYNC_FETCH_AND_NAND_8,
  342. UNKNOWN_LIBCALL
  343. };
  344. /// getFPEXT - Return the FPEXT_*_* value for the given types, or
  345. /// UNKNOWN_LIBCALL if there is none.
  346. Libcall getFPEXT(EVT OpVT, EVT RetVT);
  347. /// getFPROUND - Return the FPROUND_*_* value for the given types, or
  348. /// UNKNOWN_LIBCALL if there is none.
  349. Libcall getFPROUND(EVT OpVT, EVT RetVT);
  350. /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
  351. /// UNKNOWN_LIBCALL if there is none.
  352. Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
  353. /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
  354. /// UNKNOWN_LIBCALL if there is none.
  355. Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
  356. /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
  357. /// UNKNOWN_LIBCALL if there is none.
  358. Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
  359. /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
  360. /// UNKNOWN_LIBCALL if there is none.
  361. Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
  362. }
  363. }
  364. #endif