MIPS-Options.html 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  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): MIPS Options</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): MIPS Options">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): MIPS 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="MMIX-Options.html#MMIX-Options" rel="next" title="MMIX Options">
  31. <link href="MicroBlaze-Options.html#MicroBlaze-Options" rel="prev" title="MicroBlaze 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="MIPS-Options"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="MMIX-Options.html#MMIX-Options" accesskey="n" rel="next">MMIX Options</a>, Previous: <a href="MicroBlaze-Options.html#MicroBlaze-Options" accesskey="p" rel="prev">MicroBlaze 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="MIPS-Options-1"></a>
  69. <h4 class="subsection">3.18.26 MIPS Options</h4>
  70. <a name="index-MIPS-options"></a>
  71. <dl compact="compact">
  72. <dt><code>-EB</code></dt>
  73. <dd><a name="index-EB-1"></a>
  74. <p>Generate big-endian code.
  75. </p>
  76. </dd>
  77. <dt><code>-EL</code></dt>
  78. <dd><a name="index-EL-1"></a>
  79. <p>Generate little-endian code. This is the default for &lsquo;<samp>mips*el-*-*</samp>&rsquo;
  80. configurations.
  81. </p>
  82. </dd>
  83. <dt><code>-march=<var>arch</var></code></dt>
  84. <dd><a name="index-march-7"></a>
  85. <p>Generate code that runs on <var>arch</var>, which can be the name of a
  86. generic MIPS ISA, or the name of a particular processor.
  87. The ISA names are:
  88. &lsquo;<samp>mips1</samp>&rsquo;, &lsquo;<samp>mips2</samp>&rsquo;, &lsquo;<samp>mips3</samp>&rsquo;, &lsquo;<samp>mips4</samp>&rsquo;,
  89. &lsquo;<samp>mips32</samp>&rsquo;, &lsquo;<samp>mips32r2</samp>&rsquo;, &lsquo;<samp>mips32r3</samp>&rsquo;, &lsquo;<samp>mips32r5</samp>&rsquo;,
  90. &lsquo;<samp>mips32r6</samp>&rsquo;, &lsquo;<samp>mips64</samp>&rsquo;, &lsquo;<samp>mips64r2</samp>&rsquo;, &lsquo;<samp>mips64r3</samp>&rsquo;,
  91. &lsquo;<samp>mips64r5</samp>&rsquo; and &lsquo;<samp>mips64r6</samp>&rsquo;.
  92. The processor names are:
  93. &lsquo;<samp>4kc</samp>&rsquo;, &lsquo;<samp>4km</samp>&rsquo;, &lsquo;<samp>4kp</samp>&rsquo;, &lsquo;<samp>4ksc</samp>&rsquo;,
  94. &lsquo;<samp>4kec</samp>&rsquo;, &lsquo;<samp>4kem</samp>&rsquo;, &lsquo;<samp>4kep</samp>&rsquo;, &lsquo;<samp>4ksd</samp>&rsquo;,
  95. &lsquo;<samp>5kc</samp>&rsquo;, &lsquo;<samp>5kf</samp>&rsquo;,
  96. &lsquo;<samp>20kc</samp>&rsquo;,
  97. &lsquo;<samp>24kc</samp>&rsquo;, &lsquo;<samp>24kf2_1</samp>&rsquo;, &lsquo;<samp>24kf1_1</samp>&rsquo;,
  98. &lsquo;<samp>24kec</samp>&rsquo;, &lsquo;<samp>24kef2_1</samp>&rsquo;, &lsquo;<samp>24kef1_1</samp>&rsquo;,
  99. &lsquo;<samp>34kc</samp>&rsquo;, &lsquo;<samp>34kf2_1</samp>&rsquo;, &lsquo;<samp>34kf1_1</samp>&rsquo;, &lsquo;<samp>34kn</samp>&rsquo;,
  100. &lsquo;<samp>74kc</samp>&rsquo;, &lsquo;<samp>74kf2_1</samp>&rsquo;, &lsquo;<samp>74kf1_1</samp>&rsquo;, &lsquo;<samp>74kf3_2</samp>&rsquo;,
  101. &lsquo;<samp>1004kc</samp>&rsquo;, &lsquo;<samp>1004kf2_1</samp>&rsquo;, &lsquo;<samp>1004kf1_1</samp>&rsquo;,
  102. &lsquo;<samp>i6400</samp>&rsquo;,
  103. &lsquo;<samp>interaptiv</samp>&rsquo;,
  104. &lsquo;<samp>loongson2e</samp>&rsquo;, &lsquo;<samp>loongson2f</samp>&rsquo;, &lsquo;<samp>loongson3a</samp>&rsquo;,
  105. &lsquo;<samp>m4k</samp>&rsquo;,
  106. &lsquo;<samp>m14k</samp>&rsquo;, &lsquo;<samp>m14kc</samp>&rsquo;, &lsquo;<samp>m14ke</samp>&rsquo;, &lsquo;<samp>m14kec</samp>&rsquo;,
  107. &lsquo;<samp>m5100</samp>&rsquo;, &lsquo;<samp>m5101</samp>&rsquo;,
  108. &lsquo;<samp>octeon</samp>&rsquo;, &lsquo;<samp>octeon+</samp>&rsquo;, &lsquo;<samp>octeon2</samp>&rsquo;, &lsquo;<samp>octeon3</samp>&rsquo;,
  109. &lsquo;<samp>orion</samp>&rsquo;,
  110. &lsquo;<samp>p5600</samp>&rsquo;,
  111. &lsquo;<samp>r2000</samp>&rsquo;, &lsquo;<samp>r3000</samp>&rsquo;, &lsquo;<samp>r3900</samp>&rsquo;, &lsquo;<samp>r4000</samp>&rsquo;, &lsquo;<samp>r4400</samp>&rsquo;,
  112. &lsquo;<samp>r4600</samp>&rsquo;, &lsquo;<samp>r4650</samp>&rsquo;, &lsquo;<samp>r4700</samp>&rsquo;, &lsquo;<samp>r6000</samp>&rsquo;, &lsquo;<samp>r8000</samp>&rsquo;,
  113. &lsquo;<samp>rm7000</samp>&rsquo;, &lsquo;<samp>rm9000</samp>&rsquo;,
  114. &lsquo;<samp>r10000</samp>&rsquo;, &lsquo;<samp>r12000</samp>&rsquo;, &lsquo;<samp>r14000</samp>&rsquo;, &lsquo;<samp>r16000</samp>&rsquo;,
  115. &lsquo;<samp>sb1</samp>&rsquo;,
  116. &lsquo;<samp>sr71000</samp>&rsquo;,
  117. &lsquo;<samp>vr4100</samp>&rsquo;, &lsquo;<samp>vr4111</samp>&rsquo;, &lsquo;<samp>vr4120</samp>&rsquo;, &lsquo;<samp>vr4130</samp>&rsquo;, &lsquo;<samp>vr4300</samp>&rsquo;,
  118. &lsquo;<samp>vr5000</samp>&rsquo;, &lsquo;<samp>vr5400</samp>&rsquo;, &lsquo;<samp>vr5500</samp>&rsquo;,
  119. &lsquo;<samp>xlr</samp>&rsquo; and &lsquo;<samp>xlp</samp>&rsquo;.
  120. The special value &lsquo;<samp>from-abi</samp>&rsquo; selects the
  121. most compatible architecture for the selected ABI (that is,
  122. &lsquo;<samp>mips1</samp>&rsquo; for 32-bit ABIs and &lsquo;<samp>mips3</samp>&rsquo; for 64-bit ABIs).
  123. </p>
  124. <p>The native Linux/GNU toolchain also supports the value &lsquo;<samp>native</samp>&rsquo;,
  125. which selects the best architecture option for the host processor.
  126. <samp>-march=native</samp> has no effect if GCC does not recognize
  127. the processor.
  128. </p>
  129. <p>In processor names, a final &lsquo;<samp>000</samp>&rsquo; can be abbreviated as &lsquo;<samp>k</samp>&rsquo;
  130. (for example, <samp>-march=r2k</samp>). Prefixes are optional, and
  131. &lsquo;<samp>vr</samp>&rsquo; may be written &lsquo;<samp>r</samp>&rsquo;.
  132. </p>
  133. <p>Names of the form &lsquo;<samp><var>n</var>f2_1</samp>&rsquo; refer to processors with
  134. FPUs clocked at half the rate of the core, names of the form
  135. &lsquo;<samp><var>n</var>f1_1</samp>&rsquo; refer to processors with FPUs clocked at the same
  136. rate as the core, and names of the form &lsquo;<samp><var>n</var>f3_2</samp>&rsquo; refer to
  137. processors with FPUs clocked a ratio of 3:2 with respect to the core.
  138. For compatibility reasons, &lsquo;<samp><var>n</var>f</samp>&rsquo; is accepted as a synonym
  139. for &lsquo;<samp><var>n</var>f2_1</samp>&rsquo; while &lsquo;<samp><var>n</var>x</samp>&rsquo; and &lsquo;<samp><var>b</var>fx</samp>&rsquo; are
  140. accepted as synonyms for &lsquo;<samp><var>n</var>f1_1</samp>&rsquo;.
  141. </p>
  142. <p>GCC defines two macros based on the value of this option. The first
  143. is <code>_MIPS_ARCH</code>, which gives the name of target architecture, as
  144. a string. The second has the form <code>_MIPS_ARCH_<var>foo</var></code>,
  145. where <var>foo</var> is the capitalized value of <code>_MIPS_ARCH</code>.
  146. For example, <samp>-march=r2000</samp> sets <code>_MIPS_ARCH</code>
  147. to <code>&quot;r2000&quot;</code> and defines the macro <code>_MIPS_ARCH_R2000</code>.
  148. </p>
  149. <p>Note that the <code>_MIPS_ARCH</code> macro uses the processor names given
  150. above. In other words, it has the full prefix and does not
  151. abbreviate &lsquo;<samp>000</samp>&rsquo; as &lsquo;<samp>k</samp>&rsquo;. In the case of &lsquo;<samp>from-abi</samp>&rsquo;,
  152. the macro names the resolved architecture (either <code>&quot;mips1&quot;</code> or
  153. <code>&quot;mips3&quot;</code>). It names the default architecture when no
  154. <samp>-march</samp> option is given.
  155. </p>
  156. </dd>
  157. <dt><code>-mtune=<var>arch</var></code></dt>
  158. <dd><a name="index-mtune-8"></a>
  159. <p>Optimize for <var>arch</var>. Among other things, this option controls
  160. the way instructions are scheduled, and the perceived cost of arithmetic
  161. operations. The list of <var>arch</var> values is the same as for
  162. <samp>-march</samp>.
  163. </p>
  164. <p>When this option is not used, GCC optimizes for the processor
  165. specified by <samp>-march</samp>. By using <samp>-march</samp> and
  166. <samp>-mtune</samp> together, it is possible to generate code that
  167. runs on a family of processors, but optimize the code for one
  168. particular member of that family.
  169. </p>
  170. <p><samp>-mtune</samp> defines the macros <code>_MIPS_TUNE</code> and
  171. <code>_MIPS_TUNE_<var>foo</var></code>, which work in the same way as the
  172. <samp>-march</samp> ones described above.
  173. </p>
  174. </dd>
  175. <dt><code>-mips1</code></dt>
  176. <dd><a name="index-mips1"></a>
  177. <p>Equivalent to <samp>-march=mips1</samp>.
  178. </p>
  179. </dd>
  180. <dt><code>-mips2</code></dt>
  181. <dd><a name="index-mips2"></a>
  182. <p>Equivalent to <samp>-march=mips2</samp>.
  183. </p>
  184. </dd>
  185. <dt><code>-mips3</code></dt>
  186. <dd><a name="index-mips3"></a>
  187. <p>Equivalent to <samp>-march=mips3</samp>.
  188. </p>
  189. </dd>
  190. <dt><code>-mips4</code></dt>
  191. <dd><a name="index-mips4"></a>
  192. <p>Equivalent to <samp>-march=mips4</samp>.
  193. </p>
  194. </dd>
  195. <dt><code>-mips32</code></dt>
  196. <dd><a name="index-mips32"></a>
  197. <p>Equivalent to <samp>-march=mips32</samp>.
  198. </p>
  199. </dd>
  200. <dt><code>-mips32r3</code></dt>
  201. <dd><a name="index-mips32r3"></a>
  202. <p>Equivalent to <samp>-march=mips32r3</samp>.
  203. </p>
  204. </dd>
  205. <dt><code>-mips32r5</code></dt>
  206. <dd><a name="index-mips32r5"></a>
  207. <p>Equivalent to <samp>-march=mips32r5</samp>.
  208. </p>
  209. </dd>
  210. <dt><code>-mips32r6</code></dt>
  211. <dd><a name="index-mips32r6"></a>
  212. <p>Equivalent to <samp>-march=mips32r6</samp>.
  213. </p>
  214. </dd>
  215. <dt><code>-mips64</code></dt>
  216. <dd><a name="index-mips64"></a>
  217. <p>Equivalent to <samp>-march=mips64</samp>.
  218. </p>
  219. </dd>
  220. <dt><code>-mips64r2</code></dt>
  221. <dd><a name="index-mips64r2"></a>
  222. <p>Equivalent to <samp>-march=mips64r2</samp>.
  223. </p>
  224. </dd>
  225. <dt><code>-mips64r3</code></dt>
  226. <dd><a name="index-mips64r3"></a>
  227. <p>Equivalent to <samp>-march=mips64r3</samp>.
  228. </p>
  229. </dd>
  230. <dt><code>-mips64r5</code></dt>
  231. <dd><a name="index-mips64r5"></a>
  232. <p>Equivalent to <samp>-march=mips64r5</samp>.
  233. </p>
  234. </dd>
  235. <dt><code>-mips64r6</code></dt>
  236. <dd><a name="index-mips64r6"></a>
  237. <p>Equivalent to <samp>-march=mips64r6</samp>.
  238. </p>
  239. </dd>
  240. <dt><code>-mips16</code></dt>
  241. <dt><code>-mno-mips16</code></dt>
  242. <dd><a name="index-mips16"></a>
  243. <a name="index-mno_002dmips16"></a>
  244. <p>Generate (do not generate) MIPS16 code. If GCC is targeting a
  245. MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE.
  246. </p>
  247. <p>MIPS16 code generation can also be controlled on a per-function basis
  248. by means of <code>mips16</code> and <code>nomips16</code> attributes.
  249. See <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>, for more information.
  250. </p>
  251. </dd>
  252. <dt><code>-mflip-mips16</code></dt>
  253. <dd><a name="index-mflip_002dmips16"></a>
  254. <p>Generate MIPS16 code on alternating functions. This option is provided
  255. for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
  256. not intended for ordinary use in compiling user code.
  257. </p>
  258. </dd>
  259. <dt><code>-minterlink-compressed</code></dt>
  260. <dt><code>-mno-interlink-compressed</code></dt>
  261. <dd><a name="index-minterlink_002dcompressed"></a>
  262. <a name="index-mno_002dinterlink_002dcompressed"></a>
  263. <p>Require (do not require) that code using the standard (uncompressed) MIPS ISA
  264. be link-compatible with MIPS16 and microMIPS code, and vice versa.
  265. </p>
  266. <p>For example, code using the standard ISA encoding cannot jump directly
  267. to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
  268. <samp>-minterlink-compressed</samp> therefore disables direct jumps unless GCC
  269. knows that the target of the jump is not compressed.
  270. </p>
  271. </dd>
  272. <dt><code>-minterlink-mips16</code></dt>
  273. <dt><code>-mno-interlink-mips16</code></dt>
  274. <dd><a name="index-minterlink_002dmips16"></a>
  275. <a name="index-mno_002dinterlink_002dmips16"></a>
  276. <p>Aliases of <samp>-minterlink-compressed</samp> and
  277. <samp>-mno-interlink-compressed</samp>. These options predate the microMIPS ASE
  278. and are retained for backwards compatibility.
  279. </p>
  280. </dd>
  281. <dt><code>-mabi=32</code></dt>
  282. <dt><code>-mabi=o64</code></dt>
  283. <dt><code>-mabi=n32</code></dt>
  284. <dt><code>-mabi=64</code></dt>
  285. <dt><code>-mabi=eabi</code></dt>
  286. <dd><a name="index-mabi_003d32"></a>
  287. <a name="index-mabi_003do64"></a>
  288. <a name="index-mabi_003dn32"></a>
  289. <a name="index-mabi_003d64"></a>
  290. <a name="index-mabi_003deabi"></a>
  291. <p>Generate code for the given ABI.
  292. </p>
  293. <p>Note that the EABI has a 32-bit and a 64-bit variant. GCC normally
  294. generates 64-bit code when you select a 64-bit architecture, but you
  295. can use <samp>-mgp32</samp> to get 32-bit code instead.
  296. </p>
  297. <p>For information about the O64 ABI, see
  298. <a href="http://gcc.gnu.org/projects/mipso64-abi.html">http://gcc.gnu.org/projects/mipso64-abi.html</a>.
  299. </p>
  300. <p>GCC supports a variant of the o32 ABI in which floating-point registers
  301. are 64 rather than 32 bits wide. You can select this combination with
  302. <samp>-mabi=32</samp> <samp>-mfp64</samp>. This ABI relies on the <code>mthc1</code>
  303. and <code>mfhc1</code> instructions and is therefore only supported for
  304. MIPS32R2, MIPS32R3 and MIPS32R5 processors.
  305. </p>
  306. <p>The register assignments for arguments and return values remain the
  307. same, but each scalar value is passed in a single 64-bit register
  308. rather than a pair of 32-bit registers. For example, scalar
  309. floating-point values are returned in &lsquo;<samp>$f0</samp>&rsquo; only, not a
  310. &lsquo;<samp>$f0</samp>&rsquo;/&lsquo;<samp>$f1</samp>&rsquo; pair. The set of call-saved registers also
  311. remains the same in that the even-numbered double-precision registers
  312. are saved.
  313. </p>
  314. <p>Two additional variants of the o32 ABI are supported to enable
  315. a transition from 32-bit to 64-bit registers. These are FPXX
  316. (<samp>-mfpxx</samp>) and FP64A (<samp>-mfp64</samp> <samp>-mno-odd-spreg</samp>).
  317. The FPXX extension mandates that all code must execute correctly
  318. when run using 32-bit or 64-bit registers. The code can be interlinked
  319. with either FP32 or FP64, but not both.
  320. The FP64A extension is similar to the FP64 extension but forbids the
  321. use of odd-numbered single-precision registers. This can be used
  322. in conjunction with the <code>FRE</code> mode of FPUs in MIPS32R5
  323. processors and allows both FP32 and FP64A code to interlink and
  324. run in the same process without changing FPU modes.
  325. </p>
  326. </dd>
  327. <dt><code>-mabicalls</code></dt>
  328. <dt><code>-mno-abicalls</code></dt>
  329. <dd><a name="index-mabicalls"></a>
  330. <a name="index-mno_002dabicalls"></a>
  331. <p>Generate (do not generate) code that is suitable for SVR4-style
  332. dynamic objects. <samp>-mabicalls</samp> is the default for SVR4-based
  333. systems.
  334. </p>
  335. </dd>
  336. <dt><code>-mshared</code></dt>
  337. <dt><code>-mno-shared</code></dt>
  338. <dd><p>Generate (do not generate) code that is fully position-independent,
  339. and that can therefore be linked into shared libraries. This option
  340. only affects <samp>-mabicalls</samp>.
  341. </p>
  342. <p>All <samp>-mabicalls</samp> code has traditionally been position-independent,
  343. regardless of options like <samp>-fPIC</samp> and <samp>-fpic</samp>. However,
  344. as an extension, the GNU toolchain allows executables to use absolute
  345. accesses for locally-binding symbols. It can also use shorter GP
  346. initialization sequences and generate direct calls to locally-defined
  347. functions. This mode is selected by <samp>-mno-shared</samp>.
  348. </p>
  349. <p><samp>-mno-shared</samp> depends on binutils 2.16 or higher and generates
  350. objects that can only be linked by the GNU linker. However, the option
  351. does not affect the ABI of the final executable; it only affects the ABI
  352. of relocatable objects. Using <samp>-mno-shared</samp> generally makes
  353. executables both smaller and quicker.
  354. </p>
  355. <p><samp>-mshared</samp> is the default.
  356. </p>
  357. </dd>
  358. <dt><code>-mplt</code></dt>
  359. <dt><code>-mno-plt</code></dt>
  360. <dd><a name="index-mplt"></a>
  361. <a name="index-mno_002dplt"></a>
  362. <p>Assume (do not assume) that the static and dynamic linkers
  363. support PLTs and copy relocations. This option only affects
  364. <samp>-mno-shared -mabicalls</samp>. For the n64 ABI, this option
  365. has no effect without <samp>-msym32</samp>.
  366. </p>
  367. <p>You can make <samp>-mplt</samp> the default by configuring
  368. GCC with <samp>--with-mips-plt</samp>. The default is
  369. <samp>-mno-plt</samp> otherwise.
  370. </p>
  371. </dd>
  372. <dt><code>-mxgot</code></dt>
  373. <dt><code>-mno-xgot</code></dt>
  374. <dd><a name="index-mxgot-1"></a>
  375. <a name="index-mno_002dxgot-1"></a>
  376. <p>Lift (do not lift) the usual restrictions on the size of the global
  377. offset table.
  378. </p>
  379. <p>GCC normally uses a single instruction to load values from the GOT.
  380. While this is relatively efficient, it only works if the GOT
  381. is smaller than about 64k. Anything larger causes the linker
  382. to report an error such as:
  383. </p>
  384. <a name="index-relocation-truncated-to-fit-_0028MIPS_0029"></a>
  385. <div class="smallexample">
  386. <pre class="smallexample">relocation truncated to fit: R_MIPS_GOT16 foobar
  387. </pre></div>
  388. <p>If this happens, you should recompile your code with <samp>-mxgot</samp>.
  389. This works with very large GOTs, although the code is also
  390. less efficient, since it takes three instructions to fetch the
  391. value of a global symbol.
  392. </p>
  393. <p>Note that some linkers can create multiple GOTs. If you have such a
  394. linker, you should only need to use <samp>-mxgot</samp> when a single object
  395. file accesses more than 64k&rsquo;s worth of GOT entries. Very few do.
  396. </p>
  397. <p>These options have no effect unless GCC is generating position
  398. independent code.
  399. </p>
  400. </dd>
  401. <dt><code>-mgp32</code></dt>
  402. <dd><a name="index-mgp32"></a>
  403. <p>Assume that general-purpose registers are 32 bits wide.
  404. </p>
  405. </dd>
  406. <dt><code>-mgp64</code></dt>
  407. <dd><a name="index-mgp64"></a>
  408. <p>Assume that general-purpose registers are 64 bits wide.
  409. </p>
  410. </dd>
  411. <dt><code>-mfp32</code></dt>
  412. <dd><a name="index-mfp32"></a>
  413. <p>Assume that floating-point registers are 32 bits wide.
  414. </p>
  415. </dd>
  416. <dt><code>-mfp64</code></dt>
  417. <dd><a name="index-mfp64"></a>
  418. <p>Assume that floating-point registers are 64 bits wide.
  419. </p>
  420. </dd>
  421. <dt><code>-mfpxx</code></dt>
  422. <dd><a name="index-mfpxx"></a>
  423. <p>Do not assume the width of floating-point registers.
  424. </p>
  425. </dd>
  426. <dt><code>-mhard-float</code></dt>
  427. <dd><a name="index-mhard_002dfloat-3"></a>
  428. <p>Use floating-point coprocessor instructions.
  429. </p>
  430. </dd>
  431. <dt><code>-msoft-float</code></dt>
  432. <dd><a name="index-msoft_002dfloat-6"></a>
  433. <p>Do not use floating-point coprocessor instructions. Implement
  434. floating-point calculations using library calls instead.
  435. </p>
  436. </dd>
  437. <dt><code>-mno-float</code></dt>
  438. <dd><a name="index-mno_002dfloat"></a>
  439. <p>Equivalent to <samp>-msoft-float</samp>, but additionally asserts that the
  440. program being compiled does not perform any floating-point operations.
  441. This option is presently supported only by some bare-metal MIPS
  442. configurations, where it may select a special set of libraries
  443. that lack all floating-point support (including, for example, the
  444. floating-point <code>printf</code> formats).
  445. If code compiled with <samp>-mno-float</samp> accidentally contains
  446. floating-point operations, it is likely to suffer a link-time
  447. or run-time failure.
  448. </p>
  449. </dd>
  450. <dt><code>-msingle-float</code></dt>
  451. <dd><a name="index-msingle_002dfloat"></a>
  452. <p>Assume that the floating-point coprocessor only supports single-precision
  453. operations.
  454. </p>
  455. </dd>
  456. <dt><code>-mdouble-float</code></dt>
  457. <dd><a name="index-mdouble_002dfloat"></a>
  458. <p>Assume that the floating-point coprocessor supports double-precision
  459. operations. This is the default.
  460. </p>
  461. </dd>
  462. <dt><code>-modd-spreg</code></dt>
  463. <dt><code>-mno-odd-spreg</code></dt>
  464. <dd><a name="index-modd_002dspreg"></a>
  465. <a name="index-mno_002dodd_002dspreg"></a>
  466. <p>Enable the use of odd-numbered single-precision floating-point registers
  467. for the o32 ABI. This is the default for processors that are known to
  468. support these registers. When using the o32 FPXX ABI, <samp>-mno-odd-spreg</samp>
  469. is set by default.
  470. </p>
  471. </dd>
  472. <dt><code>-mabs=2008</code></dt>
  473. <dt><code>-mabs=legacy</code></dt>
  474. <dd><a name="index-mabs_003d2008"></a>
  475. <a name="index-mabs_003dlegacy"></a>
  476. <p>These options control the treatment of the special not-a-number (NaN)
  477. IEEE 754 floating-point data with the <code>abs.<i>fmt</i></code> and
  478. <code>neg.<i>fmt</i></code> machine instructions.
  479. </p>
  480. <p>By default or when <samp>-mabs=legacy</samp> is used the legacy
  481. treatment is selected. In this case these instructions are considered
  482. arithmetic and avoided where correct operation is required and the
  483. input operand might be a NaN. A longer sequence of instructions that
  484. manipulate the sign bit of floating-point datum manually is used
  485. instead unless the <samp>-ffinite-math-only</samp> option has also been
  486. specified.
  487. </p>
  488. <p>The <samp>-mabs=2008</samp> option selects the IEEE 754-2008 treatment. In
  489. this case these instructions are considered non-arithmetic and therefore
  490. operating correctly in all cases, including in particular where the
  491. input operand is a NaN. These instructions are therefore always used
  492. for the respective operations.
  493. </p>
  494. </dd>
  495. <dt><code>-mnan=2008</code></dt>
  496. <dt><code>-mnan=legacy</code></dt>
  497. <dd><a name="index-mnan_003d2008"></a>
  498. <a name="index-mnan_003dlegacy"></a>
  499. <p>These options control the encoding of the special not-a-number (NaN)
  500. IEEE 754 floating-point data.
  501. </p>
  502. <p>The <samp>-mnan=legacy</samp> option selects the legacy encoding. In this
  503. case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
  504. significand field being 0, whereas signaling NaNs (sNaNs) are denoted
  505. by the first bit of their trailing significand field being 1.
  506. </p>
  507. <p>The <samp>-mnan=2008</samp> option selects the IEEE 754-2008 encoding. In
  508. this case qNaNs are denoted by the first bit of their trailing
  509. significand field being 1, whereas sNaNs are denoted by the first bit of
  510. their trailing significand field being 0.
  511. </p>
  512. <p>The default is <samp>-mnan=legacy</samp> unless GCC has been configured with
  513. <samp>--with-nan=2008</samp>.
  514. </p>
  515. </dd>
  516. <dt><code>-mllsc</code></dt>
  517. <dt><code>-mno-llsc</code></dt>
  518. <dd><a name="index-mllsc"></a>
  519. <a name="index-mno_002dllsc"></a>
  520. <p>Use (do not use) &lsquo;<samp>ll</samp>&rsquo;, &lsquo;<samp>sc</samp>&rsquo;, and &lsquo;<samp>sync</samp>&rsquo; instructions to
  521. implement atomic memory built-in functions. When neither option is
  522. specified, GCC uses the instructions if the target architecture
  523. supports them.
  524. </p>
  525. <p><samp>-mllsc</samp> is useful if the runtime environment can emulate the
  526. instructions and <samp>-mno-llsc</samp> can be useful when compiling for
  527. nonstandard ISAs. You can make either option the default by
  528. configuring GCC with <samp>--with-llsc</samp> and <samp>--without-llsc</samp>
  529. respectively. <samp>--with-llsc</samp> is the default for some
  530. configurations; see the installation documentation for details.
  531. </p>
  532. </dd>
  533. <dt><code>-mdsp</code></dt>
  534. <dt><code>-mno-dsp</code></dt>
  535. <dd><a name="index-mdsp"></a>
  536. <a name="index-mno_002ddsp"></a>
  537. <p>Use (do not use) revision 1 of the MIPS DSP ASE.
  538. See <a href="MIPS-DSP-Built_002din-Functions.html#MIPS-DSP-Built_002din-Functions">MIPS DSP Built-in Functions</a>. This option defines the
  539. preprocessor macro <code>__mips_dsp</code>. It also defines
  540. <code>__mips_dsp_rev</code> to 1.
  541. </p>
  542. </dd>
  543. <dt><code>-mdspr2</code></dt>
  544. <dt><code>-mno-dspr2</code></dt>
  545. <dd><a name="index-mdspr2"></a>
  546. <a name="index-mno_002ddspr2"></a>
  547. <p>Use (do not use) revision 2 of the MIPS DSP ASE.
  548. See <a href="MIPS-DSP-Built_002din-Functions.html#MIPS-DSP-Built_002din-Functions">MIPS DSP Built-in Functions</a>. This option defines the
  549. preprocessor macros <code>__mips_dsp</code> and <code>__mips_dspr2</code>.
  550. It also defines <code>__mips_dsp_rev</code> to 2.
  551. </p>
  552. </dd>
  553. <dt><code>-msmartmips</code></dt>
  554. <dt><code>-mno-smartmips</code></dt>
  555. <dd><a name="index-msmartmips"></a>
  556. <a name="index-mno_002dsmartmips"></a>
  557. <p>Use (do not use) the MIPS SmartMIPS ASE.
  558. </p>
  559. </dd>
  560. <dt><code>-mpaired-single</code></dt>
  561. <dt><code>-mno-paired-single</code></dt>
  562. <dd><a name="index-mpaired_002dsingle"></a>
  563. <a name="index-mno_002dpaired_002dsingle"></a>
  564. <p>Use (do not use) paired-single floating-point instructions.
  565. See <a href="MIPS-Paired_002dSingle-Support.html#MIPS-Paired_002dSingle-Support">MIPS Paired-Single Support</a>. This option requires
  566. hardware floating-point support to be enabled.
  567. </p>
  568. </dd>
  569. <dt><code>-mdmx</code></dt>
  570. <dt><code>-mno-mdmx</code></dt>
  571. <dd><a name="index-mdmx"></a>
  572. <a name="index-mno_002dmdmx"></a>
  573. <p>Use (do not use) MIPS Digital Media Extension instructions.
  574. This option can only be used when generating 64-bit code and requires
  575. hardware floating-point support to be enabled.
  576. </p>
  577. </dd>
  578. <dt><code>-mips3d</code></dt>
  579. <dt><code>-mno-mips3d</code></dt>
  580. <dd><a name="index-mips3d"></a>
  581. <a name="index-mno_002dmips3d"></a>
  582. <p>Use (do not use) the MIPS-3D ASE. See <a href="MIPS_002d3D-Built_002din-Functions.html#MIPS_002d3D-Built_002din-Functions">MIPS-3D Built-in Functions</a>.
  583. The option <samp>-mips3d</samp> implies <samp>-mpaired-single</samp>.
  584. </p>
  585. </dd>
  586. <dt><code>-mmicromips</code></dt>
  587. <dt><code>-mno-micromips</code></dt>
  588. <dd><a name="index-mmicromips"></a>
  589. <a name="index-mno_002dmmicromips"></a>
  590. <p>Generate (do not generate) microMIPS code.
  591. </p>
  592. <p>MicroMIPS code generation can also be controlled on a per-function basis
  593. by means of <code>micromips</code> and <code>nomicromips</code> attributes.
  594. See <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>, for more information.
  595. </p>
  596. </dd>
  597. <dt><code>-mmt</code></dt>
  598. <dt><code>-mno-mt</code></dt>
  599. <dd><a name="index-mmt"></a>
  600. <a name="index-mno_002dmt"></a>
  601. <p>Use (do not use) MT Multithreading instructions.
  602. </p>
  603. </dd>
  604. <dt><code>-mmcu</code></dt>
  605. <dt><code>-mno-mcu</code></dt>
  606. <dd><a name="index-mmcu-1"></a>
  607. <a name="index-mno_002dmcu"></a>
  608. <p>Use (do not use) the MIPS MCU ASE instructions.
  609. </p>
  610. </dd>
  611. <dt><code>-meva</code></dt>
  612. <dt><code>-mno-eva</code></dt>
  613. <dd><a name="index-meva"></a>
  614. <a name="index-mno_002deva"></a>
  615. <p>Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
  616. </p>
  617. </dd>
  618. <dt><code>-mvirt</code></dt>
  619. <dt><code>-mno-virt</code></dt>
  620. <dd><a name="index-mvirt"></a>
  621. <a name="index-mno_002dvirt"></a>
  622. <p>Use (do not use) the MIPS Virtualization (VZ) instructions.
  623. </p>
  624. </dd>
  625. <dt><code>-mxpa</code></dt>
  626. <dt><code>-mno-xpa</code></dt>
  627. <dd><a name="index-mxpa"></a>
  628. <a name="index-mno_002dxpa"></a>
  629. <p>Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
  630. </p>
  631. </dd>
  632. <dt><code>-mlong64</code></dt>
  633. <dd><a name="index-mlong64"></a>
  634. <p>Force <code>long</code> types to be 64 bits wide. See <samp>-mlong32</samp> for
  635. an explanation of the default and the way that the pointer size is
  636. determined.
  637. </p>
  638. </dd>
  639. <dt><code>-mlong32</code></dt>
  640. <dd><a name="index-mlong32"></a>
  641. <p>Force <code>long</code>, <code>int</code>, and pointer types to be 32 bits wide.
  642. </p>
  643. <p>The default size of <code>int</code>s, <code>long</code>s and pointers depends on
  644. the ABI. All the supported ABIs use 32-bit <code>int</code>s. The n64 ABI
  645. uses 64-bit <code>long</code>s, as does the 64-bit EABI; the others use
  646. 32-bit <code>long</code>s. Pointers are the same size as <code>long</code>s,
  647. or the same size as integer registers, whichever is smaller.
  648. </p>
  649. </dd>
  650. <dt><code>-msym32</code></dt>
  651. <dt><code>-mno-sym32</code></dt>
  652. <dd><a name="index-msym32"></a>
  653. <a name="index-mno_002dsym32"></a>
  654. <p>Assume (do not assume) that all symbols have 32-bit values, regardless
  655. of the selected ABI. This option is useful in combination with
  656. <samp>-mabi=64</samp> and <samp>-mno-abicalls</samp> because it allows GCC
  657. to generate shorter and faster references to symbolic addresses.
  658. </p>
  659. </dd>
  660. <dt><code>-G <var>num</var></code></dt>
  661. <dd><a name="index-G-1"></a>
  662. <p>Put definitions of externally-visible data in a small data section
  663. if that data is no bigger than <var>num</var> bytes. GCC can then generate
  664. more efficient accesses to the data; see <samp>-mgpopt</samp> for details.
  665. </p>
  666. <p>The default <samp>-G</samp> option depends on the configuration.
  667. </p>
  668. </dd>
  669. <dt><code>-mlocal-sdata</code></dt>
  670. <dt><code>-mno-local-sdata</code></dt>
  671. <dd><a name="index-mlocal_002dsdata"></a>
  672. <a name="index-mno_002dlocal_002dsdata"></a>
  673. <p>Extend (do not extend) the <samp>-G</samp> behavior to local data too,
  674. such as to static variables in C. <samp>-mlocal-sdata</samp> is the
  675. default for all configurations.
  676. </p>
  677. <p>If the linker complains that an application is using too much small data,
  678. you might want to try rebuilding the less performance-critical parts with
  679. <samp>-mno-local-sdata</samp>. You might also want to build large
  680. libraries with <samp>-mno-local-sdata</samp>, so that the libraries leave
  681. more room for the main program.
  682. </p>
  683. </dd>
  684. <dt><code>-mextern-sdata</code></dt>
  685. <dt><code>-mno-extern-sdata</code></dt>
  686. <dd><a name="index-mextern_002dsdata"></a>
  687. <a name="index-mno_002dextern_002dsdata"></a>
  688. <p>Assume (do not assume) that externally-defined data is in
  689. a small data section if the size of that data is within the <samp>-G</samp> limit.
  690. <samp>-mextern-sdata</samp> is the default for all configurations.
  691. </p>
  692. <p>If you compile a module <var>Mod</var> with <samp>-mextern-sdata</samp> <samp>-G
  693. <var>num</var></samp> <samp>-mgpopt</samp>, and <var>Mod</var> references a variable <var>Var</var>
  694. that is no bigger than <var>num</var> bytes, you must make sure that <var>Var</var>
  695. is placed in a small data section. If <var>Var</var> is defined by another
  696. module, you must either compile that module with a high-enough
  697. <samp>-G</samp> setting or attach a <code>section</code> attribute to <var>Var</var>&rsquo;s
  698. definition. If <var>Var</var> is common, you must link the application
  699. with a high-enough <samp>-G</samp> setting.
  700. </p>
  701. <p>The easiest way of satisfying these restrictions is to compile
  702. and link every module with the same <samp>-G</samp> option. However,
  703. you may wish to build a library that supports several different
  704. small data limits. You can do this by compiling the library with
  705. the highest supported <samp>-G</samp> setting and additionally using
  706. <samp>-mno-extern-sdata</samp> to stop the library from making assumptions
  707. about externally-defined data.
  708. </p>
  709. </dd>
  710. <dt><code>-mgpopt</code></dt>
  711. <dt><code>-mno-gpopt</code></dt>
  712. <dd><a name="index-mgpopt"></a>
  713. <a name="index-mno_002dgpopt"></a>
  714. <p>Use (do not use) GP-relative accesses for symbols that are known to be
  715. in a small data section; see <samp>-G</samp>, <samp>-mlocal-sdata</samp> and
  716. <samp>-mextern-sdata</samp>. <samp>-mgpopt</samp> is the default for all
  717. configurations.
  718. </p>
  719. <p><samp>-mno-gpopt</samp> is useful for cases where the <code>$gp</code> register
  720. might not hold the value of <code>_gp</code>. For example, if the code is
  721. part of a library that might be used in a boot monitor, programs that
  722. call boot monitor routines pass an unknown value in <code>$gp</code>.
  723. (In such situations, the boot monitor itself is usually compiled
  724. with <samp>-G0</samp>.)
  725. </p>
  726. <p><samp>-mno-gpopt</samp> implies <samp>-mno-local-sdata</samp> and
  727. <samp>-mno-extern-sdata</samp>.
  728. </p>
  729. </dd>
  730. <dt><code>-membedded-data</code></dt>
  731. <dt><code>-mno-embedded-data</code></dt>
  732. <dd><a name="index-membedded_002ddata"></a>
  733. <a name="index-mno_002dembedded_002ddata"></a>
  734. <p>Allocate variables to the read-only data section first if possible, then
  735. next in the small data section if possible, otherwise in data. This gives
  736. slightly slower code than the default, but reduces the amount of RAM required
  737. when executing, and thus may be preferred for some embedded systems.
  738. </p>
  739. </dd>
  740. <dt><code>-muninit-const-in-rodata</code></dt>
  741. <dt><code>-mno-uninit-const-in-rodata</code></dt>
  742. <dd><a name="index-muninit_002dconst_002din_002drodata"></a>
  743. <a name="index-mno_002duninit_002dconst_002din_002drodata"></a>
  744. <p>Put uninitialized <code>const</code> variables in the read-only data section.
  745. This option is only meaningful in conjunction with <samp>-membedded-data</samp>.
  746. </p>
  747. </dd>
  748. <dt><code>-mcode-readable=<var>setting</var></code></dt>
  749. <dd><a name="index-mcode_002dreadable"></a>
  750. <p>Specify whether GCC may generate code that reads from executable sections.
  751. There are three possible settings:
  752. </p>
  753. <dl compact="compact">
  754. <dt><code>-mcode-readable=yes</code></dt>
  755. <dd><p>Instructions may freely access executable sections. This is the
  756. default setting.
  757. </p>
  758. </dd>
  759. <dt><code>-mcode-readable=pcrel</code></dt>
  760. <dd><p>MIPS16 PC-relative load instructions can access executable sections,
  761. but other instructions must not do so. This option is useful on 4KSc
  762. and 4KSd processors when the code TLBs have the Read Inhibit bit set.
  763. It is also useful on processors that can be configured to have a dual
  764. instruction/data SRAM interface and that, like the M4K, automatically
  765. redirect PC-relative loads to the instruction RAM.
  766. </p>
  767. </dd>
  768. <dt><code>-mcode-readable=no</code></dt>
  769. <dd><p>Instructions must not access executable sections. This option can be
  770. useful on targets that are configured to have a dual instruction/data
  771. SRAM interface but that (unlike the M4K) do not automatically redirect
  772. PC-relative loads to the instruction RAM.
  773. </p></dd>
  774. </dl>
  775. </dd>
  776. <dt><code>-msplit-addresses</code></dt>
  777. <dt><code>-mno-split-addresses</code></dt>
  778. <dd><a name="index-msplit_002daddresses"></a>
  779. <a name="index-mno_002dsplit_002daddresses"></a>
  780. <p>Enable (disable) use of the <code>%hi()</code> and <code>%lo()</code> assembler
  781. relocation operators. This option has been superseded by
  782. <samp>-mexplicit-relocs</samp> but is retained for backwards compatibility.
  783. </p>
  784. </dd>
  785. <dt><code>-mexplicit-relocs</code></dt>
  786. <dt><code>-mno-explicit-relocs</code></dt>
  787. <dd><a name="index-mexplicit_002drelocs-1"></a>
  788. <a name="index-mno_002dexplicit_002drelocs-1"></a>
  789. <p>Use (do not use) assembler relocation operators when dealing with symbolic
  790. addresses. The alternative, selected by <samp>-mno-explicit-relocs</samp>,
  791. is to use assembler macros instead.
  792. </p>
  793. <p><samp>-mexplicit-relocs</samp> is the default if GCC was configured
  794. to use an assembler that supports relocation operators.
  795. </p>
  796. </dd>
  797. <dt><code>-mcheck-zero-division</code></dt>
  798. <dt><code>-mno-check-zero-division</code></dt>
  799. <dd><a name="index-mcheck_002dzero_002ddivision"></a>
  800. <a name="index-mno_002dcheck_002dzero_002ddivision"></a>
  801. <p>Trap (do not trap) on integer division by zero.
  802. </p>
  803. <p>The default is <samp>-mcheck-zero-division</samp>.
  804. </p>
  805. </dd>
  806. <dt><code>-mdivide-traps</code></dt>
  807. <dt><code>-mdivide-breaks</code></dt>
  808. <dd><a name="index-mdivide_002dtraps"></a>
  809. <a name="index-mdivide_002dbreaks"></a>
  810. <p>MIPS systems check for division by zero by generating either a
  811. conditional trap or a break instruction. Using traps results in
  812. smaller code, but is only supported on MIPS II and later. Also, some
  813. versions of the Linux kernel have a bug that prevents trap from
  814. generating the proper signal (<code>SIGFPE</code>). Use <samp>-mdivide-traps</samp> to
  815. allow conditional traps on architectures that support them and
  816. <samp>-mdivide-breaks</samp> to force the use of breaks.
  817. </p>
  818. <p>The default is usually <samp>-mdivide-traps</samp>, but this can be
  819. overridden at configure time using <samp>--with-divide=breaks</samp>.
  820. Divide-by-zero checks can be completely disabled using
  821. <samp>-mno-check-zero-division</samp>.
  822. </p>
  823. </dd>
  824. <dt><code>-mload-store-pairs</code></dt>
  825. <dt><code>-mno-load-store-pairs</code></dt>
  826. <dd><a name="index-mload_002dstore_002dpairs"></a>
  827. <a name="index-mno_002dload_002dstore_002dpairs"></a>
  828. <p>Enable (disable) an optimization that pairs consecutive load or store
  829. instructions to enable load/store bonding. This option is enabled by
  830. default but only takes effect when the selected architecture is known
  831. to support bonding.
  832. </p>
  833. </dd>
  834. <dt><code>-mmemcpy</code></dt>
  835. <dt><code>-mno-memcpy</code></dt>
  836. <dd><a name="index-mmemcpy-1"></a>
  837. <a name="index-mno_002dmemcpy"></a>
  838. <p>Force (do not force) the use of <code>memcpy</code> for non-trivial block
  839. moves. The default is <samp>-mno-memcpy</samp>, which allows GCC to inline
  840. most constant-sized copies.
  841. </p>
  842. </dd>
  843. <dt><code>-mlong-calls</code></dt>
  844. <dt><code>-mno-long-calls</code></dt>
  845. <dd><a name="index-mlong_002dcalls-5"></a>
  846. <a name="index-mno_002dlong_002dcalls-3"></a>
  847. <p>Disable (do not disable) use of the <code>jal</code> instruction. Calling
  848. functions using <code>jal</code> is more efficient but requires the caller
  849. and callee to be in the same 256 megabyte segment.
  850. </p>
  851. <p>This option has no effect on abicalls code. The default is
  852. <samp>-mno-long-calls</samp>.
  853. </p>
  854. </dd>
  855. <dt><code>-mmad</code></dt>
  856. <dt><code>-mno-mad</code></dt>
  857. <dd><a name="index-mmad"></a>
  858. <a name="index-mno_002dmad"></a>
  859. <p>Enable (disable) use of the <code>mad</code>, <code>madu</code> and <code>mul</code>
  860. instructions, as provided by the R4650 ISA.
  861. </p>
  862. </dd>
  863. <dt><code>-mimadd</code></dt>
  864. <dt><code>-mno-imadd</code></dt>
  865. <dd><a name="index-mimadd"></a>
  866. <a name="index-mno_002dimadd"></a>
  867. <p>Enable (disable) use of the <code>madd</code> and <code>msub</code> integer
  868. instructions. The default is <samp>-mimadd</samp> on architectures
  869. that support <code>madd</code> and <code>msub</code> except for the 74k
  870. architecture where it was found to generate slower code.
  871. </p>
  872. </dd>
  873. <dt><code>-mfused-madd</code></dt>
  874. <dt><code>-mno-fused-madd</code></dt>
  875. <dd><a name="index-mfused_002dmadd-1"></a>
  876. <a name="index-mno_002dfused_002dmadd-1"></a>
  877. <p>Enable (disable) use of the floating-point multiply-accumulate
  878. instructions, when they are available. The default is
  879. <samp>-mfused-madd</samp>.
  880. </p>
  881. <p>On the R8000 CPU when multiply-accumulate instructions are used,
  882. the intermediate product is calculated to infinite precision
  883. and is not subject to the FCSR Flush to Zero bit. This may be
  884. undesirable in some circumstances. On other processors the result
  885. is numerically identical to the equivalent computation using
  886. separate multiply, add, subtract and negate instructions.
  887. </p>
  888. </dd>
  889. <dt><code>-nocpp</code></dt>
  890. <dd><a name="index-nocpp"></a>
  891. <p>Tell the MIPS assembler to not run its preprocessor over user
  892. assembler files (with a &lsquo;<samp>.s</samp>&rsquo; suffix) when assembling them.
  893. </p>
  894. </dd>
  895. <dt><code>-mfix-24k</code></dt>
  896. <dt><code>-mno-fix-24k</code></dt>
  897. <dd><a name="index-mfix_002d24k"></a>
  898. <a name="index-mno_002dfix_002d24k"></a>
  899. <p>Work around the 24K E48 (lost data on stores during refill) errata.
  900. The workarounds are implemented by the assembler rather than by GCC.
  901. </p>
  902. </dd>
  903. <dt><code>-mfix-r4000</code></dt>
  904. <dt><code>-mno-fix-r4000</code></dt>
  905. <dd><a name="index-mfix_002dr4000"></a>
  906. <a name="index-mno_002dfix_002dr4000"></a>
  907. <p>Work around certain R4000 CPU errata:
  908. </p><ul class="no-bullet">
  909. <li>- A double-word or a variable shift may give an incorrect result if executed
  910. immediately after starting an integer division.
  911. </li><li>- A double-word or a variable shift may give an incorrect result if executed
  912. while an integer multiplication is in progress.
  913. </li><li>- An integer division may give an incorrect result if started in a delay slot
  914. of a taken branch or a jump.
  915. </li></ul>
  916. </dd>
  917. <dt><code>-mfix-r4400</code></dt>
  918. <dt><code>-mno-fix-r4400</code></dt>
  919. <dd><a name="index-mfix_002dr4400"></a>
  920. <a name="index-mno_002dfix_002dr4400"></a>
  921. <p>Work around certain R4400 CPU errata:
  922. </p><ul class="no-bullet">
  923. <li>- A double-word or a variable shift may give an incorrect result if executed
  924. immediately after starting an integer division.
  925. </li></ul>
  926. </dd>
  927. <dt><code>-mfix-r10000</code></dt>
  928. <dt><code>-mno-fix-r10000</code></dt>
  929. <dd><a name="index-mfix_002dr10000"></a>
  930. <a name="index-mno_002dfix_002dr10000"></a>
  931. <p>Work around certain R10000 errata:
  932. </p><ul class="no-bullet">
  933. <li>- <code>ll</code>/<code>sc</code> sequences may not behave atomically on revisions
  934. prior to 3.0. They may deadlock on revisions 2.6 and earlier.
  935. </li></ul>
  936. <p>This option can only be used if the target architecture supports
  937. branch-likely instructions. <samp>-mfix-r10000</samp> is the default when
  938. <samp>-march=r10000</samp> is used; <samp>-mno-fix-r10000</samp> is the default
  939. otherwise.
  940. </p>
  941. </dd>
  942. <dt><code>-mfix-rm7000</code></dt>
  943. <dt><code>-mno-fix-rm7000</code></dt>
  944. <dd><a name="index-mfix_002drm7000"></a>
  945. <p>Work around the RM7000 <code>dmult</code>/<code>dmultu</code> errata. The
  946. workarounds are implemented by the assembler rather than by GCC.
  947. </p>
  948. </dd>
  949. <dt><code>-mfix-vr4120</code></dt>
  950. <dt><code>-mno-fix-vr4120</code></dt>
  951. <dd><a name="index-mfix_002dvr4120"></a>
  952. <p>Work around certain VR4120 errata:
  953. </p><ul class="no-bullet">
  954. <li>- <code>dmultu</code> does not always produce the correct result.
  955. </li><li>- <code>div</code> and <code>ddiv</code> do not always produce the correct result if one
  956. of the operands is negative.
  957. </li></ul>
  958. <p>The workarounds for the division errata rely on special functions in
  959. <samp>libgcc.a</samp>. At present, these functions are only provided by
  960. the <code>mips64vr*-elf</code> configurations.
  961. </p>
  962. <p>Other VR4120 errata require a NOP to be inserted between certain pairs of
  963. instructions. These errata are handled by the assembler, not by GCC itself.
  964. </p>
  965. </dd>
  966. <dt><code>-mfix-vr4130</code></dt>
  967. <dd><a name="index-mfix_002dvr4130"></a>
  968. <p>Work around the VR4130 <code>mflo</code>/<code>mfhi</code> errata. The
  969. workarounds are implemented by the assembler rather than by GCC,
  970. although GCC avoids using <code>mflo</code> and <code>mfhi</code> if the
  971. VR4130 <code>macc</code>, <code>macchi</code>, <code>dmacc</code> and <code>dmacchi</code>
  972. instructions are available instead.
  973. </p>
  974. </dd>
  975. <dt><code>-mfix-sb1</code></dt>
  976. <dt><code>-mno-fix-sb1</code></dt>
  977. <dd><a name="index-mfix_002dsb1"></a>
  978. <p>Work around certain SB-1 CPU core errata.
  979. (This flag currently works around the SB-1 revision 2
  980. &ldquo;F1&rdquo; and &ldquo;F2&rdquo; floating-point errata.)
  981. </p>
  982. </dd>
  983. <dt><code>-mr10k-cache-barrier=<var>setting</var></code></dt>
  984. <dd><a name="index-mr10k_002dcache_002dbarrier"></a>
  985. <p>Specify whether GCC should insert cache barriers to avoid the
  986. side-effects of speculation on R10K processors.
  987. </p>
  988. <p>In common with many processors, the R10K tries to predict the outcome
  989. of a conditional branch and speculatively executes instructions from
  990. the &ldquo;taken&rdquo; branch. It later aborts these instructions if the
  991. predicted outcome is wrong. However, on the R10K, even aborted
  992. instructions can have side effects.
  993. </p>
  994. <p>This problem only affects kernel stores and, depending on the system,
  995. kernel loads. As an example, a speculatively-executed store may load
  996. the target memory into cache and mark the cache line as dirty, even if
  997. the store itself is later aborted. If a DMA operation writes to the
  998. same area of memory before the &ldquo;dirty&rdquo; line is flushed, the cached
  999. data overwrites the DMA-ed data. See the R10K processor manual
  1000. for a full description, including other potential problems.
  1001. </p>
  1002. <p>One workaround is to insert cache barrier instructions before every memory
  1003. access that might be speculatively executed and that might have side
  1004. effects even if aborted. <samp>-mr10k-cache-barrier=<var>setting</var></samp>
  1005. controls GCC&rsquo;s implementation of this workaround. It assumes that
  1006. aborted accesses to any byte in the following regions does not have
  1007. side effects:
  1008. </p>
  1009. <ol>
  1010. <li> the memory occupied by the current function&rsquo;s stack frame;
  1011. </li><li> the memory occupied by an incoming stack argument;
  1012. </li><li> the memory occupied by an object with a link-time-constant address.
  1013. </li></ol>
  1014. <p>It is the kernel&rsquo;s responsibility to ensure that speculative
  1015. accesses to these regions are indeed safe.
  1016. </p>
  1017. <p>If the input program contains a function declaration such as:
  1018. </p>
  1019. <div class="smallexample">
  1020. <pre class="smallexample">void foo (void);
  1021. </pre></div>
  1022. <p>then the implementation of <code>foo</code> must allow <code>j foo</code> and
  1023. <code>jal foo</code> to be executed speculatively. GCC honors this
  1024. restriction for functions it compiles itself. It expects non-GCC
  1025. functions (such as hand-written assembly code) to do the same.
  1026. </p>
  1027. <p>The option has three forms:
  1028. </p>
  1029. <dl compact="compact">
  1030. <dt><code>-mr10k-cache-barrier=load-store</code></dt>
  1031. <dd><p>Insert a cache barrier before a load or store that might be
  1032. speculatively executed and that might have side effects even
  1033. if aborted.
  1034. </p>
  1035. </dd>
  1036. <dt><code>-mr10k-cache-barrier=store</code></dt>
  1037. <dd><p>Insert a cache barrier before a store that might be speculatively
  1038. executed and that might have side effects even if aborted.
  1039. </p>
  1040. </dd>
  1041. <dt><code>-mr10k-cache-barrier=none</code></dt>
  1042. <dd><p>Disable the insertion of cache barriers. This is the default setting.
  1043. </p></dd>
  1044. </dl>
  1045. </dd>
  1046. <dt><code>-mflush-func=<var>func</var></code></dt>
  1047. <dt><code>-mno-flush-func</code></dt>
  1048. <dd><a name="index-mflush_002dfunc"></a>
  1049. <p>Specifies the function to call to flush the I and D caches, or to not
  1050. call any such function. If called, the function must take the same
  1051. arguments as the common <code>_flush_func</code>, that is, the address of the
  1052. memory range for which the cache is being flushed, the size of the
  1053. memory range, and the number 3 (to flush both caches). The default
  1054. depends on the target GCC was configured for, but commonly is either
  1055. <code>_flush_func</code> or <code>__cpu_flush</code>.
  1056. </p>
  1057. </dd>
  1058. <dt><code>mbranch-cost=<var>num</var></code></dt>
  1059. <dd><a name="index-mbranch_002dcost-2"></a>
  1060. <p>Set the cost of branches to roughly <var>num</var> &ldquo;simple&rdquo; instructions.
  1061. This cost is only a heuristic and is not guaranteed to produce
  1062. consistent results across releases. A zero cost redundantly selects
  1063. the default, which is based on the <samp>-mtune</samp> setting.
  1064. </p>
  1065. </dd>
  1066. <dt><code>-mbranch-likely</code></dt>
  1067. <dt><code>-mno-branch-likely</code></dt>
  1068. <dd><a name="index-mbranch_002dlikely"></a>
  1069. <a name="index-mno_002dbranch_002dlikely"></a>
  1070. <p>Enable or disable use of Branch Likely instructions, regardless of the
  1071. default for the selected architecture. By default, Branch Likely
  1072. instructions may be generated if they are supported by the selected
  1073. architecture. An exception is for the MIPS32 and MIPS64 architectures
  1074. and processors that implement those architectures; for those, Branch
  1075. Likely instructions are not be generated by default because the MIPS32
  1076. and MIPS64 architectures specifically deprecate their use.
  1077. </p>
  1078. </dd>
  1079. <dt><code>-mcompact-branches=never</code></dt>
  1080. <dt><code>-mcompact-branches=optimal</code></dt>
  1081. <dt><code>-mcompact-branches=always</code></dt>
  1082. <dd><a name="index-mcompact_002dbranches_003dnever"></a>
  1083. <a name="index-mcompact_002dbranches_003doptimal"></a>
  1084. <a name="index-mcompact_002dbranches_003dalways"></a>
  1085. <p>These options control which form of branches will be generated. The
  1086. default is <samp>-mcompact-branches=optimal</samp>.
  1087. </p>
  1088. <p>The <samp>-mcompact-branches=never</samp> option ensures that compact branch
  1089. instructions will never be generated.
  1090. </p>
  1091. <p>The <samp>-mcompact-branches=always</samp> option ensures that a compact
  1092. branch instruction will be generated if available. If a compact branch
  1093. instruction is not available, a delay slot form of the branch will be
  1094. used instead.
  1095. </p>
  1096. <p>This option is supported from MIPS Release 6 onwards.
  1097. </p>
  1098. <p>The <samp>-mcompact-branches=optimal</samp> option will cause a delay slot
  1099. branch to be used if one is available in the current ISA and the delay
  1100. slot is successfully filled. If the delay slot is not filled, a compact
  1101. branch will be chosen if one is available.
  1102. </p>
  1103. </dd>
  1104. <dt><code>-mfp-exceptions</code></dt>
  1105. <dt><code>-mno-fp-exceptions</code></dt>
  1106. <dd><a name="index-mfp_002dexceptions"></a>
  1107. <p>Specifies whether FP exceptions are enabled. This affects how
  1108. FP instructions are scheduled for some processors.
  1109. The default is that FP exceptions are
  1110. enabled.
  1111. </p>
  1112. <p>For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
  1113. 64-bit code, then we can use both FP pipes. Otherwise, we can only use one
  1114. FP pipe.
  1115. </p>
  1116. </dd>
  1117. <dt><code>-mvr4130-align</code></dt>
  1118. <dt><code>-mno-vr4130-align</code></dt>
  1119. <dd><a name="index-mvr4130_002dalign"></a>
  1120. <p>The VR4130 pipeline is two-way superscalar, but can only issue two
  1121. instructions together if the first one is 8-byte aligned. When this
  1122. option is enabled, GCC aligns pairs of instructions that it
  1123. thinks should execute in parallel.
  1124. </p>
  1125. <p>This option only has an effect when optimizing for the VR4130.
  1126. It normally makes code faster, but at the expense of making it bigger.
  1127. It is enabled by default at optimization level <samp>-O3</samp>.
  1128. </p>
  1129. </dd>
  1130. <dt><code>-msynci</code></dt>
  1131. <dt><code>-mno-synci</code></dt>
  1132. <dd><a name="index-msynci"></a>
  1133. <p>Enable (disable) generation of <code>synci</code> instructions on
  1134. architectures that support it. The <code>synci</code> instructions (if
  1135. enabled) are generated when <code>__builtin___clear_cache</code> is
  1136. compiled.
  1137. </p>
  1138. <p>This option defaults to <samp>-mno-synci</samp>, but the default can be
  1139. overridden by configuring GCC with <samp>--with-synci</samp>.
  1140. </p>
  1141. <p>When compiling code for single processor systems, it is generally safe
  1142. to use <code>synci</code>. However, on many multi-core (SMP) systems, it
  1143. does not invalidate the instruction caches on all cores and may lead
  1144. to undefined behavior.
  1145. </p>
  1146. </dd>
  1147. <dt><code>-mrelax-pic-calls</code></dt>
  1148. <dt><code>-mno-relax-pic-calls</code></dt>
  1149. <dd><a name="index-mrelax_002dpic_002dcalls"></a>
  1150. <p>Try to turn PIC calls that are normally dispatched via register
  1151. <code>$25</code> into direct calls. This is only possible if the linker can
  1152. resolve the destination at link time and if the destination is within
  1153. range for a direct call.
  1154. </p>
  1155. <p><samp>-mrelax-pic-calls</samp> is the default if GCC was configured to use
  1156. an assembler and a linker that support the <code>.reloc</code> assembly
  1157. directive and <samp>-mexplicit-relocs</samp> is in effect. With
  1158. <samp>-mno-explicit-relocs</samp>, this optimization can be performed by the
  1159. assembler and the linker alone without help from the compiler.
  1160. </p>
  1161. </dd>
  1162. <dt><code>-mmcount-ra-address</code></dt>
  1163. <dt><code>-mno-mcount-ra-address</code></dt>
  1164. <dd><a name="index-mmcount_002dra_002daddress"></a>
  1165. <a name="index-mno_002dmcount_002dra_002daddress"></a>
  1166. <p>Emit (do not emit) code that allows <code>_mcount</code> to modify the
  1167. calling function&rsquo;s return address. When enabled, this option extends
  1168. the usual <code>_mcount</code> interface with a new <var>ra-address</var>
  1169. parameter, which has type <code>intptr_t *</code> and is passed in register
  1170. <code>$12</code>. <code>_mcount</code> can then modify the return address by
  1171. doing both of the following:
  1172. </p><ul>
  1173. <li> Returning the new address in register <code>$31</code>.
  1174. </li><li> Storing the new address in <code>*<var>ra-address</var></code>,
  1175. if <var>ra-address</var> is nonnull.
  1176. </li></ul>
  1177. <p>The default is <samp>-mno-mcount-ra-address</samp>.
  1178. </p>
  1179. </dd>
  1180. <dt><code>-mframe-header-opt</code></dt>
  1181. <dt><code>-mno-frame-header-opt</code></dt>
  1182. <dd><a name="index-mframe_002dheader_002dopt"></a>
  1183. <p>Enable (disable) frame header optimization in the o32 ABI. When using the
  1184. o32 ABI, calling functions will allocate 16 bytes on the stack for the called
  1185. function to write out register arguments. When enabled, this optimization
  1186. will suppress the allocation of the frame header if it can be determined that
  1187. it is unused.
  1188. </p>
  1189. <p>This optimization is off by default at all optimization levels.
  1190. </p>
  1191. </dd>
  1192. <dt><code>-mlxc1-sxc1</code></dt>
  1193. <dt><code>-mno-lxc1-sxc1</code></dt>
  1194. <dd><a name="index-mlxc1_002dsxc1"></a>
  1195. <p>When applicable, enable (disable) the generation of <code>lwxc1</code>,
  1196. <code>swxc1</code>, <code>ldxc1</code>, <code>sdxc1</code> instructions. Enabled by default.
  1197. </p>
  1198. </dd>
  1199. <dt><code>-mmadd4</code></dt>
  1200. <dt><code>-mno-madd4</code></dt>
  1201. <dd><a name="index-mmadd4"></a>
  1202. <p>When applicable, enable (disable) the generation of 4-operand <code>madd.s</code>,
  1203. <code>madd.d</code> and related instructions. Enabled by default.
  1204. </p>
  1205. </dd>
  1206. </dl>
  1207. <hr>
  1208. <div class="header">
  1209. <p>
  1210. Next: <a href="MMIX-Options.html#MMIX-Options" accesskey="n" rel="next">MMIX Options</a>, Previous: <a href="MicroBlaze-Options.html#MicroBlaze-Options" accesskey="p" rel="prev">MicroBlaze 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>
  1211. </div>
  1212. </body>
  1213. </html>