You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

278 lines
16KB

  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-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Data Output (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Data Output (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Data Output (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  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="Uninitialized-Data.html#Uninitialized-Data" rel="next" title="Uninitialized Data">
  31. <link href="File-Framework.html#File-Framework" rel="prev" title="File Framework">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Data-Output"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Uninitialized-Data.html#Uninitialized-Data" accesskey="n" rel="next">Uninitialized Data</a>, Previous: <a href="File-Framework.html#File-Framework" accesskey="p" rel="prev">File Framework</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>
  65. </div>
  66. <hr>
  67. <a name="Output-of-Data"></a>
  68. <h4 class="subsection">18.20.2 Output of Data</h4>
  69. <dl>
  70. <dt><a name="index-TARGET_005fASM_005fBYTE_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_BYTE_OP</strong></dt>
  71. <dt><a name="index-TARGET_005fASM_005fALIGNED_005fHI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_ALIGNED_HI_OP</strong></dt>
  72. <dt><a name="index-TARGET_005fASM_005fALIGNED_005fPSI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_ALIGNED_PSI_OP</strong></dt>
  73. <dt><a name="index-TARGET_005fASM_005fALIGNED_005fSI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_ALIGNED_SI_OP</strong></dt>
  74. <dt><a name="index-TARGET_005fASM_005fALIGNED_005fPDI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_ALIGNED_PDI_OP</strong></dt>
  75. <dt><a name="index-TARGET_005fASM_005fALIGNED_005fDI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_ALIGNED_DI_OP</strong></dt>
  76. <dt><a name="index-TARGET_005fASM_005fALIGNED_005fPTI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_ALIGNED_PTI_OP</strong></dt>
  77. <dt><a name="index-TARGET_005fASM_005fALIGNED_005fTI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_ALIGNED_TI_OP</strong></dt>
  78. <dt><a name="index-TARGET_005fASM_005fUNALIGNED_005fHI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_UNALIGNED_HI_OP</strong></dt>
  79. <dt><a name="index-TARGET_005fASM_005fUNALIGNED_005fPSI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_UNALIGNED_PSI_OP</strong></dt>
  80. <dt><a name="index-TARGET_005fASM_005fUNALIGNED_005fSI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_UNALIGNED_SI_OP</strong></dt>
  81. <dt><a name="index-TARGET_005fASM_005fUNALIGNED_005fPDI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_UNALIGNED_PDI_OP</strong></dt>
  82. <dt><a name="index-TARGET_005fASM_005fUNALIGNED_005fDI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_UNALIGNED_DI_OP</strong></dt>
  83. <dt><a name="index-TARGET_005fASM_005fUNALIGNED_005fPTI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_UNALIGNED_PTI_OP</strong></dt>
  84. <dt><a name="index-TARGET_005fASM_005fUNALIGNED_005fTI_005fOP"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_UNALIGNED_TI_OP</strong></dt>
  85. <dd><p>These hooks specify assembly directives for creating certain kinds
  86. of integer object. The <code>TARGET_ASM_BYTE_OP</code> directive creates a
  87. byte-sized object, the <code>TARGET_ASM_ALIGNED_HI_OP</code> one creates an
  88. aligned two-byte object, and so on. Any of the hooks may be
  89. <code>NULL</code>, indicating that no suitable directive is available.
  90. </p>
  91. <p>The compiler will print these strings at the start of a new line,
  92. followed immediately by the object&rsquo;s initial value. In most cases,
  93. the string should contain a tab, a pseudo-op, and then another tab.
  94. </p></dd></dl>
  95. <dl>
  96. <dt><a name="index-TARGET_005fASM_005fINTEGER"></a>Target Hook: <em>bool</em> <strong>TARGET_ASM_INTEGER</strong> <em>(rtx <var>x</var>, unsigned int <var>size</var>, int <var>aligned_p</var>)</em></dt>
  97. <dd><p>The <code>assemble_integer</code> function uses this hook to output an
  98. integer object. <var>x</var> is the object&rsquo;s value, <var>size</var> is its size
  99. in bytes and <var>aligned_p</var> indicates whether it is aligned. The
  100. function should return <code>true</code> if it was able to output the
  101. object. If it returns false, <code>assemble_integer</code> will try to
  102. split the object into smaller parts.
  103. </p>
  104. <p>The default implementation of this hook will use the
  105. <code>TARGET_ASM_BYTE_OP</code> family of strings, returning <code>false</code>
  106. when the relevant string is <code>NULL</code>.
  107. </p></dd></dl>
  108. <dl>
  109. <dt><a name="index-TARGET_005fASM_005fDECL_005fEND"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_DECL_END</strong> <em>(void)</em></dt>
  110. <dd><p>Define this hook if the target assembler requires a special marker to
  111. terminate an initialized variable declaration.
  112. </p></dd></dl>
  113. <dl>
  114. <dt><a name="index-TARGET_005fASM_005fOUTPUT_005fADDR_005fCONST_005fEXTRA"></a>Target Hook: <em>bool</em> <strong>TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA</strong> <em>(FILE *<var>file</var>, rtx <var>x</var>)</em></dt>
  115. <dd><p>A target hook to recognize <var>rtx</var> patterns that <code>output_addr_const</code>
  116. can&rsquo;t deal with, and output assembly code to <var>file</var> corresponding to
  117. the pattern <var>x</var>. This may be used to allow machine-dependent
  118. <code>UNSPEC</code>s to appear within constants.
  119. </p>
  120. <p>If target hook fails to recognize a pattern, it must return <code>false</code>,
  121. so that a standard error message is printed. If it prints an error message
  122. itself, by calling, for example, <code>output_operand_lossage</code>, it may just
  123. return <code>true</code>.
  124. </p></dd></dl>
  125. <dl>
  126. <dt><a name="index-ASM_005fOUTPUT_005fASCII"></a>Macro: <strong>ASM_OUTPUT_ASCII</strong> <em>(<var>stream</var>, <var>ptr</var>, <var>len</var>)</em></dt>
  127. <dd><p>A C statement to output to the stdio stream <var>stream</var> an assembler
  128. instruction to assemble a string constant containing the <var>len</var>
  129. bytes at <var>ptr</var>. <var>ptr</var> will be a C expression of type
  130. <code>char *</code> and <var>len</var> a C expression of type <code>int</code>.
  131. </p>
  132. <p>If the assembler has a <code>.ascii</code> pseudo-op as found in the
  133. Berkeley Unix assembler, do not define the macro
  134. <code>ASM_OUTPUT_ASCII</code>.
  135. </p></dd></dl>
  136. <dl>
  137. <dt><a name="index-ASM_005fOUTPUT_005fFDESC"></a>Macro: <strong>ASM_OUTPUT_FDESC</strong> <em>(<var>stream</var>, <var>decl</var>, <var>n</var>)</em></dt>
  138. <dd><p>A C statement to output word <var>n</var> of a function descriptor for
  139. <var>decl</var>. This must be defined if <code>TARGET_VTABLE_USES_DESCRIPTORS</code>
  140. is defined, and is otherwise unused.
  141. </p></dd></dl>
  142. <dl>
  143. <dt><a name="index-CONSTANT_005fPOOL_005fBEFORE_005fFUNCTION"></a>Macro: <strong>CONSTANT_POOL_BEFORE_FUNCTION</strong></dt>
  144. <dd><p>You may define this macro as a C expression. You should define the
  145. expression to have a nonzero value if GCC should output the constant
  146. pool for a function before the code for the function, or a zero value if
  147. GCC should output the constant pool after the function. If you do
  148. not define this macro, the usual case, GCC will output the constant
  149. pool before the function.
  150. </p></dd></dl>
  151. <dl>
  152. <dt><a name="index-ASM_005fOUTPUT_005fPOOL_005fPROLOGUE"></a>Macro: <strong>ASM_OUTPUT_POOL_PROLOGUE</strong> <em>(<var>file</var>, <var>funname</var>, <var>fundecl</var>, <var>size</var>)</em></dt>
  153. <dd><p>A C statement to output assembler commands to define the start of the
  154. constant pool for a function. <var>funname</var> is a string giving
  155. the name of the function. Should the return type of the function
  156. be required, it can be obtained via <var>fundecl</var>. <var>size</var>
  157. is the size, in bytes, of the constant pool that will be written
  158. immediately after this call.
  159. </p>
  160. <p>If no constant-pool prefix is required, the usual case, this macro need
  161. not be defined.
  162. </p></dd></dl>
  163. <dl>
  164. <dt><a name="index-ASM_005fOUTPUT_005fSPECIAL_005fPOOL_005fENTRY"></a>Macro: <strong>ASM_OUTPUT_SPECIAL_POOL_ENTRY</strong> <em>(<var>file</var>, <var>x</var>, <var>mode</var>, <var>align</var>, <var>labelno</var>, <var>jumpto</var>)</em></dt>
  165. <dd><p>A C statement (with or without semicolon) to output a constant in the
  166. constant pool, if it needs special treatment. (This macro need not do
  167. anything for RTL expressions that can be output normally.)
  168. </p>
  169. <p>The argument <var>file</var> is the standard I/O stream to output the
  170. assembler code on. <var>x</var> is the RTL expression for the constant to
  171. output, and <var>mode</var> is the machine mode (in case <var>x</var> is a
  172. &lsquo;<samp>const_int</samp>&rsquo;). <var>align</var> is the required alignment for the value
  173. <var>x</var>; you should output an assembler directive to force this much
  174. alignment.
  175. </p>
  176. <p>The argument <var>labelno</var> is a number to use in an internal label for
  177. the address of this pool entry. The definition of this macro is
  178. responsible for outputting the label definition at the proper place.
  179. Here is how to do this:
  180. </p>
  181. <div class="smallexample">
  182. <pre class="smallexample"><code>(*targetm.asm_out.internal_label)</code> (<var>file</var>, &quot;LC&quot;, <var>labelno</var>);
  183. </pre></div>
  184. <p>When you output a pool entry specially, you should end with a
  185. <code>goto</code> to the label <var>jumpto</var>. This will prevent the same pool
  186. entry from being output a second time in the usual manner.
  187. </p>
  188. <p>You need not define this macro if it would do nothing.
  189. </p></dd></dl>
  190. <dl>
  191. <dt><a name="index-ASM_005fOUTPUT_005fPOOL_005fEPILOGUE"></a>Macro: <strong>ASM_OUTPUT_POOL_EPILOGUE</strong> <em>(<var>file</var> <var>funname</var> <var>fundecl</var> <var>size</var>)</em></dt>
  192. <dd><p>A C statement to output assembler commands to at the end of the constant
  193. pool for a function. <var>funname</var> is a string giving the name of the
  194. function. Should the return type of the function be required, you can
  195. obtain it via <var>fundecl</var>. <var>size</var> is the size, in bytes, of the
  196. constant pool that GCC wrote immediately before this call.
  197. </p>
  198. <p>If no constant-pool epilogue is required, the usual case, you need not
  199. define this macro.
  200. </p></dd></dl>
  201. <dl>
  202. <dt><a name="index-IS_005fASM_005fLOGICAL_005fLINE_005fSEPARATOR"></a>Macro: <strong>IS_ASM_LOGICAL_LINE_SEPARATOR</strong> <em>(<var>C</var>, <var>STR</var>)</em></dt>
  203. <dd><p>Define this macro as a C expression which is nonzero if <var>C</var> is
  204. used as a logical line separator by the assembler. <var>STR</var> points
  205. to the position in the string where <var>C</var> was found; this can be used if
  206. a line separator uses multiple characters.
  207. </p>
  208. <p>If you do not define this macro, the default is that only
  209. the character &lsquo;<samp>;</samp>&rsquo; is treated as a logical line separator.
  210. </p></dd></dl>
  211. <dl>
  212. <dt><a name="index-TARGET_005fASM_005fOPEN_005fPAREN"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_OPEN_PAREN</strong></dt>
  213. <dt><a name="index-TARGET_005fASM_005fCLOSE_005fPAREN"></a>Target Hook: <em>const char *</em> <strong>TARGET_ASM_CLOSE_PAREN</strong></dt>
  214. <dd><p>These target hooks are C string constants, describing the syntax in the
  215. assembler for grouping arithmetic expressions. If not overridden, they
  216. default to normal parentheses, which is correct for most assemblers.
  217. </p></dd></dl>
  218. <p>These macros are provided by <samp>real.h</samp> for writing the definitions
  219. of <code>ASM_OUTPUT_DOUBLE</code> and the like:
  220. </p>
  221. <dl>
  222. <dt><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fSINGLE"></a>Macro: <strong>REAL_VALUE_TO_TARGET_SINGLE</strong> <em>(<var>x</var>, <var>l</var>)</em></dt>
  223. <dt><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDOUBLE"></a>Macro: <strong>REAL_VALUE_TO_TARGET_DOUBLE</strong> <em>(<var>x</var>, <var>l</var>)</em></dt>
  224. <dt><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fLONG_005fDOUBLE"></a>Macro: <strong>REAL_VALUE_TO_TARGET_LONG_DOUBLE</strong> <em>(<var>x</var>, <var>l</var>)</em></dt>
  225. <dt><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDECIMAL32"></a>Macro: <strong>REAL_VALUE_TO_TARGET_DECIMAL32</strong> <em>(<var>x</var>, <var>l</var>)</em></dt>
  226. <dt><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDECIMAL64"></a>Macro: <strong>REAL_VALUE_TO_TARGET_DECIMAL64</strong> <em>(<var>x</var>, <var>l</var>)</em></dt>
  227. <dt><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDECIMAL128"></a>Macro: <strong>REAL_VALUE_TO_TARGET_DECIMAL128</strong> <em>(<var>x</var>, <var>l</var>)</em></dt>
  228. <dd><p>These translate <var>x</var>, of type <code>REAL_VALUE_TYPE</code>, to the
  229. target&rsquo;s floating point representation, and store its bit pattern in
  230. the variable <var>l</var>. For <code>REAL_VALUE_TO_TARGET_SINGLE</code> and
  231. <code>REAL_VALUE_TO_TARGET_DECIMAL32</code>, this variable should be a
  232. simple <code>long int</code>. For the others, it should be an array of
  233. <code>long int</code>. The number of elements in this array is determined
  234. by the size of the desired target floating point data type: 32 bits of
  235. it go in each <code>long int</code> array element. Each array element holds
  236. 32 bits of the result, even if <code>long int</code> is wider than 32 bits
  237. on the host machine.
  238. </p>
  239. <p>The array element values are designed so that you can print them out
  240. using <code>fprintf</code> in the order they should appear in the target
  241. machine&rsquo;s memory.
  242. </p></dd></dl>
  243. <hr>
  244. <div class="header">
  245. <p>
  246. Next: <a href="Uninitialized-Data.html#Uninitialized-Data" accesskey="n" rel="next">Uninitialized Data</a>, Previous: <a href="File-Framework.html#File-Framework" accesskey="p" rel="prev">File Framework</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>
  247. </div>
  248. </body>
  249. </html>