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.

Sparc_002dConstants.html 9.0KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU Assembler "as".
  4. Copyright (C) 1991-2020 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3
  7. or any later version published by the Free Software Foundation;
  8. with no Invariant Sections, with no Front-Cover Texts, and with no
  9. Back-Cover Texts. A copy of the license is included in the
  10. section entitled "GNU Free Documentation License".
  11. -->
  12. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>Sparc-Constants (Using as)</title>
  16. <meta name="description" content="Sparc-Constants (Using as)">
  17. <meta name="keywords" content="Sparc-Constants (Using as)">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
  23. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  24. <link href="Sparc_002dSyntax.html#Sparc_002dSyntax" rel="up" title="Sparc-Syntax">
  25. <link href="Sparc_002dRelocs.html#Sparc_002dRelocs" rel="next" title="Sparc-Relocs">
  26. <link href="Sparc_002dRegs.html#Sparc_002dRegs" rel="prev" title="Sparc-Regs">
  27. <style type="text/css">
  28. <!--
  29. a.summary-letter {text-decoration: none}
  30. blockquote.indentedblock {margin-right: 0em}
  31. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  32. blockquote.smallquotation {font-size: smaller}
  33. div.display {margin-left: 3.2em}
  34. div.example {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smalllisp {margin-left: 3.2em}
  39. kbd {font-style: oblique}
  40. pre.display {font-family: inherit}
  41. pre.format {font-family: inherit}
  42. pre.menu-comment {font-family: serif}
  43. pre.menu-preformatted {font-family: serif}
  44. pre.smalldisplay {font-family: inherit; font-size: smaller}
  45. pre.smallexample {font-size: smaller}
  46. pre.smallformat {font-family: inherit; font-size: smaller}
  47. pre.smalllisp {font-size: smaller}
  48. span.nolinebreak {white-space: nowrap}
  49. span.roman {font-family: initial; font-weight: normal}
  50. span.sansserif {font-family: sans-serif; font-weight: normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en">
  56. <a name="Sparc_002dConstants"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="Sparc_002dRelocs.html#Sparc_002dRelocs" accesskey="n" rel="next">Sparc-Relocs</a>, Previous: <a href="Sparc_002dRegs.html#Sparc_002dRegs" accesskey="p" rel="prev">Sparc-Regs</a>, Up: <a href="Sparc_002dSyntax.html#Sparc_002dSyntax" accesskey="u" rel="up">Sparc-Syntax</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="Constants-2"></a>
  63. <h4 class="subsubsection">9.44.3.3 Constants</h4>
  64. <a name="index-Sparc-constants"></a>
  65. <a name="index-constants_002c-Sparc"></a>
  66. <p>Several Sparc instructions take an immediate operand field for
  67. which mnemonic names exist. Two such examples are &lsquo;<samp>membar</samp>&rsquo;
  68. and &lsquo;<samp>prefetch</samp>&rsquo;. Another example are the set of V9
  69. memory access instruction that allow specification of an
  70. address space identifier.
  71. </p>
  72. <p>The &lsquo;<samp>membar</samp>&rsquo; instruction specifies a memory barrier that is
  73. the defined by the operand which is a bitmask. The supported
  74. mask mnemonics are:
  75. </p>
  76. <ul>
  77. <li> &lsquo;<samp>#Sync</samp>&rsquo; requests that all operations (including nonmemory
  78. reference operations) appearing prior to the <code>membar</code> must have
  79. been performed and the effects of any exceptions become visible before
  80. any instructions after the <code>membar</code> may be initiated. This
  81. corresponds to <code>membar</code> cmask field bit 2.
  82. </li><li> &lsquo;<samp>#MemIssue</samp>&rsquo; requests that all memory reference operations
  83. appearing prior to the <code>membar</code> must have been performed before
  84. any memory operation after the <code>membar</code> may be initiated. This
  85. corresponds to <code>membar</code> cmask field bit 1.
  86. </li><li> &lsquo;<samp>#Lookaside</samp>&rsquo; requests that a store appearing prior to the
  87. <code>membar</code> must complete before any load following the
  88. <code>membar</code> referencing the same address can be initiated. This
  89. corresponds to <code>membar</code> cmask field bit 0.
  90. </li><li> &lsquo;<samp>#StoreStore</samp>&rsquo; defines that the effects of all stores appearing
  91. prior to the <code>membar</code> instruction must be visible to all
  92. processors before the effect of any stores following the
  93. <code>membar</code>. Equivalent to the deprecated <code>stbar</code> instruction.
  94. This corresponds to <code>membar</code> mmask field bit 3.
  95. </li><li> &lsquo;<samp>#LoadStore</samp>&rsquo; defines all loads appearing prior to the
  96. <code>membar</code> instruction must have been performed before the effect
  97. of any stores following the <code>membar</code> is visible to any other
  98. processor. This corresponds to <code>membar</code> mmask field bit 2.
  99. </li><li> &lsquo;<samp>#StoreLoad</samp>&rsquo; defines that the effects of all stores appearing
  100. prior to the <code>membar</code> instruction must be visible to all
  101. processors before loads following the <code>membar</code> may be performed.
  102. This corresponds to <code>membar</code> mmask field bit 1.
  103. </li><li> &lsquo;<samp>#LoadLoad</samp>&rsquo; defines that all loads appearing prior to the
  104. <code>membar</code> instruction must have been performed before any loads
  105. following the <code>membar</code> may be performed. This corresponds to
  106. <code>membar</code> mmask field bit 0.
  107. </li></ul>
  108. <p>These values can be ored together, for example:
  109. </p>
  110. <div class="example">
  111. <pre class="example">membar #Sync
  112. membar #StoreLoad | #LoadLoad
  113. membar #StoreLoad | #StoreStore
  114. </pre></div>
  115. <p>The <code>prefetch</code> and <code>prefetcha</code> instructions take a prefetch
  116. function code. The following prefetch function code constant
  117. mnemonics are available:
  118. </p>
  119. <ul>
  120. <li> &lsquo;<samp>#n_reads</samp>&rsquo; requests a prefetch for several reads, and corresponds
  121. to a prefetch function code of 0.
  122. <p>&lsquo;<samp>#one_read</samp>&rsquo; requests a prefetch for one read, and corresponds
  123. to a prefetch function code of 1.
  124. </p>
  125. <p>&lsquo;<samp>#n_writes</samp>&rsquo; requests a prefetch for several writes (and possibly
  126. reads), and corresponds to a prefetch function code of 2.
  127. </p>
  128. <p>&lsquo;<samp>#one_write</samp>&rsquo; requests a prefetch for one write, and corresponds
  129. to a prefetch function code of 3.
  130. </p>
  131. <p>&lsquo;<samp>#page</samp>&rsquo; requests a prefetch page, and corresponds to a prefetch
  132. function code of 4.
  133. </p>
  134. <p>&lsquo;<samp>#invalidate</samp>&rsquo; requests a prefetch invalidate, and corresponds to
  135. a prefetch function code of 16.
  136. </p>
  137. <p>&lsquo;<samp>#unified</samp>&rsquo; requests a prefetch to the nearest unified cache, and
  138. corresponds to a prefetch function code of 17.
  139. </p>
  140. <p>&lsquo;<samp>#n_reads_strong</samp>&rsquo; requests a strong prefetch for several reads,
  141. and corresponds to a prefetch function code of 20.
  142. </p>
  143. <p>&lsquo;<samp>#one_read_strong</samp>&rsquo; requests a strong prefetch for one read,
  144. and corresponds to a prefetch function code of 21.
  145. </p>
  146. <p>&lsquo;<samp>#n_writes_strong</samp>&rsquo; requests a strong prefetch for several writes,
  147. and corresponds to a prefetch function code of 22.
  148. </p>
  149. <p>&lsquo;<samp>#one_write_strong</samp>&rsquo; requests a strong prefetch for one write,
  150. and corresponds to a prefetch function code of 23.
  151. </p>
  152. <p>Onle one prefetch code may be specified. Here are some examples:
  153. </p>
  154. <div class="example">
  155. <pre class="example">prefetch [%l0 + %l2], #one_read
  156. prefetch [%g2 + 8], #n_writes
  157. prefetcha [%g1] 0x8, #unified
  158. prefetcha [%o0 + 0x10] %asi, #n_reads
  159. </pre></div>
  160. <p>The actual behavior of a given prefetch function code is processor
  161. specific. If a processor does not implement a given prefetch
  162. function code, it will treat the prefetch instruction as a nop.
  163. </p>
  164. <p>For instructions that accept an immediate address space identifier,
  165. <code>as</code> provides many mnemonics corresponding to
  166. V9 defined as well as UltraSPARC and Niagara extended values.
  167. For example, &lsquo;<samp>#ASI_P</samp>&rsquo; and &lsquo;<samp>#ASI_BLK_INIT_QUAD_LDD_AIUS</samp>&rsquo;.
  168. See the V9 and processor specific manuals for details.
  169. </p>
  170. </li></ul>
  171. <hr>
  172. <div class="header">
  173. <p>
  174. Next: <a href="Sparc_002dRelocs.html#Sparc_002dRelocs" accesskey="n" rel="next">Sparc-Relocs</a>, Previous: <a href="Sparc_002dRegs.html#Sparc_002dRegs" accesskey="p" rel="prev">Sparc-Regs</a>, Up: <a href="Sparc_002dSyntax.html#Sparc_002dSyntax" accesskey="u" rel="up">Sparc-Syntax</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
  175. </div>
  176. </body>
  177. </html>