gtm-builtins.def 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. DEF_TM_BUILTIN (BUILT_IN_TM_START, "_ITM_beginTransaction",
  2. BT_FN_UINT32_UINT32_VAR, ATTR_TM_NOTHROW_RT_LIST)
  3. DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT, "_ITM_commitTransaction",
  4. BT_FN_VOID, ATTR_TM_NOTHROW_LIST)
  5. DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT_EH, "_ITM_commitTransactionEH",
  6. BT_FN_VOID_PTR, ATTR_TM_NOTHROW_LIST)
  7. DEF_TM_BUILTIN (BUILT_IN_TM_ABORT, "_ITM_abortTransaction",
  8. BT_FN_VOID_INT, ATTR_TM_NORETURN_NOTHROW_LIST)
  9. DEF_TM_BUILTIN (BUILT_IN_TM_IRREVOCABLE, "_ITM_changeTransactionMode",
  10. BT_FN_VOID_INT, ATTR_TM_NOTHROW_LIST)
  11. DEF_TM_BUILTIN (BUILT_IN_TM_MEMCPY, "_ITM_memcpyRtWt",
  12. BT_FN_VOID_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
  13. DEF_TM_BUILTIN (BUILT_IN_TM_MEMCPY_RNWT, "_ITM_memcpyRnWt",
  14. BT_FN_VOID_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
  15. DEF_TM_BUILTIN (BUILT_IN_TM_MEMCPY_RTWN, "_ITM_memcpyRtWn",
  16. BT_FN_VOID_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
  17. DEF_TM_BUILTIN (BUILT_IN_TM_MEMMOVE, "_ITM_memmoveRtWt",
  18. BT_FN_VOID_PTR_CONST_PTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
  19. DEF_TM_BUILTIN (BUILT_IN_TM_MEMSET, "_ITM_memsetW",
  20. BT_FN_VOID_PTR_INT_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
  21. DEF_TM_BUILTIN (BUILT_IN_TM_GETTMCLONE_IRR, "_ITM_getTMCloneOrIrrevocable",
  22. BT_FN_PTR_PTR, ATTR_TM_CONST_NOTHROW_LIST)
  23. DEF_TM_BUILTIN (BUILT_IN_TM_GETTMCLONE_SAFE, "_ITM_getTMCloneSafe",
  24. BT_FN_PTR_PTR, ATTR_TM_CONST_NOTHROW_LIST)
  25. /* Memory allocation builtins. */
  26. DEF_TM_BUILTIN (BUILT_IN_TM_MALLOC, "_ITM_malloc",
  27. BT_FN_PTR_SIZE, ATTR_TMPURE_MALLOC_NOTHROW_LIST)
  28. DEF_TM_BUILTIN (BUILT_IN_TM_CALLOC, "_ITM_calloc",
  29. BT_FN_PTR_SIZE_SIZE, ATTR_TMPURE_MALLOC_NOTHROW_LIST)
  30. DEF_TM_BUILTIN (BUILT_IN_TM_FREE, "_ITM_free",
  31. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  32. /* Logging builtins. */
  33. DEF_TM_BUILTIN (BUILT_IN_TM_LOG_1, "_ITM_LU1",
  34. BT_FN_VOID_VPTR, ATTR_TM_TMPURE_NOTHROW_LIST)
  35. DEF_TM_BUILTIN (BUILT_IN_TM_LOG_2, "_ITM_LU2",
  36. BT_FN_VOID_VPTR, ATTR_TM_TMPURE_NOTHROW_LIST)
  37. DEF_TM_BUILTIN (BUILT_IN_TM_LOG_4, "_ITM_LU4",
  38. BT_FN_VOID_VPTR, ATTR_TM_TMPURE_NOTHROW_LIST)
  39. DEF_TM_BUILTIN (BUILT_IN_TM_LOG_8, "_ITM_LU8",
  40. BT_FN_VOID_VPTR, ATTR_TM_TMPURE_NOTHROW_LIST)
  41. DEF_TM_BUILTIN (BUILT_IN_TM_LOG_FLOAT, "_ITM_LF",
  42. BT_FN_VOID_VPTR, ATTR_TM_TMPURE_NOTHROW_LIST)
  43. DEF_TM_BUILTIN (BUILT_IN_TM_LOG_DOUBLE, "_ITM_LD",
  44. BT_FN_VOID_VPTR, ATTR_TM_TMPURE_NOTHROW_LIST)
  45. DEF_TM_BUILTIN (BUILT_IN_TM_LOG_LDOUBLE, "_ITM_LE",
  46. BT_FN_VOID_VPTR, ATTR_TM_TMPURE_NOTHROW_LIST)
  47. DEF_TM_BUILTIN (BUILT_IN_TM_LOG, "_ITM_LB",
  48. BT_FN_VOID_VPTR_SIZE, ATTR_TM_TMPURE_NOTHROW_LIST)
  49. /* These stubs should get defined in the backend if applicable. */
  50. DEF_BUILTIN_STUB (BUILT_IN_TM_LOG_M64, "__builtin__ITM_LM64")
  51. DEF_BUILTIN_STUB (BUILT_IN_TM_LOG_M128, "__builtin__ITM_LM128")
  52. DEF_BUILTIN_STUB (BUILT_IN_TM_LOG_M256, "__builtin__ITM_LM256")
  53. /* Writes.
  54. Note: The writes must follow the following order: STORE, WAR, WAW.
  55. The TM optimizations depend on this order.
  56. BUILT_IN_TM_STORE_1 must be the first builtin.
  57. BUILTIN_TM_LOAD_STORE_P depends on this. */
  58. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_1, "_ITM_WU1",
  59. BT_FN_VOID_VPTR_I1, ATTR_TM_NOTHROW_LIST)
  60. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAR_1, "_ITM_WaRU1",
  61. BT_FN_VOID_VPTR_I1, ATTR_TM_NOTHROW_LIST)
  62. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAW_1, "_ITM_WaWU1",
  63. BT_FN_VOID_VPTR_I1, ATTR_TM_NOTHROW_LIST)
  64. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_2, "_ITM_WU2",
  65. BT_FN_VOID_VPTR_I2, ATTR_TM_NOTHROW_LIST)
  66. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAR_2, "_ITM_WaRU2",
  67. BT_FN_VOID_VPTR_I2, ATTR_TM_NOTHROW_LIST)
  68. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAW_2, "_ITM_WaWU2",
  69. BT_FN_VOID_VPTR_I2, ATTR_TM_NOTHROW_LIST)
  70. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_4, "_ITM_WU4",
  71. BT_FN_VOID_VPTR_I4, ATTR_TM_NOTHROW_LIST)
  72. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAR_4, "_ITM_WaRU4",
  73. BT_FN_VOID_VPTR_I4, ATTR_TM_NOTHROW_LIST)
  74. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAW_4, "_ITM_WaWU4",
  75. BT_FN_VOID_VPTR_I4, ATTR_TM_NOTHROW_LIST)
  76. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_8, "_ITM_WU8",
  77. BT_FN_VOID_VPTR_I8, ATTR_TM_NOTHROW_LIST)
  78. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAR_8, "_ITM_WaRU8",
  79. BT_FN_VOID_VPTR_I8, ATTR_TM_NOTHROW_LIST)
  80. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAW_8, "_ITM_WaWU8",
  81. BT_FN_VOID_VPTR_I8, ATTR_TM_NOTHROW_LIST)
  82. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_FLOAT, "_ITM_WF",
  83. BT_FN_VOID_VPTR_FLOAT, ATTR_TM_NOTHROW_LIST)
  84. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAR_FLOAT, "_ITM_WaRF",
  85. BT_FN_VOID_VPTR_FLOAT, ATTR_TM_NOTHROW_LIST)
  86. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAW_FLOAT, "_ITM_WaWF",
  87. BT_FN_VOID_VPTR_FLOAT, ATTR_TM_NOTHROW_LIST)
  88. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_DOUBLE, "_ITM_WD",
  89. BT_FN_VOID_VPTR_DOUBLE, ATTR_TM_NOTHROW_LIST)
  90. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAR_DOUBLE, "_ITM_WaRD",
  91. BT_FN_VOID_VPTR_DOUBLE, ATTR_TM_NOTHROW_LIST)
  92. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAW_DOUBLE, "_ITM_WaWD",
  93. BT_FN_VOID_VPTR_DOUBLE, ATTR_TM_NOTHROW_LIST)
  94. /* These stubs should get defined in the backend if applicable. */
  95. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_M64, "__builtin__ITM_WM64")
  96. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_WAR_M64, "__builtin__ITM_WaRM64")
  97. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_WAW_M64, "__builtin__ITM_WaWM64")
  98. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_M128, "__builtin__ITM_WM128")
  99. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_WAR_M128, "__builtin__ITM_WaRM128")
  100. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_WAW_M128, "__builtin__ITM_WaWM128")
  101. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_M256, "__builtin__ITM_WM256")
  102. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_WAR_M256, "__builtin__ITM_WaRM256")
  103. DEF_BUILTIN_STUB (BUILT_IN_TM_STORE_WAW_M256, "__builtin__ITM_WaWM256")
  104. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_LDOUBLE, "_ITM_WE",
  105. BT_FN_VOID_VPTR_LDOUBLE, ATTR_TM_NOTHROW_LIST)
  106. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAR_LDOUBLE, "_ITM_WaRE",
  107. BT_FN_VOID_VPTR_LDOUBLE, ATTR_TM_NOTHROW_LIST)
  108. DEF_TM_BUILTIN (BUILT_IN_TM_STORE_WAW_LDOUBLE, "_ITM_WaWE",
  109. BT_FN_VOID_VPTR_LDOUBLE, ATTR_TM_NOTHROW_LIST)
  110. /* Note: BUILT_IN_TM_STORE_WAW_LDOUBLE must be the last TM store.
  111. BUILTIN_TM_STORE_P depends on this. */
  112. /* Reads.
  113. Note: The reads must follow the following order: LOAD, RAR, RAW, RFW.
  114. The TM optimizations depend on this order. */
  115. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_1, "_ITM_RU1",
  116. BT_FN_I1_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  117. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_1, "_ITM_RaRU1",
  118. BT_FN_I1_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  119. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_1, "_ITM_RaWU1",
  120. BT_FN_I1_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  121. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_1, "_ITM_RfWU1",
  122. BT_FN_I1_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  123. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_2, "_ITM_RU2",
  124. BT_FN_I2_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  125. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_2, "_ITM_RaRU2",
  126. BT_FN_I2_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  127. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_2, "_ITM_RaWU2",
  128. BT_FN_I2_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  129. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_2, "_ITM_RfWU2",
  130. BT_FN_I2_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  131. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_4, "_ITM_RU4",
  132. BT_FN_I4_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  133. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_4, "_ITM_RaRU4",
  134. BT_FN_I4_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  135. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_4, "_ITM_RaWU4",
  136. BT_FN_I4_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  137. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_4, "_ITM_RfWU4",
  138. BT_FN_I4_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  139. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_8, "_ITM_RU8",
  140. BT_FN_I8_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  141. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_8, "_ITM_RaRU8",
  142. BT_FN_I8_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  143. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_8, "_ITM_RaWU8",
  144. BT_FN_I8_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  145. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_8, "_ITM_RfWU8",
  146. BT_FN_I8_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  147. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_FLOAT, "_ITM_RF",
  148. BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  149. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_FLOAT, "_ITM_RaRF",
  150. BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  151. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_FLOAT, "_ITM_RaWF",
  152. BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  153. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_FLOAT, "_ITM_RfWF",
  154. BT_FN_FLOAT_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  155. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_DOUBLE, "_ITM_RD",
  156. BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  157. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_DOUBLE, "_ITM_RaRD",
  158. BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  159. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_DOUBLE, "_ITM_RaWD",
  160. BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  161. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_DOUBLE, "_ITM_RfWD",
  162. BT_FN_DOUBLE_CONST_DOUBLE_PTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  163. /* These stubs should get defined in the backend if applicable. */
  164. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_M64, "__builtin__ITM_RM64")
  165. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RAR_M64, "__builtin__ITM_RaRM64")
  166. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RAW_M64, "__builtin__ITM_RaRM64")
  167. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RFW_M64, "__builtin__ITM_RfWM64")
  168. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_M128, "__builtin__ITM_RM128")
  169. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RAR_M128, "__builtin__ITM_RaRM128")
  170. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RAW_M128, "__builtin__ITM_RaRM128")
  171. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RFW_M128, "__builtin__ITM_RfWM128")
  172. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_M256, "__builtin__ITM_RM256")
  173. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RAR_M256, "__builtin__ITM_RaRM256")
  174. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RAW_M256, "__builtin__ITM_RaRM256")
  175. DEF_BUILTIN_STUB (BUILT_IN_TM_LOAD_RFW_M256, "__builtin__ITM_RfWM256")
  176. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_LDOUBLE, "_ITM_RE",
  177. BT_FN_LDOUBLE_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  178. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAR_LDOUBLE, "_ITM_RaRE",
  179. BT_FN_LDOUBLE_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  180. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RAW_LDOUBLE, "_ITM_RaWE",
  181. BT_FN_LDOUBLE_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  182. DEF_TM_BUILTIN (BUILT_IN_TM_LOAD_RFW_LDOUBLE, "_ITM_RfWE",
  183. BT_FN_LDOUBLE_VPTR, ATTR_TM_PURE_TMPURE_NOTHROW_LIST)
  184. /* Note: BUILT_IN_TM_LOAD_RFW_LDOUBLE must be the last TM load as well
  185. as the last builtin. BUILTIN_TM_LOAD_STORE_P and BUILTIN_TM_LOAD_P
  186. depend on this. */