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.

172 line
12KB

  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>Target Macros (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Target Macros (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Target Macros (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="index.html#Top" rel="up" title="Top">
  30. <link href="Target-Structure.html#Target-Structure" rel="next" title="Target Structure">
  31. <link href="Parameterized-Names.html#Parameterized-Names" rel="prev" title="Parameterized Names">
  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="Target-Macros"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Host-Config.html#Host-Config" accesskey="n" rel="next">Host Config</a>, Previous: <a href="Machine-Desc.html#Machine-Desc" accesskey="p" rel="prev">Machine Desc</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</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="Target-Description-Macros-and-Functions"></a>
  68. <h2 class="chapter">18 Target Description Macros and Functions</h2>
  69. <a name="index-machine-description-macros"></a>
  70. <a name="index-target-description-macros"></a>
  71. <a name="index-macros_002c-target-description"></a>
  72. <a name="index-tm_002eh-macros"></a>
  73. <p>In addition to the file <samp><var>machine</var>.md</samp>, a machine description
  74. includes a C header file conventionally given the name
  75. <samp><var>machine</var>.h</samp> and a C source file named <samp><var>machine</var>.c</samp>.
  76. The header file defines numerous macros that convey the information
  77. about the target machine that does not fit into the scheme of the
  78. <samp>.md</samp> file. The file <samp>tm.h</samp> should be a link to
  79. <samp><var>machine</var>.h</samp>. The header file <samp>config.h</samp> includes
  80. <samp>tm.h</samp> and most compiler source files include <samp>config.h</samp>. The
  81. source file defines a variable <code>targetm</code>, which is a structure
  82. containing pointers to functions and data relating to the target
  83. machine. <samp><var>machine</var>.c</samp> should also contain their definitions,
  84. if they are not defined elsewhere in GCC, and other functions called
  85. through the macros defined in the <samp>.h</samp> file.
  86. </p>
  87. <table class="menu" border="0" cellspacing="0">
  88. <tr><td align="left" valign="top">&bull; <a href="Target-Structure.html#Target-Structure" accesskey="1">Target Structure</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The <code>targetm</code> variable.
  89. </td></tr>
  90. <tr><td align="left" valign="top">&bull; <a href="Driver.html#Driver" accesskey="2">Driver</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Controlling how the driver runs the compilation passes.
  91. </td></tr>
  92. <tr><td align="left" valign="top">&bull; <a href="Run_002dtime-Target.html#Run_002dtime-Target" accesskey="3">Run-time Target</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining &lsquo;<samp>-m</samp>&rsquo; options like <samp>-m68000</samp> and <samp>-m68020</samp>.
  93. </td></tr>
  94. <tr><td align="left" valign="top">&bull; <a href="Per_002dFunction-Data.html#Per_002dFunction-Data" accesskey="4">Per-Function Data</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining data structures for per-function information.
  95. </td></tr>
  96. <tr><td align="left" valign="top">&bull; <a href="Storage-Layout.html#Storage-Layout" accesskey="5">Storage Layout</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining sizes and alignments of data.
  97. </td></tr>
  98. <tr><td align="left" valign="top">&bull; <a href="Type-Layout.html#Type-Layout" accesskey="6">Type Layout</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining sizes and properties of basic user data types.
  99. </td></tr>
  100. <tr><td align="left" valign="top">&bull; <a href="Registers.html#Registers" accesskey="7">Registers</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Naming and describing the hardware registers.
  101. </td></tr>
  102. <tr><td align="left" valign="top">&bull; <a href="Register-Classes.html#Register-Classes" accesskey="8">Register Classes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining the classes of hardware registers.
  103. </td></tr>
  104. <tr><td align="left" valign="top">&bull; <a href="Stack-and-Calling.html#Stack-and-Calling" accesskey="9">Stack and Calling</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining which way the stack grows and by how much.
  105. </td></tr>
  106. <tr><td align="left" valign="top">&bull; <a href="Varargs.html#Varargs">Varargs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining the varargs macros.
  107. </td></tr>
  108. <tr><td align="left" valign="top">&bull; <a href="Trampolines.html#Trampolines">Trampolines</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Code set up at run time to enter a nested function.
  109. </td></tr>
  110. <tr><td align="left" valign="top">&bull; <a href="Library-Calls.html#Library-Calls">Library Calls</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Controlling how library routines are implicitly called.
  111. </td></tr>
  112. <tr><td align="left" valign="top">&bull; <a href="Addressing-Modes.html#Addressing-Modes">Addressing Modes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining addressing modes valid for memory operands.
  113. </td></tr>
  114. <tr><td align="left" valign="top">&bull; <a href="Anchored-Addresses.html#Anchored-Addresses">Anchored Addresses</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining how <samp>-fsection-anchors</samp> should work.
  115. </td></tr>
  116. <tr><td align="left" valign="top">&bull; <a href="Condition-Code.html#Condition-Code">Condition Code</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining how insns update the condition code.
  117. </td></tr>
  118. <tr><td align="left" valign="top">&bull; <a href="Costs.html#Costs">Costs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining relative costs of different operations.
  119. </td></tr>
  120. <tr><td align="left" valign="top">&bull; <a href="Scheduling.html#Scheduling">Scheduling</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Adjusting the behavior of the instruction scheduler.
  121. </td></tr>
  122. <tr><td align="left" valign="top">&bull; <a href="Sections.html#Sections">Sections</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Dividing storage into text, data, and other sections.
  123. </td></tr>
  124. <tr><td align="left" valign="top">&bull; <a href="PIC.html#PIC">PIC</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Macros for position independent code.
  125. </td></tr>
  126. <tr><td align="left" valign="top">&bull; <a href="Assembler-Format.html#Assembler-Format">Assembler Format</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining how to write insns and pseudo-ops to output.
  127. </td></tr>
  128. <tr><td align="left" valign="top">&bull; <a href="Debugging-Info.html#Debugging-Info">Debugging Info</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining the format of debugging output.
  129. </td></tr>
  130. <tr><td align="left" valign="top">&bull; <a href="Floating-Point.html#Floating-Point">Floating Point</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Handling floating point for cross-compilers.
  131. </td></tr>
  132. <tr><td align="left" valign="top">&bull; <a href="Mode-Switching.html#Mode-Switching">Mode Switching</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Insertion of mode-switching instructions.
  133. </td></tr>
  134. <tr><td align="left" valign="top">&bull; <a href="Target-Attributes.html#Target-Attributes">Target Attributes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Defining target-specific uses of <code>__attribute__</code>.
  135. </td></tr>
  136. <tr><td align="left" valign="top">&bull; <a href="Emulated-TLS.html#Emulated-TLS">Emulated TLS</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Emulated TLS support.
  137. </td></tr>
  138. <tr><td align="left" valign="top">&bull; <a href="MIPS-Coprocessors.html#MIPS-Coprocessors">MIPS Coprocessors</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">MIPS coprocessor support and how to customize it.
  139. </td></tr>
  140. <tr><td align="left" valign="top">&bull; <a href="PCH-Target.html#PCH-Target">PCH Target</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Validity checking for precompiled headers.
  141. </td></tr>
  142. <tr><td align="left" valign="top">&bull; <a href="C_002b_002b-ABI.html#C_002b_002b-ABI">C++ ABI</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Controlling C++ ABI changes.
  143. </td></tr>
  144. <tr><td align="left" valign="top">&bull; <a href="D-Language-and-ABI.html#D-Language-and-ABI">D Language and ABI</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Controlling D ABI changes.
  145. </td></tr>
  146. <tr><td align="left" valign="top">&bull; <a href="Named-Address-Spaces.html#Named-Address-Spaces">Named Address Spaces</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Adding support for named address spaces
  147. </td></tr>
  148. <tr><td align="left" valign="top">&bull; <a href="Misc.html#Misc">Misc</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Everything else.
  149. </td></tr>
  150. </table>
  151. <hr>
  152. <div class="header">
  153. <p>
  154. Next: <a href="Host-Config.html#Host-Config" accesskey="n" rel="next">Host Config</a>, Previous: <a href="Machine-Desc.html#Machine-Desc" accesskey="p" rel="prev">Machine Desc</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</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>
  155. </div>
  156. </body>
  157. </html>