gtm-builtins.def 9.7 KB

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