RISC_002dV-Options.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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): RISC-V Options</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): RISC-V Options">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): RISC-V 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="RL78-Options.html#RL78-Options" rel="next" title="RL78 Options">
  31. <link href="PowerPC-Options.html#PowerPC-Options" rel="prev" title="PowerPC 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="RISC_002dV-Options"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="RL78-Options.html#RL78-Options" accesskey="n" rel="next">RL78 Options</a>, Previous: <a href="PowerPC-Options.html#PowerPC-Options" accesskey="p" rel="prev">PowerPC 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="RISC_002dV-Options-1"></a>
  69. <h4 class="subsection">3.18.37 RISC-V Options</h4>
  70. <a name="index-RISC_002dV-Options"></a>
  71. <p>These command-line options are defined for RISC-V targets:
  72. </p>
  73. <dl compact="compact">
  74. <dt><code>-mbranch-cost=<var>n</var></code></dt>
  75. <dd><a name="index-mbranch_002dcost-3"></a>
  76. <p>Set the cost of branches to roughly <var>n</var> instructions.
  77. </p>
  78. </dd>
  79. <dt><code>-mplt</code></dt>
  80. <dt><code>-mno-plt</code></dt>
  81. <dd><a name="index-plt"></a>
  82. <p>When generating PIC code, do or don&rsquo;t allow the use of PLTs. Ignored for
  83. non-PIC. The default is <samp>-mplt</samp>.
  84. </p>
  85. </dd>
  86. <dt><code>-mabi=<var>ABI-string</var></code></dt>
  87. <dd><a name="index-mabi-2"></a>
  88. <p>Specify integer and floating-point calling convention. <var>ABI-string</var>
  89. contains two parts: the size of integer types and the registers used for
  90. floating-point types. For example &lsquo;<samp>-march=rv64ifd -mabi=lp64d</samp>&rsquo; means that
  91. &lsquo;<samp>long</samp>&rsquo; and pointers are 64-bit (implicitly defining &lsquo;<samp>int</samp>&rsquo; to be
  92. 32-bit), and that floating-point values up to 64 bits wide are passed in F
  93. registers. Contrast this with &lsquo;<samp>-march=rv64ifd -mabi=lp64f</samp>&rsquo;, which still
  94. allows the compiler to generate code that uses the F and D extensions but only
  95. allows floating-point values up to 32 bits long to be passed in registers; or
  96. &lsquo;<samp>-march=rv64ifd -mabi=lp64</samp>&rsquo;, in which no floating-point arguments will be
  97. passed in registers.
  98. </p>
  99. <p>The default for this argument is system dependent, users who want a specific
  100. calling convention should specify one explicitly. The valid calling
  101. conventions are: &lsquo;<samp>ilp32</samp>&rsquo;, &lsquo;<samp>ilp32f</samp>&rsquo;, &lsquo;<samp>ilp32d</samp>&rsquo;, &lsquo;<samp>lp64</samp>&rsquo;,
  102. &lsquo;<samp>lp64f</samp>&rsquo;, and &lsquo;<samp>lp64d</samp>&rsquo;. Some calling conventions are impossible to
  103. implement on some ISAs: for example, &lsquo;<samp>-march=rv32if -mabi=ilp32d</samp>&rsquo; is
  104. invalid because the ABI requires 64-bit values be passed in F registers, but F
  105. registers are only 32 bits wide.
  106. </p>
  107. </dd>
  108. <dt><code>-mfdiv</code></dt>
  109. <dt><code>-mno-fdiv</code></dt>
  110. <dd><a name="index-mfdiv"></a>
  111. <p>Do or don&rsquo;t use hardware floating-point divide and square root instructions.
  112. This requires the F or D extensions for floating-point registers. The default
  113. is to use them if the specified architecture has these instructions.
  114. </p>
  115. </dd>
  116. <dt><code>-mdiv</code></dt>
  117. <dt><code>-mno-div</code></dt>
  118. <dd><a name="index-mdiv-3"></a>
  119. <p>Do or don&rsquo;t use hardware instructions for integer division. This requires the
  120. M extension. The default is to use them if the specified architecture has
  121. these instructions.
  122. </p>
  123. </dd>
  124. <dt><code>-march=<var>ISA-string</var></code></dt>
  125. <dd><a name="index-march-10"></a>
  126. <p>Generate code for given RISC-V ISA (e.g.&nbsp;&lsquo;<samp>rv64im</samp>&rsquo;). ISA strings must be
  127. lower-case. Examples include &lsquo;<samp>rv64i</samp>&rsquo;, &lsquo;<samp>rv32g</samp>&rsquo;, and &lsquo;<samp>rv32imaf</samp>&rsquo;.
  128. </p>
  129. </dd>
  130. <dt><code>-mtune=<var>processor-string</var></code></dt>
  131. <dd><a name="index-mtune-10"></a>
  132. <p>Optimize the output for the given processor, specified by microarchitecture
  133. name.
  134. </p>
  135. </dd>
  136. <dt><code>-msmall-data-limit=<var>n</var></code></dt>
  137. <dd><a name="index-msmall_002ddata_002dlimit"></a>
  138. <p>Put global and static data smaller than <var>n</var> bytes into a special section
  139. (on some targets).
  140. </p>
  141. </dd>
  142. <dt><code>-msave-restore</code></dt>
  143. <dt><code>-mno-save-restore</code></dt>
  144. <dd><a name="index-msave_002drestore"></a>
  145. <p>Do or don&rsquo;t use smaller but slower prologue and epilogue code that uses
  146. library function calls. The default is to use fast inline prologues and
  147. epilogues.
  148. </p>
  149. </dd>
  150. <dt><code>-mstrict-align</code></dt>
  151. <dt><code>-mno-strict-align</code></dt>
  152. <dd><a name="index-mstrict_002dalign-2"></a>
  153. <p>Do not or do generate unaligned memory accesses. The default is set depending
  154. on whether the processor we are optimizing for supports fast unaligned access
  155. or not.
  156. </p>
  157. </dd>
  158. <dt><code>-mcmodel=medlow</code></dt>
  159. <dd><a name="index-mcmodel_003dmedlow"></a>
  160. <p>Generate code for the medium-low code model. The program and its statically
  161. defined symbols must lie within a single 2 GiB address range and must lie
  162. between absolute addresses -2 GiB and +2 GiB. Programs can be
  163. statically or dynamically linked. This is the default code model.
  164. </p>
  165. </dd>
  166. <dt><code>-mcmodel=medany</code></dt>
  167. <dd><a name="index-mcmodel_003dmedany"></a>
  168. <p>Generate code for the medium-any code model. The program and its statically
  169. defined symbols must be within any single 2 GiB address range. Programs can be
  170. statically or dynamically linked.
  171. </p>
  172. </dd>
  173. <dt><code>-mexplicit-relocs</code></dt>
  174. <dt><code>-mno-exlicit-relocs</code></dt>
  175. <dd><p>Use or do not use assembler relocation operators when dealing with symbolic
  176. addresses. The alternative is to use assembler macros instead, which may
  177. limit optimization.
  178. </p>
  179. </dd>
  180. </dl>
  181. <hr>
  182. <div class="header">
  183. <p>
  184. Next: <a href="RL78-Options.html#RL78-Options" accesskey="n" rel="next">RL78 Options</a>, Previous: <a href="PowerPC-Options.html#PowerPC-Options" accesskey="p" rel="prev">PowerPC 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>
  185. </div>
  186. </body>
  187. </html>