SPU-Options.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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): SPU Options</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): SPU Options">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): SPU Options">
  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="Submodel-Options.html#Submodel-Options" rel="up" title="Submodel Options">
  30. <link href="System-V-Options.html#System-V-Options" rel="next" title="System V Options">
  31. <link href="SPARC-Options.html#SPARC-Options" rel="prev" title="SPARC Options">
  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="SPU-Options"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="System-V-Options.html#System-V-Options" accesskey="n" rel="next">System V Options</a>, Previous: <a href="SPARC-Options.html#SPARC-Options" accesskey="p" rel="prev">SPARC Options</a>, Up: <a href="Submodel-Options.html#Submodel-Options" accesskey="u" rel="up">Submodel Options</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="SPU-Options-1"></a>
  69. <h4 class="subsection">3.18.46 SPU Options</h4>
  70. <a name="index-SPU-options"></a>
  71. <p>These &lsquo;<samp>-m</samp>&rsquo; options are supported on the SPU:
  72. </p>
  73. <dl compact="compact">
  74. <dt><code>-mwarn-reloc</code></dt>
  75. <dt><code>-merror-reloc</code></dt>
  76. <dd><a name="index-mwarn_002dreloc"></a>
  77. <a name="index-merror_002dreloc"></a>
  78. <p>The loader for SPU does not handle dynamic relocations. By default, GCC
  79. gives an error when it generates code that requires a dynamic
  80. relocation. <samp>-mno-error-reloc</samp> disables the error,
  81. <samp>-mwarn-reloc</samp> generates a warning instead.
  82. </p>
  83. </dd>
  84. <dt><code>-msafe-dma</code></dt>
  85. <dt><code>-munsafe-dma</code></dt>
  86. <dd><a name="index-msafe_002ddma"></a>
  87. <a name="index-munsafe_002ddma"></a>
  88. <p>Instructions that initiate or test completion of DMA must not be
  89. reordered with respect to loads and stores of the memory that is being
  90. accessed.
  91. With <samp>-munsafe-dma</samp> you must use the <code>volatile</code> keyword to protect
  92. memory accesses, but that can lead to inefficient code in places where the
  93. memory is known to not change. Rather than mark the memory as volatile,
  94. you can use <samp>-msafe-dma</samp> to tell the compiler to treat
  95. the DMA instructions as potentially affecting all memory.
  96. </p>
  97. </dd>
  98. <dt><code>-mbranch-hints</code></dt>
  99. <dd><a name="index-mbranch_002dhints"></a>
  100. <p>By default, GCC generates a branch hint instruction to avoid
  101. pipeline stalls for always-taken or probably-taken branches. A hint
  102. is not generated closer than 8 instructions away from its branch.
  103. There is little reason to disable them, except for debugging purposes,
  104. or to make an object a little bit smaller.
  105. </p>
  106. </dd>
  107. <dt><code>-msmall-mem</code></dt>
  108. <dt><code>-mlarge-mem</code></dt>
  109. <dd><a name="index-msmall_002dmem"></a>
  110. <a name="index-mlarge_002dmem"></a>
  111. <p>By default, GCC generates code assuming that addresses are never larger
  112. than 18 bits. With <samp>-mlarge-mem</samp> code is generated that assumes
  113. a full 32-bit address.
  114. </p>
  115. </dd>
  116. <dt><code>-mstdmain</code></dt>
  117. <dd><a name="index-mstdmain"></a>
  118. <p>By default, GCC links against startup code that assumes the SPU-style
  119. main function interface (which has an unconventional parameter list).
  120. With <samp>-mstdmain</samp>, GCC links your program against startup
  121. code that assumes a C99-style interface to <code>main</code>, including a
  122. local copy of <code>argv</code> strings.
  123. </p>
  124. </dd>
  125. <dt><code>-mfixed-range=<var>register-range</var></code></dt>
  126. <dd><a name="index-mfixed_002drange-3"></a>
  127. <p>Generate code treating the given register range as fixed registers.
  128. A fixed register is one that the register allocator cannot use. This is
  129. useful when compiling kernel code. A register range is specified as
  130. two registers separated by a dash. Multiple register ranges can be
  131. specified separated by a comma.
  132. </p>
  133. </dd>
  134. <dt><code>-mea32</code></dt>
  135. <dt><code>-mea64</code></dt>
  136. <dd><a name="index-mea32"></a>
  137. <a name="index-mea64"></a>
  138. <p>Compile code assuming that pointers to the PPU address space accessed
  139. via the <code>__ea</code> named address space qualifier are either 32 or 64
  140. bits wide. The default is 32 bits. As this is an ABI-changing option,
  141. all object code in an executable must be compiled with the same setting.
  142. </p>
  143. </dd>
  144. <dt><code>-maddress-space-conversion</code></dt>
  145. <dt><code>-mno-address-space-conversion</code></dt>
  146. <dd><a name="index-maddress_002dspace_002dconversion"></a>
  147. <a name="index-mno_002daddress_002dspace_002dconversion"></a>
  148. <p>Allow/disallow treating the <code>__ea</code> address space as superset
  149. of the generic address space. This enables explicit type casts
  150. between <code>__ea</code> and generic pointer as well as implicit
  151. conversions of generic pointers to <code>__ea</code> pointers. The
  152. default is to allow address space pointer conversions.
  153. </p>
  154. </dd>
  155. <dt><code>-mcache-size=<var>cache-size</var></code></dt>
  156. <dd><a name="index-mcache_002dsize"></a>
  157. <p>This option controls the version of libgcc that the compiler links to an
  158. executable and selects a software-managed cache for accessing variables
  159. in the <code>__ea</code> address space with a particular cache size. Possible
  160. options for <var>cache-size</var> are &lsquo;<samp>8</samp>&rsquo;, &lsquo;<samp>16</samp>&rsquo;, &lsquo;<samp>32</samp>&rsquo;, &lsquo;<samp>64</samp>&rsquo;
  161. and &lsquo;<samp>128</samp>&rsquo;. The default cache size is 64KB.
  162. </p>
  163. </dd>
  164. <dt><code>-matomic-updates</code></dt>
  165. <dt><code>-mno-atomic-updates</code></dt>
  166. <dd><a name="index-matomic_002dupdates"></a>
  167. <a name="index-mno_002datomic_002dupdates"></a>
  168. <p>This option controls the version of libgcc that the compiler links to an
  169. executable and selects whether atomic updates to the software-managed
  170. cache of PPU-side variables are used. If you use atomic updates, changes
  171. to a PPU variable from SPU code using the <code>__ea</code> named address space
  172. qualifier do not interfere with changes to other PPU variables residing
  173. in the same cache line from PPU code. If you do not use atomic updates,
  174. such interference may occur; however, writing back cache lines is
  175. more efficient. The default behavior is to use atomic updates.
  176. </p>
  177. </dd>
  178. <dt><code>-mdual-nops</code></dt>
  179. <dt><code>-mdual-nops=<var>n</var></code></dt>
  180. <dd><a name="index-mdual_002dnops"></a>
  181. <p>By default, GCC inserts NOPs to increase dual issue when it expects
  182. it to increase performance. <var>n</var> can be a value from 0 to 10. A
  183. smaller <var>n</var> inserts fewer NOPs. 10 is the default, 0 is the
  184. same as <samp>-mno-dual-nops</samp>. Disabled with <samp>-Os</samp>.
  185. </p>
  186. </dd>
  187. <dt><code>-mhint-max-nops=<var>n</var></code></dt>
  188. <dd><a name="index-mhint_002dmax_002dnops"></a>
  189. <p>Maximum number of NOPs to insert for a branch hint. A branch hint must
  190. be at least 8 instructions away from the branch it is affecting. GCC
  191. inserts up to <var>n</var> NOPs to enforce this, otherwise it does not
  192. generate the branch hint.
  193. </p>
  194. </dd>
  195. <dt><code>-mhint-max-distance=<var>n</var></code></dt>
  196. <dd><a name="index-mhint_002dmax_002ddistance"></a>
  197. <p>The encoding of the branch hint instruction limits the hint to be within
  198. 256 instructions of the branch it is affecting. By default, GCC makes
  199. sure it is within 125.
  200. </p>
  201. </dd>
  202. <dt><code>-msafe-hints</code></dt>
  203. <dd><a name="index-msafe_002dhints"></a>
  204. <p>Work around a hardware bug that causes the SPU to stall indefinitely.
  205. By default, GCC inserts the <code>hbrp</code> instruction to make sure
  206. this stall won&rsquo;t happen.
  207. </p>
  208. </dd>
  209. </dl>
  210. <hr>
  211. <div class="header">
  212. <p>
  213. Next: <a href="System-V-Options.html#System-V-Options" accesskey="n" rel="next">System V Options</a>, Previous: <a href="SPARC-Options.html#SPARC-Options" accesskey="p" rel="prev">SPARC Options</a>, Up: <a href="Submodel-Options.html#Submodel-Options" accesskey="u" rel="up">Submodel Options</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>
  214. </div>
  215. </body>
  216. </html>