Back-End.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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: Back End</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Back End">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Back End">
  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="gcc-Directory.html#gcc-Directory" rel="up" title="gcc Directory">
  30. <link href="Testsuites.html#Testsuites" rel="next" title="Testsuites">
  31. <link href="Front-End-Makefile.html#Front-End-Makefile" rel="prev" title="Front End Makefile">
  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="Back-End"></a>
  63. <div class="header">
  64. <p>
  65. Previous: <a href="Front-End.html#Front-End" accesskey="p" rel="prev">Front End</a>, Up: <a href="gcc-Directory.html#gcc-Directory" accesskey="u" rel="up">gcc Directory</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="Anatomy-of-a-Target-Back-End"></a>
  69. <h4 class="subsection">6.3.9 Anatomy of a Target Back End</h4>
  70. <p>A back end for a target architecture in GCC has the following parts:
  71. </p>
  72. <ul>
  73. <li> A directory <samp><var>machine</var></samp> under <samp>gcc/config</samp>, containing a
  74. machine description <samp><var>machine</var>.md</samp> file (see <a href="Machine-Desc.html#Machine-Desc">Machine Descriptions</a>), header files <samp><var>machine</var>.h</samp> and
  75. <samp><var>machine</var>-protos.h</samp> and a source file <samp><var>machine</var>.c</samp>
  76. (see <a href="Target-Macros.html#Target-Macros">Target Description Macros and Functions</a>),
  77. possibly a target Makefile fragment <samp>t-<var>machine</var></samp>
  78. (see <a href="Target-Fragment.html#Target-Fragment">The Target Makefile Fragment</a>), and maybe
  79. some other files. The names of these files may be changed from the
  80. defaults given by explicit specifications in <samp>config.gcc</samp>.
  81. </li><li> If necessary, a file <samp><var>machine</var>-modes.def</samp> in the
  82. <samp><var>machine</var></samp> directory, containing additional machine modes to
  83. represent condition codes. See <a href="Condition-Code.html#Condition-Code">Condition Code</a>, for further details.
  84. </li><li> An optional <samp><var>machine</var>.opt</samp> file in the <samp><var>machine</var></samp>
  85. directory, containing a list of target-specific options. You can also
  86. add other option files using the <code>extra_options</code> variable in
  87. <samp>config.gcc</samp>. See <a href="Options.html#Options">Options</a>.
  88. </li><li> Entries in <samp>config.gcc</samp> (see <a href="System-Config.html#System-Config">The
  89. <samp>config.gcc</samp> File</a>) for the systems with this target
  90. architecture.
  91. </li><li> Documentation in <samp>gcc/doc/invoke.texi</samp> for any command-line
  92. options supported by this target (see <a href="Run_002dtime-Target.html#Run_002dtime-Target">Run-time
  93. Target Specification</a>). This means both entries in the summary table
  94. of options and details of the individual options.
  95. </li><li> Documentation in <samp>gcc/doc/extend.texi</samp> for any target-specific
  96. attributes supported (see <a href="Target-Attributes.html#Target-Attributes">Defining
  97. target-specific uses of <code>__attribute__</code></a>), including where the
  98. same attribute is already supported on some targets, which are
  99. enumerated in the manual.
  100. </li><li> Documentation in <samp>gcc/doc/extend.texi</samp> for any target-specific
  101. pragmas supported.
  102. </li><li> Documentation in <samp>gcc/doc/extend.texi</samp> of any target-specific
  103. built-in functions supported.
  104. </li><li> Documentation in <samp>gcc/doc/extend.texi</samp> of any target-specific
  105. format checking styles supported.
  106. </li><li> Documentation in <samp>gcc/doc/md.texi</samp> of any target-specific
  107. constraint letters (see <a href="Machine-Constraints.html#Machine-Constraints">Constraints for
  108. Particular Machines</a>).
  109. </li><li> A note in <samp>gcc/doc/contrib.texi</samp> under the person or people who
  110. contributed the target support.
  111. </li><li> Entries in <samp>gcc/doc/install.texi</samp> for all target triplets
  112. supported with this target architecture, giving details of any special
  113. notes about installation for this target, or saying that there are no
  114. special notes if there are none.
  115. </li><li> Possibly other support outside the <samp>gcc</samp> directory for runtime
  116. libraries. FIXME: reference docs for this. The <code>libstdc++</code> porting
  117. manual needs to be installed as info for this to work, or to be a
  118. chapter of this manual.
  119. </li></ul>
  120. <p>If the back end is added to the official GCC source repository, the
  121. following are also necessary:
  122. </p>
  123. <ul>
  124. <li> An entry for the target architecture in <samp>readings.html</samp> on the
  125. GCC web site, with any relevant links.
  126. </li><li> Details of the properties of the back end and target architecture in
  127. <samp>backends.html</samp> on the GCC web site.
  128. </li><li> A news item about the contribution of support for that target
  129. architecture, in <samp>index.html</samp> on the GCC web site.
  130. </li><li> Normally, one or more maintainers of that target listed in
  131. <samp>MAINTAINERS</samp>. Some existing architectures may be unmaintained,
  132. but it would be unusual to add support for a target that does not have
  133. a maintainer when support is added.
  134. </li><li> Target triplets covering all <samp>config.gcc</samp> stanzas for the target,
  135. in the list in <samp>contrib/config-list.mk</samp>.
  136. </li></ul>
  137. <hr>
  138. <div class="header">
  139. <p>
  140. Previous: <a href="Front-End.html#Front-End" accesskey="p" rel="prev">Front End</a>, Up: <a href="gcc-Directory.html#gcc-Directory" accesskey="u" rel="up">gcc Directory</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>
  141. </div>
  142. </body>
  143. </html>