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.

216 lines
11KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>S/390 System z Built-in Functions (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="S/390 System z Built-in Functions (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="S/390 System z Built-in Functions (Using the GNU Compiler Collection (GCC))">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Target-Builtins.html#Target-Builtins" rel="up" title="Target Builtins">
  30. <link href="SH-Built_002din-Functions.html#SH-Built_002din-Functions" rel="next" title="SH Built-in Functions">
  31. <link href="RX-Built_002din-Functions.html#RX-Built_002din-Functions" rel="prev" title="RX Built-in Functions">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="S_002f390-System-z-Built_002din-Functions"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="SH-Built_002din-Functions.html#SH-Built_002din-Functions" accesskey="n" rel="next">SH Built-in Functions</a>, Previous: <a href="RX-Built_002din-Functions.html#RX-Built_002din-Functions" accesskey="p" rel="prev">RX Built-in Functions</a>, Up: <a href="Target-Builtins.html#Target-Builtins" accesskey="u" rel="up">Target Builtins</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="S_002f390-System-z-Built_002din-Functions-1"></a>
  68. <h4 class="subsection">6.60.28 S/390 System z Built-in Functions</h4>
  69. <dl>
  70. <dt><a name="index-_005f_005fbuiltin_005ftbegin"></a>Built-in Function: <em>int</em> <strong>__builtin_tbegin</strong> <em>(void*)</em></dt>
  71. <dd><p>Generates the <code>tbegin</code> machine instruction starting a
  72. non-constrained hardware transaction. If the parameter is non-NULL the
  73. memory area is used to store the transaction diagnostic buffer and
  74. will be passed as first operand to <code>tbegin</code>. This buffer can be
  75. defined using the <code>struct __htm_tdb</code> C struct defined in
  76. <code>htmintrin.h</code> and must reside on a double-word boundary. The
  77. second tbegin operand is set to <code>0xff0c</code>. This enables
  78. save/restore of all GPRs and disables aborts for FPR and AR
  79. manipulations inside the transaction body. The condition code set by
  80. the tbegin instruction is returned as integer value. The tbegin
  81. instruction by definition overwrites the content of all FPRs. The
  82. compiler will generate code which saves and restores the FPRs. For
  83. soft-float code it is recommended to used the <code>*_nofloat</code>
  84. variant. In order to prevent a TDB from being written it is required
  85. to pass a constant zero value as parameter. Passing a zero value
  86. through a variable is not sufficient. Although modifications of
  87. access registers inside the transaction will not trigger an
  88. transaction abort it is not supported to actually modify them. Access
  89. registers do not get saved when entering a transaction. They will have
  90. undefined state when reaching the abort code.
  91. </p></dd></dl>
  92. <p>Macros for the possible return codes of tbegin are defined in the
  93. <code>htmintrin.h</code> header file:
  94. </p>
  95. <dl compact="compact">
  96. <dt><code>_HTM_TBEGIN_STARTED</code></dt>
  97. <dd><p><code>tbegin</code> has been executed as part of normal processing. The
  98. transaction body is supposed to be executed.
  99. </p></dd>
  100. <dt><code>_HTM_TBEGIN_INDETERMINATE</code></dt>
  101. <dd><p>The transaction was aborted due to an indeterminate condition which
  102. might be persistent.
  103. </p></dd>
  104. <dt><code>_HTM_TBEGIN_TRANSIENT</code></dt>
  105. <dd><p>The transaction aborted due to a transient failure. The transaction
  106. should be re-executed in that case.
  107. </p></dd>
  108. <dt><code>_HTM_TBEGIN_PERSISTENT</code></dt>
  109. <dd><p>The transaction aborted due to a persistent failure. Re-execution
  110. under same circumstances will not be productive.
  111. </p></dd>
  112. </dl>
  113. <dl>
  114. <dt><a name="index-_005fHTM_005fFIRST_005fUSER_005fABORT_005fCODE"></a>Macro: <strong>_HTM_FIRST_USER_ABORT_CODE</strong></dt>
  115. <dd><p>The <code>_HTM_FIRST_USER_ABORT_CODE</code> defined in <code>htmintrin.h</code>
  116. specifies the first abort code which can be used for
  117. <code>__builtin_tabort</code>. Values below this threshold are reserved for
  118. machine use.
  119. </p></dd></dl>
  120. <dl>
  121. <dt><a name="index-struct-_005f_005fhtm_005ftdb"></a>Data type: <strong>struct __htm_tdb</strong></dt>
  122. <dd><p>The <code>struct __htm_tdb</code> defined in <code>htmintrin.h</code> describes
  123. the structure of the transaction diagnostic block as specified in the
  124. Principles of Operation manual chapter 5-91.
  125. </p></dd></dl>
  126. <dl>
  127. <dt><a name="index-_005f_005fbuiltin_005ftbegin_005fnofloat"></a>Built-in Function: <em>int</em> <strong>__builtin_tbegin_nofloat</strong> <em>(void*)</em></dt>
  128. <dd><p>Same as <code>__builtin_tbegin</code> but without FPR saves and restores.
  129. Using this variant in code making use of FPRs will leave the FPRs in
  130. undefined state when entering the transaction abort handler code.
  131. </p></dd></dl>
  132. <dl>
  133. <dt><a name="index-_005f_005fbuiltin_005ftbegin_005fretry"></a>Built-in Function: <em>int</em> <strong>__builtin_tbegin_retry</strong> <em>(void*, int)</em></dt>
  134. <dd><p>In addition to <code>__builtin_tbegin</code> a loop for transient failures
  135. is generated. If tbegin returns a condition code of 2 the transaction
  136. will be retried as often as specified in the second argument. The
  137. perform processor assist instruction is used to tell the CPU about the
  138. number of fails so far.
  139. </p></dd></dl>
  140. <dl>
  141. <dt><a name="index-_005f_005fbuiltin_005ftbegin_005fretry_005fnofloat"></a>Built-in Function: <em>int</em> <strong>__builtin_tbegin_retry_nofloat</strong> <em>(void*, int)</em></dt>
  142. <dd><p>Same as <code>__builtin_tbegin_retry</code> but without FPR saves and
  143. restores. Using this variant in code making use of FPRs will leave
  144. the FPRs in undefined state when entering the transaction abort
  145. handler code.
  146. </p></dd></dl>
  147. <dl>
  148. <dt><a name="index-_005f_005fbuiltin_005ftbeginc"></a>Built-in Function: <em>void</em> <strong>__builtin_tbeginc</strong> <em>(void)</em></dt>
  149. <dd><p>Generates the <code>tbeginc</code> machine instruction starting a constrained
  150. hardware transaction. The second operand is set to <code>0xff08</code>.
  151. </p></dd></dl>
  152. <dl>
  153. <dt><a name="index-_005f_005fbuiltin_005ftend"></a>Built-in Function: <em>int</em> <strong>__builtin_tend</strong> <em>(void)</em></dt>
  154. <dd><p>Generates the <code>tend</code> machine instruction finishing a transaction
  155. and making the changes visible to other threads. The condition code
  156. generated by tend is returned as integer value.
  157. </p></dd></dl>
  158. <dl>
  159. <dt><a name="index-_005f_005fbuiltin_005ftabort"></a>Built-in Function: <em>void</em> <strong>__builtin_tabort</strong> <em>(int)</em></dt>
  160. <dd><p>Generates the <code>tabort</code> machine instruction with the specified
  161. abort code. Abort codes from 0 through 255 are reserved and will
  162. result in an error message.
  163. </p></dd></dl>
  164. <dl>
  165. <dt><a name="index-_005f_005fbuiltin_005ftx_005fassist"></a>Built-in Function: <em>void</em> <strong>__builtin_tx_assist</strong> <em>(int)</em></dt>
  166. <dd><p>Generates the <code>ppa rX,rY,1</code> machine instruction. Where the
  167. integer parameter is loaded into rX and a value of zero is loaded into
  168. rY. The integer parameter specifies the number of times the
  169. transaction repeatedly aborted.
  170. </p></dd></dl>
  171. <dl>
  172. <dt><a name="index-_005f_005fbuiltin_005ftx_005fnesting_005fdepth"></a>Built-in Function: <em>int</em> <strong>__builtin_tx_nesting_depth</strong> <em>(void)</em></dt>
  173. <dd><p>Generates the <code>etnd</code> machine instruction. The current nesting
  174. depth is returned as integer value. For a nesting depth of 0 the code
  175. is not executed as part of an transaction.
  176. </p></dd></dl>
  177. <dl>
  178. <dt><a name="index-_005f_005fbuiltin_005fnon_005ftx_005fstore"></a>Built-in Function: <em>void</em> <strong>__builtin_non_tx_store</strong> <em>(uint64_t *, uint64_t)</em></dt>
  179. <dd>
  180. <p>Generates the <code>ntstg</code> machine instruction. The second argument
  181. is written to the first arguments location. The store operation will
  182. not be rolled-back in case of an transaction abort.
  183. </p></dd></dl>
  184. <hr>
  185. <div class="header">
  186. <p>
  187. Next: <a href="SH-Built_002din-Functions.html#SH-Built_002din-Functions" accesskey="n" rel="next">SH Built-in Functions</a>, Previous: <a href="RX-Built_002din-Functions.html#RX-Built_002din-Functions" accesskey="p" rel="prev">RX Built-in Functions</a>, Up: <a href="Target-Builtins.html#Target-Builtins" accesskey="u" rel="up">Target Builtins</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  188. </div>
  189. </body>
  190. </html>