Alignment-Output.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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>GNU Compiler Collection (GCC) Internals: Alignment Output</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Alignment Output">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Alignment Output">
  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="Assembler-Format.html#Assembler-Format" rel="up" title="Assembler Format">
  30. <link href="Debugging-Info.html#Debugging-Info" rel="next" title="Debugging Info">
  31. <link href="Exception-Region-Output.html#Exception-Region-Output" rel="prev" title="Exception Region Output">
  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="Alignment-Output"></a>
  63. <div class="header">
  64. <p>
  65. Previous: <a href="Exception-Region-Output.html#Exception-Region-Output" accesskey="p" rel="prev">Exception Region Output</a>, Up: <a href="Assembler-Format.html#Assembler-Format" accesskey="u" rel="up">Assembler Format</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="Assembler-Commands-for-Alignment"></a>
  69. <h4 class="subsection">17.20.10 Assembler Commands for Alignment</h4>
  70. <p>This describes commands for alignment.
  71. </p>
  72. <dl>
  73. <dt><a name="index-JUMP_005fALIGN"></a>Macro: <strong>JUMP_ALIGN</strong> <em>(<var>label</var>)</em></dt>
  74. <dd><p>The alignment (log base 2) to put in front of <var>label</var>, which is
  75. a common destination of jumps and has no fallthru incoming edge.
  76. </p>
  77. <p>This macro need not be defined if you don&rsquo;t want any special alignment
  78. to be done at such a time. Most machine descriptions do not currently
  79. define the macro.
  80. </p>
  81. <p>Unless it&rsquo;s necessary to inspect the <var>label</var> parameter, it is better
  82. to set the variable <var>align_jumps</var> in the target&rsquo;s
  83. <code>TARGET_OPTION_OVERRIDE</code>. Otherwise, you should try to honor the user&rsquo;s
  84. selection in <var>align_jumps</var> in a <code>JUMP_ALIGN</code> implementation.
  85. </p></dd></dl>
  86. <dl>
  87. <dt><a name="index-TARGET_005fASM_005fJUMP_005fALIGN_005fMAX_005fSKIP"></a>Target Hook: <em>int</em> <strong>TARGET_ASM_JUMP_ALIGN_MAX_SKIP</strong> <em>(rtx_insn *<var>label</var>)</em></dt>
  88. <dd><p>The maximum number of bytes to skip before <var>label</var> when applying
  89. <code>JUMP_ALIGN</code>. This works only if
  90. <code>ASM_OUTPUT_MAX_SKIP_ALIGN</code> is defined.
  91. </p></dd></dl>
  92. <dl>
  93. <dt><a name="index-LABEL_005fALIGN_005fAFTER_005fBARRIER"></a>Macro: <strong>LABEL_ALIGN_AFTER_BARRIER</strong> <em>(<var>label</var>)</em></dt>
  94. <dd><p>The alignment (log base 2) to put in front of <var>label</var>, which follows
  95. a <code>BARRIER</code>.
  96. </p>
  97. <p>This macro need not be defined if you don&rsquo;t want any special alignment
  98. to be done at such a time. Most machine descriptions do not currently
  99. define the macro.
  100. </p></dd></dl>
  101. <dl>
  102. <dt><a name="index-TARGET_005fASM_005fLABEL_005fALIGN_005fAFTER_005fBARRIER_005fMAX_005fSKIP"></a>Target Hook: <em>int</em> <strong>TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP</strong> <em>(rtx_insn *<var>label</var>)</em></dt>
  103. <dd><p>The maximum number of bytes to skip before <var>label</var> when applying
  104. <code>LABEL_ALIGN_AFTER_BARRIER</code>. This works only if
  105. <code>ASM_OUTPUT_MAX_SKIP_ALIGN</code> is defined.
  106. </p></dd></dl>
  107. <dl>
  108. <dt><a name="index-LOOP_005fALIGN"></a>Macro: <strong>LOOP_ALIGN</strong> <em>(<var>label</var>)</em></dt>
  109. <dd><p>The alignment (log base 2) to put in front of <var>label</var> that heads
  110. a frequently executed basic block (usually the header of a loop).
  111. </p>
  112. <p>This macro need not be defined if you don&rsquo;t want any special alignment
  113. to be done at such a time. Most machine descriptions do not currently
  114. define the macro.
  115. </p>
  116. <p>Unless it&rsquo;s necessary to inspect the <var>label</var> parameter, it is better
  117. to set the variable <code>align_loops</code> in the target&rsquo;s
  118. <code>TARGET_OPTION_OVERRIDE</code>. Otherwise, you should try to honor the user&rsquo;s
  119. selection in <code>align_loops</code> in a <code>LOOP_ALIGN</code> implementation.
  120. </p></dd></dl>
  121. <dl>
  122. <dt><a name="index-TARGET_005fASM_005fLOOP_005fALIGN_005fMAX_005fSKIP"></a>Target Hook: <em>int</em> <strong>TARGET_ASM_LOOP_ALIGN_MAX_SKIP</strong> <em>(rtx_insn *<var>label</var>)</em></dt>
  123. <dd><p>The maximum number of bytes to skip when applying <code>LOOP_ALIGN</code> to
  124. <var>label</var>. This works only if <code>ASM_OUTPUT_MAX_SKIP_ALIGN</code> is
  125. defined.
  126. </p></dd></dl>
  127. <dl>
  128. <dt><a name="index-LABEL_005fALIGN"></a>Macro: <strong>LABEL_ALIGN</strong> <em>(<var>label</var>)</em></dt>
  129. <dd><p>The alignment (log base 2) to put in front of <var>label</var>.
  130. If <code>LABEL_ALIGN_AFTER_BARRIER</code> / <code>LOOP_ALIGN</code> specify a different alignment,
  131. the maximum of the specified values is used.
  132. </p>
  133. <p>Unless it&rsquo;s necessary to inspect the <var>label</var> parameter, it is better
  134. to set the variable <code>align_labels</code> in the target&rsquo;s
  135. <code>TARGET_OPTION_OVERRIDE</code>. Otherwise, you should try to honor the user&rsquo;s
  136. selection in <code>align_labels</code> in a <code>LABEL_ALIGN</code> implementation.
  137. </p></dd></dl>
  138. <dl>
  139. <dt><a name="index-TARGET_005fASM_005fLABEL_005fALIGN_005fMAX_005fSKIP"></a>Target Hook: <em>int</em> <strong>TARGET_ASM_LABEL_ALIGN_MAX_SKIP</strong> <em>(rtx_insn *<var>label</var>)</em></dt>
  140. <dd><p>The maximum number of bytes to skip when applying <code>LABEL_ALIGN</code>
  141. to <var>label</var>. This works only if <code>ASM_OUTPUT_MAX_SKIP_ALIGN</code>
  142. is defined.
  143. </p></dd></dl>
  144. <dl>
  145. <dt><a name="index-ASM_005fOUTPUT_005fSKIP"></a>Macro: <strong>ASM_OUTPUT_SKIP</strong> <em>(<var>stream</var>, <var>nbytes</var>)</em></dt>
  146. <dd><p>A C statement to output to the stdio stream <var>stream</var> an assembler
  147. instruction to advance the location counter by <var>nbytes</var> bytes.
  148. Those bytes should be zero when loaded. <var>nbytes</var> will be a C
  149. expression of type <code>unsigned HOST_WIDE_INT</code>.
  150. </p></dd></dl>
  151. <dl>
  152. <dt><a name="index-ASM_005fNO_005fSKIP_005fIN_005fTEXT"></a>Macro: <strong>ASM_NO_SKIP_IN_TEXT</strong></dt>
  153. <dd><p>Define this macro if <code>ASM_OUTPUT_SKIP</code> should not be used in the
  154. text section because it fails to put zeros in the bytes that are skipped.
  155. This is true on many Unix systems, where the pseudo&ndash;op to skip bytes
  156. produces no-op instructions rather than zeros when used in the text
  157. section.
  158. </p></dd></dl>
  159. <dl>
  160. <dt><a name="index-ASM_005fOUTPUT_005fALIGN"></a>Macro: <strong>ASM_OUTPUT_ALIGN</strong> <em>(<var>stream</var>, <var>power</var>)</em></dt>
  161. <dd><p>A C statement to output to the stdio stream <var>stream</var> an assembler
  162. command to advance the location counter to a multiple of 2 to the
  163. <var>power</var> bytes. <var>power</var> will be a C expression of type <code>int</code>.
  164. </p></dd></dl>
  165. <dl>
  166. <dt><a name="index-ASM_005fOUTPUT_005fALIGN_005fWITH_005fNOP"></a>Macro: <strong>ASM_OUTPUT_ALIGN_WITH_NOP</strong> <em>(<var>stream</var>, <var>power</var>)</em></dt>
  167. <dd><p>Like <code>ASM_OUTPUT_ALIGN</code>, except that the &ldquo;nop&rdquo; instruction is used
  168. for padding, if necessary.
  169. </p></dd></dl>
  170. <dl>
  171. <dt><a name="index-ASM_005fOUTPUT_005fMAX_005fSKIP_005fALIGN"></a>Macro: <strong>ASM_OUTPUT_MAX_SKIP_ALIGN</strong> <em>(<var>stream</var>, <var>power</var>, <var>max_skip</var>)</em></dt>
  172. <dd><p>A C statement to output to the stdio stream <var>stream</var> an assembler
  173. command to advance the location counter to a multiple of 2 to the
  174. <var>power</var> bytes, but only if <var>max_skip</var> or fewer bytes are needed to
  175. satisfy the alignment request. <var>power</var> and <var>max_skip</var> will be
  176. a C expression of type <code>int</code>.
  177. </p></dd></dl>
  178. <hr>
  179. <div class="header">
  180. <p>
  181. Previous: <a href="Exception-Region-Output.html#Exception-Region-Output" accesskey="p" rel="prev">Exception Region Output</a>, Up: <a href="Assembler-Format.html#Assembler-Format" accesskey="u" rel="up">Assembler Format</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>
  182. </div>
  183. </body>
  184. </html>