Sparc_002dConstants.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <title>Using as: Sparc-Constants</title>
  15. <meta name="description" content="Using as: Sparc-Constants">
  16. <meta name="keywords" content="Using as: Sparc-Constants">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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.smallquotation {font-size: smaller}
  31. div.display {margin-left: 3.2em}
  32. div.example {margin-left: 3.2em}
  33. div.indentedblock {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  37. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  49. span.nolinebreak {white-space:nowrap}
  50. span.roman {font-family:serif; font-weight:normal}
  51. span.sansserif {font-family:sans-serif; font-weight:normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  57. <a name="Sparc_002dConstants"></a>
  58. <div class="header">
  59. <p>
  60. 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>
  61. </div>
  62. <hr>
  63. <a name="Constants-2"></a>
  64. <h4 class="subsubsection">9.43.3.3 Constants</h4>
  65. <a name="index-Sparc-constants"></a>
  66. <a name="index-constants_002c-Sparc"></a>
  67. <p>Several Sparc instructions take an immediate operand field for
  68. which mnemonic names exist. Two such examples are &lsquo;<samp>membar</samp>&rsquo;
  69. and &lsquo;<samp>prefetch</samp>&rsquo;. Another example are the set of V9
  70. memory access instruction that allow specification of an
  71. address space identifier.
  72. </p>
  73. <p>The &lsquo;<samp>membar</samp>&rsquo; instruction specifies a memory barrier that is
  74. the defined by the operand which is a bitmask. The supported
  75. mask mnemonics are:
  76. </p>
  77. <ul>
  78. <li> &lsquo;<samp>#Sync</samp>&rsquo; requests that all operations (including nonmemory
  79. reference operations) appearing prior to the <code>membar</code> must have
  80. been performed and the effects of any exceptions become visible before
  81. any instructions after the <code>membar</code> may be initiated. This
  82. corresponds to <code>membar</code> cmask field bit 2.
  83. </li><li> &lsquo;<samp>#MemIssue</samp>&rsquo; requests that all memory reference operations
  84. appearing prior to the <code>membar</code> must have been performed before
  85. any memory operation after the <code>membar</code> may be initiated. This
  86. corresponds to <code>membar</code> cmask field bit 1.
  87. </li><li> &lsquo;<samp>#Lookaside</samp>&rsquo; requests that a store appearing prior to the
  88. <code>membar</code> must complete before any load following the
  89. <code>membar</code> referencing the same address can be initiated. This
  90. corresponds to <code>membar</code> cmask field bit 0.
  91. </li><li> &lsquo;<samp>#StoreStore</samp>&rsquo; defines that the effects of all stores appearing
  92. prior to the <code>membar</code> instruction must be visible to all
  93. processors before the effect of any stores following the
  94. <code>membar</code>. Equivalent to the deprecated <code>stbar</code> instruction.
  95. This corresponds to <code>membar</code> mmask field bit 3.
  96. </li><li> &lsquo;<samp>#LoadStore</samp>&rsquo; defines all loads appearing prior to the
  97. <code>membar</code> instruction must have been performed before the effect
  98. of any stores following the <code>membar</code> is visible to any other
  99. processor. This corresponds to <code>membar</code> mmask field bit 2.
  100. </li><li> &lsquo;<samp>#StoreLoad</samp>&rsquo; defines that the effects of all stores appearing
  101. prior to the <code>membar</code> instruction must be visible to all
  102. processors before loads following the <code>membar</code> may be performed.
  103. This corresponds to <code>membar</code> mmask field bit 1.
  104. </li><li> &lsquo;<samp>#LoadLoad</samp>&rsquo; defines that all loads appearing prior to the
  105. <code>membar</code> instruction must have been performed before any loads
  106. following the <code>membar</code> may be performed. This corresponds to
  107. <code>membar</code> mmask field bit 0.
  108. </li></ul>
  109. <p>These values can be ored together, for example:
  110. </p>
  111. <div class="example">
  112. <pre class="example">membar #Sync
  113. membar #StoreLoad | #LoadLoad
  114. membar #StoreLoad | #StoreStore
  115. </pre></div>
  116. <p>The <code>prefetch</code> and <code>prefetcha</code> instructions take a prefetch
  117. function code. The following prefetch function code constant
  118. mnemonics are available:
  119. </p>
  120. <ul>
  121. <li> &lsquo;<samp>#n_reads</samp>&rsquo; requests a prefetch for several reads, and corresponds
  122. to a prefetch function code of 0.
  123. <p>&lsquo;<samp>#one_read</samp>&rsquo; requests a prefetch for one read, and corresponds
  124. to a prefetch function code of 1.
  125. </p>
  126. <p>&lsquo;<samp>#n_writes</samp>&rsquo; requests a prefetch for several writes (and possibly
  127. reads), and corresponds to a prefetch function code of 2.
  128. </p>
  129. <p>&lsquo;<samp>#one_write</samp>&rsquo; requests a prefetch for one write, and corresponds
  130. to a prefetch function code of 3.
  131. </p>
  132. <p>&lsquo;<samp>#page</samp>&rsquo; requests a prefetch page, and corresponds to a prefetch
  133. function code of 4.
  134. </p>
  135. <p>&lsquo;<samp>#invalidate</samp>&rsquo; requests a prefetch invalidate, and corresponds to
  136. a prefetch function code of 16.
  137. </p>
  138. <p>&lsquo;<samp>#unified</samp>&rsquo; requests a prefetch to the nearest unified cache, and
  139. corresponds to a prefetch function code of 17.
  140. </p>
  141. <p>&lsquo;<samp>#n_reads_strong</samp>&rsquo; requests a strong prefetch for several reads,
  142. and corresponds to a prefetch function code of 20.
  143. </p>
  144. <p>&lsquo;<samp>#one_read_strong</samp>&rsquo; requests a strong prefetch for one read,
  145. and corresponds to a prefetch function code of 21.
  146. </p>
  147. <p>&lsquo;<samp>#n_writes_strong</samp>&rsquo; requests a strong prefetch for several writes,
  148. and corresponds to a prefetch function code of 22.
  149. </p>
  150. <p>&lsquo;<samp>#one_write_strong</samp>&rsquo; requests a strong prefetch for one write,
  151. and corresponds to a prefetch function code of 23.
  152. </p>
  153. <p>Onle one prefetch code may be specified. Here are some examples:
  154. </p>
  155. <div class="example">
  156. <pre class="example">prefetch [%l0 + %l2], #one_read
  157. prefetch [%g2 + 8], #n_writes
  158. prefetcha [%g1] 0x8, #unified
  159. prefetcha [%o0 + 0x10] %asi, #n_reads
  160. </pre></div>
  161. <p>The actual behavior of a given prefetch function code is processor
  162. specific. If a processor does not implement a given prefetch
  163. function code, it will treat the prefetch instruction as a nop.
  164. </p>
  165. <p>For instructions that accept an immediate address space identifier,
  166. <code>as</code> provides many mnemonics corresponding to
  167. V9 defined as well as UltraSPARC and Niagara extended values.
  168. For example, &lsquo;<samp>#ASI_P</samp>&rsquo; and &lsquo;<samp>#ASI_BLK_INIT_QUAD_LDD_AIUS</samp>&rsquo;.
  169. See the V9 and processor specific manuals for details.
  170. </p>
  171. </li></ul>
  172. <hr>
  173. <div class="header">
  174. <p>
  175. 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>
  176. </div>
  177. </body>
  178. </html>