S_002f390-System-z-Built_002din-Functions.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>Using the GNU Compiler Collection (GCC): S/390 System z Built-in Functions</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): S/390 System z Built-in Functions">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): S/390 System z Built-in Functions">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="S_002f390-System-z-Built_002din-Functions"></a>
  63. <div class="header">
  64. <p>
  65. 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>
  66. </div>
  67. <hr>
  68. <a name="S_002f390-System-z-Built_002din-Functions-1"></a>
  69. <h4 class="subsection">6.60.25 S/390 System z Built-in Functions</h4>
  70. <dl>
  71. <dt><a name="index-_005f_005fbuiltin_005ftbegin"></a>Built-in Function: <em>int</em> <strong>__builtin_tbegin</strong> <em>(void*)</em></dt>
  72. <dd><p>Generates the <code>tbegin</code> machine instruction starting a
  73. non-constrained hardware transaction. If the parameter is non-NULL the
  74. memory area is used to store the transaction diagnostic buffer and
  75. will be passed as first operand to <code>tbegin</code>. This buffer can be
  76. defined using the <code>struct __htm_tdb</code> C struct defined in
  77. <code>htmintrin.h</code> and must reside on a double-word boundary. The
  78. second tbegin operand is set to <code>0xff0c</code>. This enables
  79. save/restore of all GPRs and disables aborts for FPR and AR
  80. manipulations inside the transaction body. The condition code set by
  81. the tbegin instruction is returned as integer value. The tbegin
  82. instruction by definition overwrites the content of all FPRs. The
  83. compiler will generate code which saves and restores the FPRs. For
  84. soft-float code it is recommended to used the <code>*_nofloat</code>
  85. variant. In order to prevent a TDB from being written it is required
  86. to pass a constant zero value as parameter. Passing a zero value
  87. through a variable is not sufficient. Although modifications of
  88. access registers inside the transaction will not trigger an
  89. transaction abort it is not supported to actually modify them. Access
  90. registers do not get saved when entering a transaction. They will have
  91. undefined state when reaching the abort code.
  92. </p></dd></dl>
  93. <p>Macros for the possible return codes of tbegin are defined in the
  94. <code>htmintrin.h</code> header file:
  95. </p>
  96. <dl compact="compact">
  97. <dt><code>_HTM_TBEGIN_STARTED</code></dt>
  98. <dd><p><code>tbegin</code> has been executed as part of normal processing. The
  99. transaction body is supposed to be executed.
  100. </p></dd>
  101. <dt><code>_HTM_TBEGIN_INDETERMINATE</code></dt>
  102. <dd><p>The transaction was aborted due to an indeterminate condition which
  103. might be persistent.
  104. </p></dd>
  105. <dt><code>_HTM_TBEGIN_TRANSIENT</code></dt>
  106. <dd><p>The transaction aborted due to a transient failure. The transaction
  107. should be re-executed in that case.
  108. </p></dd>
  109. <dt><code>_HTM_TBEGIN_PERSISTENT</code></dt>
  110. <dd><p>The transaction aborted due to a persistent failure. Re-execution
  111. under same circumstances will not be productive.
  112. </p></dd>
  113. </dl>
  114. <dl>
  115. <dt><a name="index-_005fHTM_005fFIRST_005fUSER_005fABORT_005fCODE"></a>Macro: <strong>_HTM_FIRST_USER_ABORT_CODE</strong></dt>
  116. <dd><p>The <code>_HTM_FIRST_USER_ABORT_CODE</code> defined in <code>htmintrin.h</code>
  117. specifies the first abort code which can be used for
  118. <code>__builtin_tabort</code>. Values below this threshold are reserved for
  119. machine use.
  120. </p></dd></dl>
  121. <dl>
  122. <dt><a name="index-struct-_005f_005fhtm_005ftdb"></a>Data type: <strong>struct __htm_tdb</strong></dt>
  123. <dd><p>The <code>struct __htm_tdb</code> defined in <code>htmintrin.h</code> describes
  124. the structure of the transaction diagnostic block as specified in the
  125. Principles of Operation manual chapter 5-91.
  126. </p></dd></dl>
  127. <dl>
  128. <dt><a name="index-_005f_005fbuiltin_005ftbegin_005fnofloat"></a>Built-in Function: <em>int</em> <strong>__builtin_tbegin_nofloat</strong> <em>(void*)</em></dt>
  129. <dd><p>Same as <code>__builtin_tbegin</code> but without FPR saves and restores.
  130. Using this variant in code making use of FPRs will leave the FPRs in
  131. undefined state when entering the transaction abort handler code.
  132. </p></dd></dl>
  133. <dl>
  134. <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>
  135. <dd><p>In addition to <code>__builtin_tbegin</code> a loop for transient failures
  136. is generated. If tbegin returns a condition code of 2 the transaction
  137. will be retried as often as specified in the second argument. The
  138. perform processor assist instruction is used to tell the CPU about the
  139. number of fails so far.
  140. </p></dd></dl>
  141. <dl>
  142. <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>
  143. <dd><p>Same as <code>__builtin_tbegin_retry</code> but without FPR saves and
  144. restores. Using this variant in code making use of FPRs will leave
  145. the FPRs in undefined state when entering the transaction abort
  146. handler code.
  147. </p></dd></dl>
  148. <dl>
  149. <dt><a name="index-_005f_005fbuiltin_005ftbeginc"></a>Built-in Function: <em>void</em> <strong>__builtin_tbeginc</strong> <em>(void)</em></dt>
  150. <dd><p>Generates the <code>tbeginc</code> machine instruction starting a constrained
  151. hardware transaction. The second operand is set to <code>0xff08</code>.
  152. </p></dd></dl>
  153. <dl>
  154. <dt><a name="index-_005f_005fbuiltin_005ftend"></a>Built-in Function: <em>int</em> <strong>__builtin_tend</strong> <em>(void)</em></dt>
  155. <dd><p>Generates the <code>tend</code> machine instruction finishing a transaction
  156. and making the changes visible to other threads. The condition code
  157. generated by tend is returned as integer value.
  158. </p></dd></dl>
  159. <dl>
  160. <dt><a name="index-_005f_005fbuiltin_005ftabort"></a>Built-in Function: <em>void</em> <strong>__builtin_tabort</strong> <em>(int)</em></dt>
  161. <dd><p>Generates the <code>tabort</code> machine instruction with the specified
  162. abort code. Abort codes from 0 through 255 are reserved and will
  163. result in an error message.
  164. </p></dd></dl>
  165. <dl>
  166. <dt><a name="index-_005f_005fbuiltin_005ftx_005fassist"></a>Built-in Function: <em>void</em> <strong>__builtin_tx_assist</strong> <em>(int)</em></dt>
  167. <dd><p>Generates the <code>ppa rX,rY,1</code> machine instruction. Where the
  168. integer parameter is loaded into rX and a value of zero is loaded into
  169. rY. The integer parameter specifies the number of times the
  170. transaction repeatedly aborted.
  171. </p></dd></dl>
  172. <dl>
  173. <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>
  174. <dd><p>Generates the <code>etnd</code> machine instruction. The current nesting
  175. depth is returned as integer value. For a nesting depth of 0 the code
  176. is not executed as part of an transaction.
  177. </p></dd></dl>
  178. <dl>
  179. <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>
  180. <dd>
  181. <p>Generates the <code>ntstg</code> machine instruction. The second argument
  182. is written to the first arguments location. The store operation will
  183. not be rolled-back in case of an transaction abort.
  184. </p></dd></dl>
  185. <hr>
  186. <div class="header">
  187. <p>
  188. 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>
  189. </div>
  190. </body>
  191. </html>