mirror of
https://github.com/rtlduino/RTL8710AF_GCC.git
synced 2026-07-15 15:55:41 +00:00
motify compile link error
motify compile link error
This commit is contained in:
parent
923914edae
commit
03e74a8e50
5418 changed files with 1367914 additions and 206149 deletions
|
|
@ -0,0 +1,114 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Accessors - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="RTL-Classes.html#RTL-Classes" title="RTL Classes">
|
||||
<link rel="next" href="Special-Accessors.html#Special-Accessors" title="Special Accessors">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Accessors"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Special-Accessors.html#Special-Accessors">Special Accessors</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="RTL-Classes.html#RTL-Classes">RTL Classes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.3 Access to Operands</h3>
|
||||
|
||||
<p><a name="index-accessors-1716"></a><a name="index-access-to-operands-1717"></a><a name="index-operand-access-1718"></a>
|
||||
<a name="index-XEXP-1719"></a><a name="index-XINT-1720"></a><a name="index-XWINT-1721"></a><a name="index-XSTR-1722"></a>Operands of expressions are accessed using the macros <code>XEXP</code>,
|
||||
<code>XINT</code>, <code>XWINT</code> and <code>XSTR</code>. Each of these macros takes
|
||||
two arguments: an expression-pointer (RTX) and an operand number
|
||||
(counting from zero). Thus,
|
||||
|
||||
<pre class="smallexample"> XEXP (<var>x</var>, 2)
|
||||
</pre>
|
||||
<p class="noindent">accesses operand 2 of expression <var>x</var>, as an expression.
|
||||
|
||||
<pre class="smallexample"> XINT (<var>x</var>, 2)
|
||||
</pre>
|
||||
<p class="noindent">accesses the same operand as an integer. <code>XSTR</code>, used in the same
|
||||
fashion, would access it as a string.
|
||||
|
||||
<p>Any operand can be accessed as an integer, as an expression or as a string.
|
||||
You must choose the correct method of access for the kind of value actually
|
||||
stored in the operand. You would do this based on the expression code of
|
||||
the containing expression. That is also how you would know how many
|
||||
operands there are.
|
||||
|
||||
<p>For example, if <var>x</var> is a <code>subreg</code> expression, you know that it has
|
||||
two operands which can be correctly accessed as <code>XEXP (</code><var>x</var><code>, 0)</code>
|
||||
and <code>XINT (</code><var>x</var><code>, 1)</code>. If you did <code>XINT (</code><var>x</var><code>, 0)</code>, you
|
||||
would get the address of the expression operand but cast as an integer;
|
||||
that might occasionally be useful, but it would be cleaner to write
|
||||
<code>(int) XEXP (</code><var>x</var><code>, 0)</code>. <code>XEXP (</code><var>x</var><code>, 1)</code> would also
|
||||
compile without error, and would return the second, integer operand cast as
|
||||
an expression pointer, which would probably result in a crash when
|
||||
accessed. Nothing stops you from writing <code>XEXP (</code><var>x</var><code>, 28)</code> either,
|
||||
but this will access memory past the end of the expression with
|
||||
unpredictable results.
|
||||
|
||||
<p>Access to operands which are vectors is more complicated. You can use the
|
||||
macro <code>XVEC</code> to get the vector-pointer itself, or the macros
|
||||
<code>XVECEXP</code> and <code>XVECLEN</code> to access the elements and length of a
|
||||
vector.
|
||||
|
||||
|
||||
<a name="index-XVEC-1723"></a>
|
||||
<dl><dt><code>XVEC (</code><var>exp</var><code>, </code><var>idx</var><code>)</code><dd>Access the vector-pointer which is operand number <var>idx</var> in <var>exp</var>.
|
||||
|
||||
<p><a name="index-XVECLEN-1724"></a><br><dt><code>XVECLEN (</code><var>exp</var><code>, </code><var>idx</var><code>)</code><dd>Access the length (number of elements) in the vector which is
|
||||
in operand number <var>idx</var> in <var>exp</var>. This value is an <code>int</code>.
|
||||
|
||||
<p><a name="index-XVECEXP-1725"></a><br><dt><code>XVECEXP (</code><var>exp</var><code>, </code><var>idx</var><code>, </code><var>eltnum</var><code>)</code><dd>Access element number <var>eltnum</var> in the vector which is
|
||||
in operand number <var>idx</var> in <var>exp</var>. This value is an RTX.
|
||||
|
||||
<p>It is up to you to make sure that <var>eltnum</var> is not negative
|
||||
and is less than <code>XVECLEN (</code><var>exp</var><code>, </code><var>idx</var><code>)</code>.
|
||||
</dl>
|
||||
|
||||
<p>All the macros defined in this section expand into lvalues and therefore
|
||||
can be used to assign the operands, lengths and vector elements as well as
|
||||
to access them.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Ada Tests - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Testsuites.html#Testsuites" title="Testsuites">
|
||||
<link rel="prev" href="Test-Directives.html#Test-Directives" title="Test Directives">
|
||||
<link rel="next" href="C-Tests.html#C-Tests" title="C Tests">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Ada-Tests"></a>
|
||||
Next: <a rel="next" accesskey="n" href="C-Tests.html#C-Tests">C Tests</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Test-Directives.html#Test-Directives">Test Directives</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Testsuites.html#Testsuites">Testsuites</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">7.3 Ada Language Testsuites</h3>
|
||||
|
||||
<p>The Ada testsuite includes executable tests from the ACATS
|
||||
testsuite, publicly available at
|
||||
<a href="http://www.ada-auth.org/acats.html">http://www.ada-auth.org/acats.html</a>.
|
||||
|
||||
<p>These tests are integrated in the GCC testsuite in the
|
||||
<samp><span class="file">ada/acats</span></samp> directory, and
|
||||
enabled automatically when running <code>make check</code>, assuming
|
||||
the Ada language has been enabled when configuring GCC.
|
||||
|
||||
<p>You can also run the Ada testsuite independently, using
|
||||
<code>make check-ada</code>, or run a subset of the tests by specifying which
|
||||
chapter to run, e.g.:
|
||||
|
||||
<pre class="smallexample"> $ make check-ada CHAPTERS="c3 c9"
|
||||
</pre>
|
||||
<p>The tests are organized by directory, each directory corresponding to
|
||||
a chapter of the Ada Reference Manual. So for example, <samp><span class="file">c9</span></samp> corresponds
|
||||
to chapter 9, which deals with tasking features of the language.
|
||||
|
||||
<p>There is also an extra chapter called <samp><span class="file">gcc</span></samp> containing a template for
|
||||
creating new executable tests, although this is deprecated in favor of
|
||||
the <samp><span class="file">gnat.dg</span></samp> testsuite.
|
||||
|
||||
<p>The tests are run using two <samp><span class="command">sh</span></samp> scripts: <samp><span class="file">run_acats</span></samp> and
|
||||
<samp><span class="file">run_all.sh</span></samp>. To run the tests using a simulator or a cross
|
||||
target, see the small
|
||||
customization section at the top of <samp><span class="file">run_all.sh</span></samp>.
|
||||
|
||||
<p>These tests are run using the build tree: they can be run without doing
|
||||
a <code>make install</code>.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Add Options - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Test-Directives.html#Test-Directives" title="Test Directives">
|
||||
<link rel="prev" href="Effective_002dTarget-Keywords.html#Effective_002dTarget-Keywords" title="Effective-Target Keywords">
|
||||
<link rel="next" href="Require-Support.html#Require-Support" title="Require Support">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Add-Options"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Require-Support.html#Require-Support">Require Support</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Effective_002dTarget-Keywords.html#Effective_002dTarget-Keywords">Effective-Target Keywords</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Test-Directives.html#Test-Directives">Test Directives</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">7.2.4 Features for <code>dg-add-options</code></h4>
|
||||
|
||||
<p>The supported values of <var>feature</var> for directive <code>dg-add-options</code>
|
||||
are:
|
||||
|
||||
<dl>
|
||||
<dt><code>arm_neon</code><dd>NEON support. Only ARM targets support this feature, and only then
|
||||
in certain modes; see the <a href="arm_005fneon_005fok.html#arm_005fneon_005fok">arm_neon_ok effective target keyword</a>.
|
||||
|
||||
<br><dt><code>arm_neon_fp16</code><dd>NEON and half-precision floating point support. Only ARM targets
|
||||
support this feature, and only then in certain modes; see
|
||||
the <a href="arm_005fneon_005fok.html#arm_005fneon_005fok">arm_neon_fp16_ok effective target keyword</a>.
|
||||
|
||||
<br><dt><code>bind_pic_locally</code><dd>Add the target-specific flags needed to enable functions to bind
|
||||
locally when using pic/PIC passes in the testsuite.
|
||||
|
||||
<br><dt><code>c99_runtime</code><dd>Add the target-specific flags needed to access the C99 runtime.
|
||||
|
||||
<br><dt><code>ieee</code><dd>Add the target-specific flags needed to enable full IEEE
|
||||
compliance mode.
|
||||
|
||||
<br><dt><code>mips16_attribute</code><dd><code>mips16</code> function attributes.
|
||||
Only MIPS targets support this feature, and only then in certain modes.
|
||||
|
||||
<br><dt><code>tls</code><dd>Add the target-specific flags needed to use thread-local storage.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Adding a new GIMPLE statement code - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="GIMPLE.html#GIMPLE" title="GIMPLE">
|
||||
<link rel="prev" href="Sequence-iterators.html#Sequence-iterators" title="Sequence iterators">
|
||||
<link rel="next" href="Statement-and-operand-traversals.html#Statement-and-operand-traversals" title="Statement and operand traversals">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Adding-a-new-GIMPLE-statement-code"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Statement-and-operand-traversals.html#Statement-and-operand-traversals">Statement and operand traversals</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Sequence-iterators.html#Sequence-iterators">Sequence iterators</a>,
|
||||
Up: <a rel="up" accesskey="u" href="GIMPLE.html#GIMPLE">GIMPLE</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">12.10 Adding a new GIMPLE statement code</h3>
|
||||
|
||||
<p><a name="index-Adding-a-new-GIMPLE-statement-code-3072"></a>
|
||||
The first step in adding a new GIMPLE statement code, is
|
||||
modifying the file <code>gimple.def</code>, which contains all the GIMPLE
|
||||
codes. Then you must add a corresponding structure, and an entry
|
||||
in <code>union gimple_statement_d</code>, both of which are located in
|
||||
<code>gimple.h</code>. This in turn, will require you to add a corresponding
|
||||
<code>GTY</code> tag in <code>gsstruct.def</code>, and code to handle this tag in
|
||||
<code>gss_for_code</code> which is located in <code>gimple.c</code>.
|
||||
|
||||
<p>In order for the garbage collector to know the size of the
|
||||
structure you created in <code>gimple.h</code>, you need to add a case to
|
||||
handle your new GIMPLE statement in <code>gimple_size</code> which is located
|
||||
in <code>gimple.c</code>.
|
||||
|
||||
<p>You will probably want to create a function to build the new
|
||||
gimple statement in <code>gimple.c</code>. The function should be called
|
||||
<code>gimple_build_</code><var>new-tuple-name</var>, and should return the new tuple
|
||||
of type gimple.
|
||||
|
||||
<p>If your new statement requires accessors for any members or
|
||||
operands it may have, put simple inline accessors in
|
||||
<code>gimple.h</code> and any non-trivial accessors in <code>gimple.c</code> with a
|
||||
corresponding prototype in <code>gimple.h</code>.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Adding new DECL node types - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Internal-structure.html#Internal-structure" title="Internal structure">
|
||||
<link rel="prev" href="Current-structure-hierarchy.html#Current-structure-hierarchy" title="Current structure hierarchy">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Adding-new-DECL-node-types"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Current-structure-hierarchy.html#Current-structure-hierarchy">Current structure hierarchy</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Internal-structure.html#Internal-structure">Internal structure</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h5 class="subsubsection">11.4.2.2 Adding new DECL node types</h5>
|
||||
|
||||
<p>Adding a new <code>DECL</code> tree consists of the following steps
|
||||
|
||||
<dl>
|
||||
<dt>Add a new tree code for the <code>DECL</code> node<dd>For language specific <code>DECL</code> nodes, there is a <samp><span class="file">.def</span></samp> file
|
||||
in each frontend directory where the tree code should be added.
|
||||
For <code>DECL</code> nodes that are part of the middle-end, the code should
|
||||
be added to <samp><span class="file">tree.def</span></samp>.
|
||||
|
||||
<br><dt>Create a new structure type for the <code>DECL</code> node<dd>These structures should inherit from one of the existing structures in
|
||||
the language hierarchy by using that structure as the first member.
|
||||
|
||||
<pre class="smallexample"> struct tree_foo_decl
|
||||
{
|
||||
struct tree_decl_with_vis common;
|
||||
}
|
||||
</pre>
|
||||
<p>Would create a structure name <code>tree_foo_decl</code> that inherits from
|
||||
<code>struct tree_decl_with_vis</code>.
|
||||
|
||||
<p>For language specific <code>DECL</code> nodes, this new structure type
|
||||
should go in the appropriate <samp><span class="file">.h</span></samp> file.
|
||||
For <code>DECL</code> nodes that are part of the middle-end, the structure
|
||||
type should go in <samp><span class="file">tree.h</span></samp>.
|
||||
|
||||
<br><dt>Add a member to the tree structure enumerator for the node<dd>For garbage collection and dynamic checking purposes, each <code>DECL</code>
|
||||
node structure type is required to have a unique enumerator value
|
||||
specified with it.
|
||||
For language specific <code>DECL</code> nodes, this new enumerator value
|
||||
should go in the appropriate <samp><span class="file">.def</span></samp> file.
|
||||
For <code>DECL</code> nodes that are part of the middle-end, the enumerator
|
||||
values are specified in <samp><span class="file">treestruct.def</span></samp>.
|
||||
|
||||
<br><dt>Update <code>union tree_node</code><dd>In order to make your new structure type usable, it must be added to
|
||||
<code>union tree_node</code>.
|
||||
For language specific <code>DECL</code> nodes, a new entry should be added
|
||||
to the appropriate <samp><span class="file">.h</span></samp> file of the form
|
||||
<pre class="smallexample"> struct tree_foo_decl GTY ((tag ("TS_VAR_DECL"))) foo_decl;
|
||||
</pre>
|
||||
<p>For <code>DECL</code> nodes that are part of the middle-end, the additional
|
||||
member goes directly into <code>union tree_node</code> in <samp><span class="file">tree.h</span></samp>.
|
||||
|
||||
<br><dt>Update dynamic checking info<dd>In order to be able to check whether accessing a named portion of
|
||||
<code>union tree_node</code> is legal, and whether a certain <code>DECL</code> node
|
||||
contains one of the enumerated <code>DECL</code> node structures in the
|
||||
hierarchy, a simple lookup table is used.
|
||||
This lookup table needs to be kept up to date with the tree structure
|
||||
hierarchy, or else checking and containment macros will fail
|
||||
inappropriately.
|
||||
|
||||
<p>For language specific <code>DECL</code> nodes, their is an <code>init_ts</code>
|
||||
function in an appropriate <samp><span class="file">.c</span></samp> file, which initializes the lookup
|
||||
table.
|
||||
Code setting up the table for new <code>DECL</code> nodes should be added
|
||||
there.
|
||||
For each <code>DECL</code> tree code and enumerator value representing a
|
||||
member of the inheritance hierarchy, the table should contain 1 if
|
||||
that tree code inherits (directly or indirectly) from that member.
|
||||
Thus, a <code>FOO_DECL</code> node derived from <code>struct decl_with_rtl</code>,
|
||||
and enumerator value <code>TS_FOO_DECL</code>, would be set up as follows
|
||||
<pre class="smallexample"> tree_contains_struct[FOO_DECL][TS_FOO_DECL] = 1;
|
||||
tree_contains_struct[FOO_DECL][TS_DECL_WRTL] = 1;
|
||||
tree_contains_struct[FOO_DECL][TS_DECL_COMMON] = 1;
|
||||
tree_contains_struct[FOO_DECL][TS_DECL_MINIMAL] = 1;
|
||||
</pre>
|
||||
<p>For <code>DECL</code> nodes that are part of the middle-end, the setup code
|
||||
goes into <samp><span class="file">tree.c</span></samp>.
|
||||
|
||||
<br><dt>Add macros to access any new fields and flags<dd>
|
||||
Each added field or flag should have a macro that is used to access
|
||||
it, that performs appropriate checking to ensure only the right type of
|
||||
<code>DECL</code> nodes access the field.
|
||||
|
||||
<p>These macros generally take the following form
|
||||
<pre class="smallexample"> #define FOO_DECL_FIELDNAME(NODE) FOO_DECL_CHECK(NODE)->foo_decl.fieldname
|
||||
</pre>
|
||||
<p>However, if the structure is simply a base class for further
|
||||
structures, something like the following should be used
|
||||
<pre class="smallexample"> #define BASE_STRUCT_CHECK(T) CONTAINS_STRUCT_CHECK(T, TS_BASE_STRUCT)
|
||||
#define BASE_STRUCT_FIELDNAME(NODE) \
|
||||
(BASE_STRUCT_CHECK(NODE)->base_struct.fieldname
|
||||
</pre>
|
||||
</dl>
|
||||
|
||||
<!-- -->
|
||||
<!-- Attributes -->
|
||||
<!-- -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,488 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Addressing Modes - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="Library-Calls.html#Library-Calls" title="Library Calls">
|
||||
<link rel="next" href="Anchored-Addresses.html#Anchored-Addresses" title="Anchored Addresses">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Addressing-Modes"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Anchored-Addresses.html#Anchored-Addresses">Anchored Addresses</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Library-Calls.html#Library-Calls">Library Calls</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.14 Addressing Modes</h3>
|
||||
|
||||
<p><a name="index-addressing-modes-4313"></a>
|
||||
<!-- prevent bad page break with this line -->
|
||||
This is about addressing modes.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>HAVE_PRE_INCREMENT</b><var><a name="index-HAVE_005fPRE_005fINCREMENT-4314"></a></var><br>
|
||||
— Macro: <b>HAVE_PRE_DECREMENT</b><var><a name="index-HAVE_005fPRE_005fDECREMENT-4315"></a></var><br>
|
||||
— Macro: <b>HAVE_POST_INCREMENT</b><var><a name="index-HAVE_005fPOST_005fINCREMENT-4316"></a></var><br>
|
||||
— Macro: <b>HAVE_POST_DECREMENT</b><var><a name="index-HAVE_005fPOST_005fDECREMENT-4317"></a></var><br>
|
||||
<blockquote><p>A C expression that is nonzero if the machine supports pre-increment,
|
||||
pre-decrement, post-increment, or post-decrement addressing respectively.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>HAVE_PRE_MODIFY_DISP</b><var><a name="index-HAVE_005fPRE_005fMODIFY_005fDISP-4318"></a></var><br>
|
||||
— Macro: <b>HAVE_POST_MODIFY_DISP</b><var><a name="index-HAVE_005fPOST_005fMODIFY_005fDISP-4319"></a></var><br>
|
||||
<blockquote><p>A C expression that is nonzero if the machine supports pre- or
|
||||
post-address side-effect generation involving constants other than
|
||||
the size of the memory operand.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>HAVE_PRE_MODIFY_REG</b><var><a name="index-HAVE_005fPRE_005fMODIFY_005fREG-4320"></a></var><br>
|
||||
— Macro: <b>HAVE_POST_MODIFY_REG</b><var><a name="index-HAVE_005fPOST_005fMODIFY_005fREG-4321"></a></var><br>
|
||||
<blockquote><p>A C expression that is nonzero if the machine supports pre- or
|
||||
post-address side-effect generation involving a register displacement.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CONSTANT_ADDRESS_P</b> (<var>x</var>)<var><a name="index-CONSTANT_005fADDRESS_005fP-4322"></a></var><br>
|
||||
<blockquote><p>A C expression that is 1 if the RTX <var>x</var> is a constant which
|
||||
is a valid address. On most machines the default definition of
|
||||
<code>(CONSTANT_P (</code><var>x</var><code>) && GET_CODE (</code><var>x</var><code>) != CONST_DOUBLE)</code>
|
||||
is acceptable, but a few machines are more restrictive as to which
|
||||
constant addresses are supported.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CONSTANT_P</b> (<var>x</var>)<var><a name="index-CONSTANT_005fP-4323"></a></var><br>
|
||||
<blockquote><p><code>CONSTANT_P</code>, which is defined by target-independent code,
|
||||
accepts integer-values expressions whose values are not explicitly
|
||||
known, such as <code>symbol_ref</code>, <code>label_ref</code>, and <code>high</code>
|
||||
expressions and <code>const</code> arithmetic expressions, in addition to
|
||||
<code>const_int</code> and <code>const_double</code> expressions.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MAX_REGS_PER_ADDRESS</b><var><a name="index-MAX_005fREGS_005fPER_005fADDRESS-4324"></a></var><br>
|
||||
<blockquote><p>A number, the maximum number of registers that can appear in a valid
|
||||
memory address. Note that it is up to you to specify a value equal to
|
||||
the maximum number that <code>TARGET_LEGITIMATE_ADDRESS_P</code> would ever
|
||||
accept.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_LEGITIMATE_ADDRESS_P</b> (<var>enum machine_mode mode, rtx x, bool strict</var>)<var><a name="index-TARGET_005fLEGITIMATE_005fADDRESS_005fP-4325"></a></var><br>
|
||||
<blockquote><p>A function that returns whether <var>x</var> (an RTX) is a legitimate memory
|
||||
address on the target machine for a memory operand of mode <var>mode</var>.
|
||||
|
||||
<p>Legitimate addresses are defined in two variants: a strict variant and a
|
||||
non-strict one. The <var>strict</var> parameter chooses which variant is
|
||||
desired by the caller.
|
||||
|
||||
<p>The strict variant is used in the reload pass. It must be defined so
|
||||
that any pseudo-register that has not been allocated a hard register is
|
||||
considered a memory reference. This is because in contexts where some
|
||||
kind of register is required, a pseudo-register with no hard register
|
||||
must be rejected. For non-hard registers, the strict variant should look
|
||||
up the <code>reg_renumber</code> array; it should then proceed using the hard
|
||||
register number in the array, or treat the pseudo as a memory reference
|
||||
if the array holds <code>-1</code>.
|
||||
|
||||
<p>The non-strict variant is used in other passes. It must be defined to
|
||||
accept all pseudo-registers in every context where some kind of
|
||||
register is required.
|
||||
|
||||
<p>Normally, constant addresses which are the sum of a <code>symbol_ref</code>
|
||||
and an integer are stored inside a <code>const</code> RTX to mark them as
|
||||
constant. Therefore, there is no need to recognize such sums
|
||||
specifically as legitimate addresses. Normally you would simply
|
||||
recognize any <code>const</code> as legitimate.
|
||||
|
||||
<p>Usually <code>PRINT_OPERAND_ADDRESS</code> is not prepared to handle constant
|
||||
sums that are not marked with <code>const</code>. It assumes that a naked
|
||||
<code>plus</code> indicates indexing. If so, then you <em>must</em> reject such
|
||||
naked constant sums as illegitimate addresses, so that none of them will
|
||||
be given to <code>PRINT_OPERAND_ADDRESS</code>.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bTARGET_005fENCODE_005fSECTION_005fINFO_007d-and-address-validation-4326"></a>On some machines, whether a symbolic address is legitimate depends on
|
||||
the section that the address refers to. On these machines, define the
|
||||
target hook <code>TARGET_ENCODE_SECTION_INFO</code> to store the information
|
||||
into the <code>symbol_ref</code>, and then check for it here. When you see a
|
||||
<code>const</code>, you will have to look inside it to find the
|
||||
<code>symbol_ref</code> in order to determine the section. See <a href="Assembler-Format.html#Assembler-Format">Assembler Format</a>.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bGO_005fIF_005fLEGITIMATE_005fADDRESS_007d-4327"></a>Some ports are still using a deprecated legacy substitute for
|
||||
this hook, the <code>GO_IF_LEGITIMATE_ADDRESS</code> macro. This macro
|
||||
has this syntax:
|
||||
|
||||
<pre class="example"> #define GO_IF_LEGITIMATE_ADDRESS (<var>mode</var>, <var>x</var>, <var>label</var>)
|
||||
</pre>
|
||||
<p class="noindent">and should <code>goto </code><var>label</var> if the address <var>x</var> is a valid
|
||||
address on the target machine for a memory operand of mode <var>mode</var>.
|
||||
|
||||
<p><a name="index-REG_005fOK_005fSTRICT-4328"></a>Compiler source files that want to use the strict variant of this
|
||||
macro define the macro <code>REG_OK_STRICT</code>. You should use an
|
||||
<code>#ifdef REG_OK_STRICT</code> conditional to define the strict variant in
|
||||
that case and the non-strict variant otherwise.
|
||||
|
||||
<p>Using the hook is usually simpler because it limits the number of
|
||||
files that are recompiled when changes are made.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>TARGET_MEM_CONSTRAINT</b><var><a name="index-TARGET_005fMEM_005fCONSTRAINT-4329"></a></var><br>
|
||||
<blockquote><p>A single character to be used instead of the default <code>'m'</code>
|
||||
character for general memory addresses. This defines the constraint
|
||||
letter which matches the memory addresses accepted by
|
||||
<code>TARGET_LEGITIMATE_ADDRESS_P</code>. Define this macro if you want to
|
||||
support new address formats in your back end without changing the
|
||||
semantics of the <code>'m'</code> constraint. This is necessary in order to
|
||||
preserve functionality of inline assembly constructs using the
|
||||
<code>'m'</code> constraint.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>FIND_BASE_TERM</b> (<var>x</var>)<var><a name="index-FIND_005fBASE_005fTERM-4330"></a></var><br>
|
||||
<blockquote><p>A C expression to determine the base term of address <var>x</var>,
|
||||
or to provide a simplified version of <var>x</var> from which <samp><span class="file">alias.c</span></samp>
|
||||
can easily find the base term. This macro is used in only two places:
|
||||
<code>find_base_value</code> and <code>find_base_term</code> in <samp><span class="file">alias.c</span></samp>.
|
||||
|
||||
<p>It is always safe for this macro to not be defined. It exists so
|
||||
that alias analysis can understand machine-dependent addresses.
|
||||
|
||||
<p>The typical use of this macro is to handle addresses containing
|
||||
a label_ref or symbol_ref within an UNSPEC.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: rtx <b>TARGET_LEGITIMIZE_ADDRESS</b> (<var>rtx x, rtx oldx, enum machine_mode mode</var>)<var><a name="index-TARGET_005fLEGITIMIZE_005fADDRESS-4331"></a></var><br>
|
||||
<blockquote><p>This hook is given an invalid memory address <var>x</var> for an
|
||||
operand of mode <var>mode</var> and should try to return a valid memory
|
||||
address.
|
||||
|
||||
<p><a name="index-break_005fout_005fmemory_005frefs-4332"></a><var>x</var> will always be the result of a call to <code>break_out_memory_refs</code>,
|
||||
and <var>oldx</var> will be the operand that was given to that function to produce
|
||||
<var>x</var>.
|
||||
|
||||
<p>The code of the hook should not alter the substructure of
|
||||
<var>x</var>. If it transforms <var>x</var> into a more legitimate form, it
|
||||
should return the new <var>x</var>.
|
||||
|
||||
<p>It is not necessary for this hook to come up with a legitimate address,
|
||||
with the exception of native TLS addresses (see <a href="Emulated-TLS.html#Emulated-TLS">Emulated TLS</a>).
|
||||
The compiler has standard ways of doing so in all cases. In fact, if
|
||||
the target supports only emulated TLS, it
|
||||
is safe to omit this hook or make it return <var>x</var> if it cannot find
|
||||
a valid way to legitimize the address. But often a machine-dependent
|
||||
strategy can generate better code.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LEGITIMIZE_RELOAD_ADDRESS</b> (<var>x, mode, opnum, type, ind_levels, win</var>)<var><a name="index-LEGITIMIZE_005fRELOAD_005fADDRESS-4333"></a></var><br>
|
||||
<blockquote><p>A C compound statement that attempts to replace <var>x</var>, which is an address
|
||||
that needs reloading, with a valid memory address for an operand of mode
|
||||
<var>mode</var>. <var>win</var> will be a C statement label elsewhere in the code.
|
||||
It is not necessary to define this macro, but it might be useful for
|
||||
performance reasons.
|
||||
|
||||
<p>For example, on the i386, it is sometimes possible to use a single
|
||||
reload register instead of two by reloading a sum of two pseudo
|
||||
registers into a register. On the other hand, for number of RISC
|
||||
processors offsets are limited so that often an intermediate address
|
||||
needs to be generated in order to address a stack slot. By defining
|
||||
<code>LEGITIMIZE_RELOAD_ADDRESS</code> appropriately, the intermediate addresses
|
||||
generated for adjacent some stack slots can be made identical, and thus
|
||||
be shared.
|
||||
|
||||
<p><em>Note</em>: This macro should be used with caution. It is necessary
|
||||
to know something of how reload works in order to effectively use this,
|
||||
and it is quite easy to produce macros that build in too much knowledge
|
||||
of reload internals.
|
||||
|
||||
<p><em>Note</em>: This macro must be able to reload an address created by a
|
||||
previous invocation of this macro. If it fails to handle such addresses
|
||||
then the compiler may generate incorrect code or abort.
|
||||
|
||||
<p><a name="index-push_005freload-4334"></a>The macro definition should use <code>push_reload</code> to indicate parts that
|
||||
need reloading; <var>opnum</var>, <var>type</var> and <var>ind_levels</var> are usually
|
||||
suitable to be passed unaltered to <code>push_reload</code>.
|
||||
|
||||
<p>The code generated by this macro must not alter the substructure of
|
||||
<var>x</var>. If it transforms <var>x</var> into a more legitimate form, it
|
||||
should assign <var>x</var> (which will always be a C variable) a new value.
|
||||
This also applies to parts that you change indirectly by calling
|
||||
<code>push_reload</code>.
|
||||
|
||||
<p><a name="index-strict_005fmemory_005faddress_005fp-4335"></a>The macro definition may use <code>strict_memory_address_p</code> to test if
|
||||
the address has become legitimate.
|
||||
|
||||
<p><a name="index-copy_005frtx-4336"></a>If you want to change only a part of <var>x</var>, one standard way of doing
|
||||
this is to use <code>copy_rtx</code>. Note, however, that it unshares only a
|
||||
single level of rtl. Thus, if the part to be changed is not at the
|
||||
top level, you'll need to replace first the top level.
|
||||
It is not necessary for this macro to come up with a legitimate
|
||||
address; but often a machine-dependent strategy can generate better code.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_MODE_DEPENDENT_ADDRESS_P</b> (<var>const_rtx addr, addr_space_t addrspace</var>)<var><a name="index-TARGET_005fMODE_005fDEPENDENT_005fADDRESS_005fP-4337"></a></var><br>
|
||||
<blockquote><p>This hook returns <code>true</code> if memory address <var>addr</var> in address
|
||||
space <var>addrspace</var> can have
|
||||
different meanings depending on the machine mode of the memory
|
||||
reference it is used for or if the address is valid for some modes
|
||||
but not others.
|
||||
|
||||
<p>Autoincrement and autodecrement addresses typically have mode-dependent
|
||||
effects because the amount of the increment or decrement is the size
|
||||
of the operand being addressed. Some machines have other mode-dependent
|
||||
addresses. Many RISC machines have no mode-dependent addresses.
|
||||
|
||||
<p>You may assume that <var>addr</var> is a valid address for the machine.
|
||||
|
||||
<p>The default version of this hook returns <code>false</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_LEGITIMATE_CONSTANT_P</b> (<var>enum machine_mode mode, rtx x</var>)<var><a name="index-TARGET_005fLEGITIMATE_005fCONSTANT_005fP-4338"></a></var><br>
|
||||
<blockquote><p>This hook returns true if <var>x</var> is a legitimate constant for a
|
||||
<var>mode</var>-mode immediate operand on the target machine. You can assume that
|
||||
<var>x</var> satisfies <code>CONSTANT_P</code>, so you need not check this.
|
||||
|
||||
<p>The default definition returns true.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: rtx <b>TARGET_DELEGITIMIZE_ADDRESS</b> (<var>rtx x</var>)<var><a name="index-TARGET_005fDELEGITIMIZE_005fADDRESS-4339"></a></var><br>
|
||||
<blockquote><p>This hook is used to undo the possibly obfuscating effects of the
|
||||
<code>LEGITIMIZE_ADDRESS</code> and <code>LEGITIMIZE_RELOAD_ADDRESS</code> target
|
||||
macros. Some backend implementations of these macros wrap symbol
|
||||
references inside an <code>UNSPEC</code> rtx to represent PIC or similar
|
||||
addressing modes. This target hook allows GCC's optimizers to understand
|
||||
the semantics of these opaque <code>UNSPEC</code>s by converting them back
|
||||
into their original form.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CONST_NOT_OK_FOR_DEBUG_P</b> (<var>rtx x</var>)<var><a name="index-TARGET_005fCONST_005fNOT_005fOK_005fFOR_005fDEBUG_005fP-4340"></a></var><br>
|
||||
<blockquote><p>This hook should return true if <var>x</var> should not be emitted into
|
||||
debug sections.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CANNOT_FORCE_CONST_MEM</b> (<var>enum machine_mode mode, rtx x</var>)<var><a name="index-TARGET_005fCANNOT_005fFORCE_005fCONST_005fMEM-4341"></a></var><br>
|
||||
<blockquote><p>This hook should return true if <var>x</var> is of a form that cannot (or
|
||||
should not) be spilled to the constant pool. <var>mode</var> is the mode
|
||||
of <var>x</var>.
|
||||
|
||||
<p>The default version of this hook returns false.
|
||||
|
||||
<p>The primary reason to define this hook is to prevent reload from
|
||||
deciding that a non-legitimate constant would be better reloaded
|
||||
from the constant pool instead of spilling and reloading a register
|
||||
holding the constant. This restriction is often true of addresses
|
||||
of TLS symbols for various targets.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_USE_BLOCKS_FOR_CONSTANT_P</b> (<var>enum machine_mode mode, const_rtx x</var>)<var><a name="index-TARGET_005fUSE_005fBLOCKS_005fFOR_005fCONSTANT_005fP-4342"></a></var><br>
|
||||
<blockquote><p>This hook should return true if pool entries for constant <var>x</var> can
|
||||
be placed in an <code>object_block</code> structure. <var>mode</var> is the mode
|
||||
of <var>x</var>.
|
||||
|
||||
<p>The default version returns false for all constants.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_USE_BLOCKS_FOR_DECL_P</b> (<var>const_tree decl</var>)<var><a name="index-TARGET_005fUSE_005fBLOCKS_005fFOR_005fDECL_005fP-4343"></a></var><br>
|
||||
<blockquote><p>This hook should return true if pool entries for <var>decl</var> should
|
||||
be placed in an <code>object_block</code> structure.
|
||||
|
||||
<p>The default version returns true for all decls.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_BUILTIN_RECIPROCAL</b> (<var>unsigned fn, bool md_fn, bool sqrt</var>)<var><a name="index-TARGET_005fBUILTIN_005fRECIPROCAL-4344"></a></var><br>
|
||||
<blockquote><p>This hook should return the DECL of a function that implements reciprocal of
|
||||
the builtin function with builtin function code <var>fn</var>, or
|
||||
<code>NULL_TREE</code> if such a function is not available. <var>md_fn</var> is true
|
||||
when <var>fn</var> is a code of a machine-dependent builtin function. When
|
||||
<var>sqrt</var> is true, additional optimizations that apply only to the reciprocal
|
||||
of a square root function are performed, and only reciprocals of <code>sqrt</code>
|
||||
function are valid.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD</b> (<var>void</var>)<var><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fMASK_005fFOR_005fLOAD-4345"></a></var><br>
|
||||
<blockquote><p>This hook should return the DECL of a function <var>f</var> that given an
|
||||
address <var>addr</var> as an argument returns a mask <var>m</var> that can be
|
||||
used to extract from two vectors the relevant data that resides in
|
||||
<var>addr</var> in case <var>addr</var> is not properly aligned.
|
||||
|
||||
<p>The autovectorizer, when vectorizing a load operation from an address
|
||||
<var>addr</var> that may be unaligned, will generate two vector loads from
|
||||
the two aligned addresses around <var>addr</var>. It then generates a
|
||||
<code>REALIGN_LOAD</code> operation to extract the relevant data from the
|
||||
two loaded vectors. The first two arguments to <code>REALIGN_LOAD</code>,
|
||||
<var>v1</var> and <var>v2</var>, are the two vectors, each of size <var>VS</var>, and
|
||||
the third argument, <var>OFF</var>, defines how the data will be extracted
|
||||
from these two vectors: if <var>OFF</var> is 0, then the returned vector is
|
||||
<var>v2</var>; otherwise, the returned vector is composed from the last
|
||||
<var>VS</var>-<var>OFF</var> elements of <var>v1</var> concatenated to the first
|
||||
<var>OFF</var> elements of <var>v2</var>.
|
||||
|
||||
<p>If this hook is defined, the autovectorizer will generate a call
|
||||
to <var>f</var> (using the DECL tree that this hook returns) and will
|
||||
use the return value of <var>f</var> as the argument <var>OFF</var> to
|
||||
<code>REALIGN_LOAD</code>. Therefore, the mask <var>m</var> returned by <var>f</var>
|
||||
should comply with the semantics expected by <code>REALIGN_LOAD</code>
|
||||
described above.
|
||||
If this hook is not defined, then <var>addr</var> will be used as
|
||||
the argument <var>OFF</var> to <code>REALIGN_LOAD</code>, in which case the low
|
||||
log2(<var>VS</var>) − 1 bits of <var>addr</var> will be considered.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST</b> (<var>enum vect_cost_for_stmt type_of_cost, tree vectype, int misalign</var>)<var><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fVECTORIZATION_005fCOST-4346"></a></var><br>
|
||||
<blockquote><p>Returns cost of different scalar or vector statements for vectorization cost model.
|
||||
For vector memory operations the cost may depend on type (<var>vectype</var>) and
|
||||
misalignment value (<var>misalign</var>).
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE</b> (<var>const_tree type, bool is_packed</var>)<var><a name="index-TARGET_005fVECTORIZE_005fVECTOR_005fALIGNMENT_005fREACHABLE-4347"></a></var><br>
|
||||
<blockquote><p>Return true if vector alignment is reachable (by peeling N iterations) for the given type.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_VECTORIZE_VEC_PERM_CONST_OK</b> (<var>enum machine_mode, const unsigned char *sel</var>)<var><a name="index-TARGET_005fVECTORIZE_005fVEC_005fPERM_005fCONST_005fOK-4348"></a></var><br>
|
||||
<blockquote><p>Return true if a vector created for <code>vec_perm_const</code> is valid.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_VECTORIZE_BUILTIN_CONVERSION</b> (<var>unsigned code, tree dest_type, tree src_type</var>)<var><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fCONVERSION-4349"></a></var><br>
|
||||
<blockquote><p>This hook should return the DECL of a function that implements conversion of the
|
||||
input vector of type <var>src_type</var> to type <var>dest_type</var>.
|
||||
The value of <var>code</var> is one of the enumerators in <code>enum tree_code</code> and
|
||||
specifies how the conversion is to be applied
|
||||
(truncation, rounding, etc.).
|
||||
|
||||
<p>If this hook is defined, the autovectorizer will use the
|
||||
<code>TARGET_VECTORIZE_BUILTIN_CONVERSION</code> target hook when vectorizing
|
||||
conversion. Otherwise, it will return <code>NULL_TREE</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION</b> (<var>tree fndecl, tree vec_type_out, tree vec_type_in</var>)<var><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fVECTORIZED_005fFUNCTION-4350"></a></var><br>
|
||||
<blockquote><p>This hook should return the decl of a function that implements the
|
||||
vectorized variant of the builtin function with builtin function code
|
||||
<var>code</var> or <code>NULL_TREE</code> if such a function is not available.
|
||||
The value of <var>fndecl</var> is the builtin function declaration. The
|
||||
return type of the vectorized function shall be of vector type
|
||||
<var>vec_type_out</var> and the argument types should be <var>vec_type_in</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT</b> (<var>enum machine_mode mode, const_tree type, int misalignment, bool is_packed</var>)<var><a name="index-TARGET_005fVECTORIZE_005fSUPPORT_005fVECTOR_005fMISALIGNMENT-4351"></a></var><br>
|
||||
<blockquote><p>This hook should return true if the target supports misaligned vector
|
||||
store/load of a specific factor denoted in the <var>misalignment</var>
|
||||
parameter. The vector store/load should be of machine mode <var>mode</var> and
|
||||
the elements in the vectors should be of type <var>type</var>. <var>is_packed</var>
|
||||
parameter is true if the memory access is defined in a packed struct.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: enum machine_mode <b>TARGET_VECTORIZE_PREFERRED_SIMD_MODE</b> (<var>enum machine_mode mode</var>)<var><a name="index-TARGET_005fVECTORIZE_005fPREFERRED_005fSIMD_005fMODE-4352"></a></var><br>
|
||||
<blockquote><p>This hook should return the preferred mode for vectorizing scalar
|
||||
mode <var>mode</var>. The default is
|
||||
equal to <code>word_mode</code>, because the vectorizer can do some
|
||||
transformations even in absence of specialized <acronym>SIMD</acronym> hardware.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: unsigned int <b>TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES</b> (<var>void</var>)<var><a name="index-TARGET_005fVECTORIZE_005fAUTOVECTORIZE_005fVECTOR_005fSIZES-4353"></a></var><br>
|
||||
<blockquote><p>This hook should return a mask of sizes that should be iterated over
|
||||
after trying to autovectorize using the vector size derived from the
|
||||
mode returned by <code>TARGET_VECTORIZE_PREFERRED_SIMD_MODE</code>.
|
||||
The default is zero which means to not iterate over other vector sizes.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void * <b>TARGET_VECTORIZE_INIT_COST</b> (<var>struct loop *loop_info</var>)<var><a name="index-TARGET_005fVECTORIZE_005fINIT_005fCOST-4354"></a></var><br>
|
||||
<blockquote><p>This hook should initialize target-specific data structures in preparation for modeling the costs of vectorizing a loop or basic block. The default allocates three unsigned integers for accumulating costs for the prologue, body, and epilogue of the loop or basic block. If <var>loop_info</var> is non-NULL, it identifies the loop being vectorized; otherwise a single block is being vectorized.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: unsigned <b>TARGET_VECTORIZE_ADD_STMT_COST</b> (<var>void *data, int count, enum vect_cost_for_stmt kind, struct _stmt_vec_info *stmt_info, int misalign, enum vect_cost_model_location where</var>)<var><a name="index-TARGET_005fVECTORIZE_005fADD_005fSTMT_005fCOST-4355"></a></var><br>
|
||||
<blockquote><p>This hook should update the target-specific <var>data</var> in response to adding <var>count</var> copies of the given <var>kind</var> of statement to a loop or basic block. The default adds the builtin vectorizer cost for the copies of the statement to the accumulator specified by <var>where</var>, (the prologue, body, or epilogue) and returns the amount added. The return value should be viewed as a tentative cost that may later be revised.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_VECTORIZE_FINISH_COST</b> (<var>void *data, unsigned *prologue_cost, unsigned *body_cost, unsigned *epilogue_cost</var>)<var><a name="index-TARGET_005fVECTORIZE_005fFINISH_005fCOST-4356"></a></var><br>
|
||||
<blockquote><p>This hook should complete calculations of the cost of vectorizing a loop or basic block based on <var>data</var>, and return the prologue, body, and epilogue costs as unsigned integers. The default returns the value of the three accumulators.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_VECTORIZE_DESTROY_COST_DATA</b> (<var>void *data</var>)<var><a name="index-TARGET_005fVECTORIZE_005fDESTROY_005fCOST_005fDATA-4357"></a></var><br>
|
||||
<blockquote><p>This hook should release <var>data</var> and any related data structures allocated by TARGET_VECTORIZE_INIT_COST. The default releases the accumulator.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_VECTORIZE_BUILTIN_TM_LOAD</b> (<var>tree</var>)<var><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fTM_005fLOAD-4358"></a></var><br>
|
||||
<blockquote><p>This hook should return the built-in decl needed to load a vector of the given type within a transaction.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_VECTORIZE_BUILTIN_TM_STORE</b> (<var>tree</var>)<var><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fTM_005fSTORE-4359"></a></var><br>
|
||||
<blockquote><p>This hook should return the built-in decl needed to store a vector of the given type within a transaction.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_VECTORIZE_BUILTIN_GATHER</b> (<var>const_tree mem_vectype, const_tree index_type, int scale</var>)<var><a name="index-TARGET_005fVECTORIZE_005fBUILTIN_005fGATHER-4360"></a></var><br>
|
||||
<blockquote><p>Target builtin that implements vector gather operation. <var>mem_vectype</var>
|
||||
is the vector type of the load and <var>index_type</var> is scalar type of
|
||||
the index, scaled by <var>scale</var>.
|
||||
The default is <code>NULL_TREE</code> which means to not vectorize gather
|
||||
loads.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Aggregate Return - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Stack-and-Calling.html#Stack-and-Calling" title="Stack and Calling">
|
||||
<link rel="prev" href="Scalar-Return.html#Scalar-Return" title="Scalar Return">
|
||||
<link rel="next" href="Caller-Saves.html#Caller-Saves" title="Caller Saves">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Aggregate-Return"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Caller-Saves.html#Caller-Saves">Caller Saves</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Scalar-Return.html#Scalar-Return">Scalar Return</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Stack-and-Calling.html#Stack-and-Calling">Stack and Calling</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.10.9 How Large Values Are Returned</h4>
|
||||
|
||||
<p><a name="index-aggregates-as-return-values-4230"></a><a name="index-large-return-values-4231"></a><a name="index-returning-aggregate-values-4232"></a><a name="index-structure-value-address-4233"></a>
|
||||
When a function value's mode is <code>BLKmode</code> (and in some other
|
||||
cases), the value is not returned according to
|
||||
<code>TARGET_FUNCTION_VALUE</code> (see <a href="Scalar-Return.html#Scalar-Return">Scalar Return</a>). Instead, the
|
||||
caller passes the address of a block of memory in which the value
|
||||
should be stored. This address is called the <dfn>structure value
|
||||
address</dfn>.
|
||||
|
||||
<p>This section describes how to control returning structure values in
|
||||
memory.
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_RETURN_IN_MEMORY</b> (<var>const_tree type, const_tree fntype</var>)<var><a name="index-TARGET_005fRETURN_005fIN_005fMEMORY-4234"></a></var><br>
|
||||
<blockquote><p>This target hook should return a nonzero value to say to return the
|
||||
function value in memory, just as large structures are always returned.
|
||||
Here <var>type</var> will be the data type of the value, and <var>fntype</var>
|
||||
will be the type of the function doing the returning, or <code>NULL</code> for
|
||||
libcalls.
|
||||
|
||||
<p>Note that values of mode <code>BLKmode</code> must be explicitly handled
|
||||
by this function. Also, the option <samp><span class="option">-fpcc-struct-return</span></samp>
|
||||
takes effect regardless of this macro. On most systems, it is
|
||||
possible to leave the hook undefined; this causes a default
|
||||
definition to be used, whose value is the constant 1 for <code>BLKmode</code>
|
||||
values, and 0 otherwise.
|
||||
|
||||
<p>Do not use this hook to indicate that structures and unions should always
|
||||
be returned in memory. You should instead use <code>DEFAULT_PCC_STRUCT_RETURN</code>
|
||||
to indicate this.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DEFAULT_PCC_STRUCT_RETURN</b><var><a name="index-DEFAULT_005fPCC_005fSTRUCT_005fRETURN-4235"></a></var><br>
|
||||
<blockquote><p>Define this macro to be 1 if all structure and union return values must be
|
||||
in memory. Since this results in slower code, this should be defined
|
||||
only if needed for compatibility with other compilers or with an ABI.
|
||||
If you define this macro to be 0, then the conventions used for structure
|
||||
and union return values are decided by the <code>TARGET_RETURN_IN_MEMORY</code>
|
||||
target hook.
|
||||
|
||||
<p>If not defined, this defaults to the value 1.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: rtx <b>TARGET_STRUCT_VALUE_RTX</b> (<var>tree fndecl, int incoming</var>)<var><a name="index-TARGET_005fSTRUCT_005fVALUE_005fRTX-4236"></a></var><br>
|
||||
<blockquote><p>This target hook should return the location of the structure value
|
||||
address (normally a <code>mem</code> or <code>reg</code>), or 0 if the address is
|
||||
passed as an “invisible” first argument. Note that <var>fndecl</var> may
|
||||
be <code>NULL</code>, for libcalls. You do not need to define this target
|
||||
hook if the address is always passed as an “invisible” first
|
||||
argument.
|
||||
|
||||
<p>On some architectures the place where the structure value address
|
||||
is found by the called function is not the same place that the
|
||||
caller put it. This can be due to register windows, or it could
|
||||
be because the function prologue moves it to a different place.
|
||||
<var>incoming</var> is <code>1</code> or <code>2</code> when the location is needed in
|
||||
the context of the called function, and <code>0</code> in the context of
|
||||
the caller.
|
||||
|
||||
<p>If <var>incoming</var> is nonzero and the address is to be found on the
|
||||
stack, return a <code>mem</code> which refers to the frame pointer. If
|
||||
<var>incoming</var> is <code>2</code>, the result is being used to fetch the
|
||||
structure value address at the beginning of a function. If you need
|
||||
to emit adjusting code, you should do it at this point.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>PCC_STATIC_STRUCT_RETURN</b><var><a name="index-PCC_005fSTATIC_005fSTRUCT_005fRETURN-4237"></a></var><br>
|
||||
<blockquote><p>Define this macro if the usual system convention on the target machine
|
||||
for returning structures and unions is for the called function to return
|
||||
the address of a static variable containing the value.
|
||||
|
||||
<p>Do not define this if the usual system convention is for the caller to
|
||||
pass an address to the subroutine.
|
||||
|
||||
<p>This macro has effect in <samp><span class="option">-fpcc-struct-return</span></samp> mode, but it does
|
||||
nothing when you use <samp><span class="option">-freg-struct-return</span></samp> mode.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: enum machine_mode <b>TARGET_GET_RAW_RESULT_MODE</b> (<var>int regno</var>)<var><a name="index-TARGET_005fGET_005fRAW_005fRESULT_005fMODE-4238"></a></var><br>
|
||||
<blockquote><p>This target hook returns the mode to be used when accessing raw return registers in <code>__builtin_return</code>. Define this macro if the value in <var>reg_raw_mode</var> is not correct.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: enum machine_mode <b>TARGET_GET_RAW_ARG_MODE</b> (<var>int regno</var>)<var><a name="index-TARGET_005fGET_005fRAW_005fARG_005fMODE-4239"></a></var><br>
|
||||
<blockquote><p>This target hook returns the mode to be used when accessing raw argument registers in <code>__builtin_apply_args</code>. Define this macro if the value in <var>reg_raw_mode</var> is not correct.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Alias analysis - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Tree-SSA.html#Tree-SSA" title="Tree SSA">
|
||||
<link rel="prev" href="SSA.html#SSA" title="SSA">
|
||||
<link rel="next" href="Memory-model.html#Memory-model" title="Memory model">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Alias-analysis"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Memory-model.html#Memory-model">Memory model</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="SSA.html#SSA">SSA</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Tree-SSA.html#Tree-SSA">Tree SSA</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">13.4 Alias analysis</h3>
|
||||
|
||||
<p><a name="index-alias-3103"></a><a name="index-flow_002dsensitive-alias-analysis-3104"></a><a name="index-flow_002dinsensitive-alias-analysis-3105"></a>
|
||||
Alias analysis in GIMPLE SSA form consists of two pieces. First
|
||||
the virtual SSA web ties conflicting memory accesses and provides
|
||||
a SSA use-def chain and SSA immediate-use chains for walking
|
||||
possibly dependent memory accesses. Second an alias-oracle can
|
||||
be queried to disambiguate explicit and implicit memory references.
|
||||
|
||||
<ol type=1 start=1>
|
||||
<li>Memory SSA form.
|
||||
|
||||
<p>All statements that may use memory have exactly one accompanied use of
|
||||
a virtual SSA name that represents the state of memory at the
|
||||
given point in the IL.
|
||||
|
||||
<p>All statements that may define memory have exactly one accompanied
|
||||
definition of a virtual SSA name using the previous state of memory
|
||||
and defining the new state of memory after the given point in the IL.
|
||||
|
||||
<pre class="smallexample"> int i;
|
||||
int foo (void)
|
||||
{
|
||||
# .MEM_3 = VDEF <.MEM_2(D)>
|
||||
i = 1;
|
||||
# VUSE <.MEM_3>
|
||||
return i;
|
||||
}
|
||||
</pre>
|
||||
<p>The virtual SSA names in this case are <code>.MEM_2(D)</code> and
|
||||
<code>.MEM_3</code>. The store to the global variable <code>i</code>
|
||||
defines <code>.MEM_3</code> invalidating <code>.MEM_2(D)</code>. The
|
||||
load from <code>i</code> uses that new state <code>.MEM_3</code>.
|
||||
|
||||
<p>The virtual SSA web serves as constraints to SSA optimizers
|
||||
preventing illegitimate code-motion and optimization. It
|
||||
also provides a way to walk related memory statements.
|
||||
|
||||
<li>Points-to and escape analysis.
|
||||
|
||||
<p>Points-to analysis builds a set of constraints from the GIMPLE
|
||||
SSA IL representing all pointer operations and facts we do
|
||||
or do not know about pointers. Solving this set of constraints
|
||||
yields a conservatively correct solution for each pointer
|
||||
variable in the program (though we are only interested in
|
||||
SSA name pointers) as to what it may possibly point to.
|
||||
|
||||
<p>This points-to solution for a given SSA name pointer is stored
|
||||
in the <code>pt_solution</code> sub-structure of the
|
||||
<code>SSA_NAME_PTR_INFO</code> record. The following accessor
|
||||
functions are available:
|
||||
|
||||
<ul>
|
||||
<li><code>pt_solution_includes</code>
|
||||
<li><code>pt_solutions_intersect</code>
|
||||
</ul>
|
||||
|
||||
<p>Points-to analysis also computes the solution for two special
|
||||
set of pointers, <code>ESCAPED</code> and <code>CALLUSED</code>. Those
|
||||
represent all memory that has escaped the scope of analysis
|
||||
or that is used by pure or nested const calls.
|
||||
|
||||
<li>Type-based alias analysis
|
||||
|
||||
<p>Type-based alias analysis is frontend dependent though generic
|
||||
support is provided by the middle-end in <code>alias.c</code>. TBAA
|
||||
code is used by both tree optimizers and RTL optimizers.
|
||||
|
||||
<p>Every language that wishes to perform language-specific alias analysis
|
||||
should define a function that computes, given a <code>tree</code>
|
||||
node, an alias set for the node. Nodes in different alias sets are not
|
||||
allowed to alias. For an example, see the C front-end function
|
||||
<code>c_get_alias_set</code>.
|
||||
|
||||
<li>Tree alias-oracle
|
||||
|
||||
<p>The tree alias-oracle provides means to disambiguate two memory
|
||||
references and memory references against statements. The following
|
||||
queries are available:
|
||||
|
||||
<ul>
|
||||
<li><code>refs_may_alias_p</code>
|
||||
<li><code>ref_maybe_used_by_stmt_p</code>
|
||||
<li><code>stmt_may_clobber_ref_p</code>
|
||||
</ul>
|
||||
|
||||
<p>In addition to those two kind of statement walkers are available
|
||||
walking statements related to a reference ref.
|
||||
<code>walk_non_aliased_vuses</code> walks over dominating memory defining
|
||||
statements and calls back if the statement does not clobber ref
|
||||
providing the non-aliased VUSE. The walk stops at
|
||||
the first clobbering statement or if asked to.
|
||||
<code>walk_aliased_vdefs</code> walks over dominating memory defining
|
||||
statements and calls back on each statement clobbering ref
|
||||
providing its aliasing VDEF. The walk stops if asked to.
|
||||
|
||||
</ol>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Alignment Output - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Assembler-Format.html#Assembler-Format" title="Assembler Format">
|
||||
<link rel="prev" href="Exception-Region-Output.html#Exception-Region-Output" title="Exception Region Output">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Alignment-Output"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Exception-Region-Output.html#Exception-Region-Output">Exception Region Output</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Assembler-Format.html#Assembler-Format">Assembler Format</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.21.10 Assembler Commands for Alignment</h4>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>This describes commands for alignment.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>JUMP_ALIGN</b> (<var>label</var>)<var><a name="index-JUMP_005fALIGN-4676"></a></var><br>
|
||||
<blockquote><p>The alignment (log base 2) to put in front of <var>label</var>, which is
|
||||
a common destination of jumps and has no fallthru incoming edge.
|
||||
|
||||
<p>This macro need not be defined if you don't want any special alignment
|
||||
to be done at such a time. Most machine descriptions do not currently
|
||||
define the macro.
|
||||
|
||||
<p>Unless it's necessary to inspect the <var>label</var> parameter, it is better
|
||||
to set the variable <var>align_jumps</var> in the target's
|
||||
<code>TARGET_OPTION_OVERRIDE</code>. Otherwise, you should try to honor the user's
|
||||
selection in <var>align_jumps</var> in a <code>JUMP_ALIGN</code> implementation.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_ASM_JUMP_ALIGN_MAX_SKIP</b> (<var>rtx label</var>)<var><a name="index-TARGET_005fASM_005fJUMP_005fALIGN_005fMAX_005fSKIP-4677"></a></var><br>
|
||||
<blockquote><p>The maximum number of bytes to skip before <var>label</var> when applying
|
||||
<code>JUMP_ALIGN</code>. This works only if
|
||||
<code>ASM_OUTPUT_MAX_SKIP_ALIGN</code> is defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LABEL_ALIGN_AFTER_BARRIER</b> (<var>label</var>)<var><a name="index-LABEL_005fALIGN_005fAFTER_005fBARRIER-4678"></a></var><br>
|
||||
<blockquote><p>The alignment (log base 2) to put in front of <var>label</var>, which follows
|
||||
a <code>BARRIER</code>.
|
||||
|
||||
<p>This macro need not be defined if you don't want any special alignment
|
||||
to be done at such a time. Most machine descriptions do not currently
|
||||
define the macro.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP</b> (<var>rtx label</var>)<var><a name="index-TARGET_005fASM_005fLABEL_005fALIGN_005fAFTER_005fBARRIER_005fMAX_005fSKIP-4679"></a></var><br>
|
||||
<blockquote><p>The maximum number of bytes to skip before <var>label</var> when applying
|
||||
<code>LABEL_ALIGN_AFTER_BARRIER</code>. This works only if
|
||||
<code>ASM_OUTPUT_MAX_SKIP_ALIGN</code> is defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LOOP_ALIGN</b> (<var>label</var>)<var><a name="index-LOOP_005fALIGN-4680"></a></var><br>
|
||||
<blockquote><p>The alignment (log base 2) to put in front of <var>label</var>, which follows
|
||||
a <code>NOTE_INSN_LOOP_BEG</code> note.
|
||||
|
||||
<p>This macro need not be defined if you don't want any special alignment
|
||||
to be done at such a time. Most machine descriptions do not currently
|
||||
define the macro.
|
||||
|
||||
<p>Unless it's necessary to inspect the <var>label</var> parameter, it is better
|
||||
to set the variable <code>align_loops</code> in the target's
|
||||
<code>TARGET_OPTION_OVERRIDE</code>. Otherwise, you should try to honor the user's
|
||||
selection in <code>align_loops</code> in a <code>LOOP_ALIGN</code> implementation.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_ASM_LOOP_ALIGN_MAX_SKIP</b> (<var>rtx label</var>)<var><a name="index-TARGET_005fASM_005fLOOP_005fALIGN_005fMAX_005fSKIP-4681"></a></var><br>
|
||||
<blockquote><p>The maximum number of bytes to skip when applying <code>LOOP_ALIGN</code> to
|
||||
<var>label</var>. This works only if <code>ASM_OUTPUT_MAX_SKIP_ALIGN</code> is
|
||||
defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LABEL_ALIGN</b> (<var>label</var>)<var><a name="index-LABEL_005fALIGN-4682"></a></var><br>
|
||||
<blockquote><p>The alignment (log base 2) to put in front of <var>label</var>.
|
||||
If <code>LABEL_ALIGN_AFTER_BARRIER</code> / <code>LOOP_ALIGN</code> specify a different alignment,
|
||||
the maximum of the specified values is used.
|
||||
|
||||
<p>Unless it's necessary to inspect the <var>label</var> parameter, it is better
|
||||
to set the variable <code>align_labels</code> in the target's
|
||||
<code>TARGET_OPTION_OVERRIDE</code>. Otherwise, you should try to honor the user's
|
||||
selection in <code>align_labels</code> in a <code>LABEL_ALIGN</code> implementation.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_ASM_LABEL_ALIGN_MAX_SKIP</b> (<var>rtx label</var>)<var><a name="index-TARGET_005fASM_005fLABEL_005fALIGN_005fMAX_005fSKIP-4683"></a></var><br>
|
||||
<blockquote><p>The maximum number of bytes to skip when applying <code>LABEL_ALIGN</code>
|
||||
to <var>label</var>. This works only if <code>ASM_OUTPUT_MAX_SKIP_ALIGN</code>
|
||||
is defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_SKIP</b> (<var>stream, nbytes</var>)<var><a name="index-ASM_005fOUTPUT_005fSKIP-4684"></a></var><br>
|
||||
<blockquote><p>A C statement to output to the stdio stream <var>stream</var> an assembler
|
||||
instruction to advance the location counter by <var>nbytes</var> bytes.
|
||||
Those bytes should be zero when loaded. <var>nbytes</var> will be a C
|
||||
expression of type <code>unsigned HOST_WIDE_INT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_NO_SKIP_IN_TEXT</b><var><a name="index-ASM_005fNO_005fSKIP_005fIN_005fTEXT-4685"></a></var><br>
|
||||
<blockquote><p>Define this macro if <code>ASM_OUTPUT_SKIP</code> should not be used in the
|
||||
text section because it fails to put zeros in the bytes that are skipped.
|
||||
This is true on many Unix systems, where the pseudo–op to skip bytes
|
||||
produces no-op instructions rather than zeros when used in the text
|
||||
section.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_ALIGN</b> (<var>stream, power</var>)<var><a name="index-ASM_005fOUTPUT_005fALIGN-4686"></a></var><br>
|
||||
<blockquote><p>A C statement to output to the stdio stream <var>stream</var> an assembler
|
||||
command to advance the location counter to a multiple of 2 to the
|
||||
<var>power</var> bytes. <var>power</var> will be a C expression of type <code>int</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_ALIGN_WITH_NOP</b> (<var>stream, power</var>)<var><a name="index-ASM_005fOUTPUT_005fALIGN_005fWITH_005fNOP-4687"></a></var><br>
|
||||
<blockquote><p>Like <code>ASM_OUTPUT_ALIGN</code>, except that the “nop” instruction is used
|
||||
for padding, if necessary.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_MAX_SKIP_ALIGN</b> (<var>stream, power, max_skip</var>)<var><a name="index-ASM_005fOUTPUT_005fMAX_005fSKIP_005fALIGN-4688"></a></var><br>
|
||||
<blockquote><p>A C statement to output to the stdio stream <var>stream</var> an assembler
|
||||
command to advance the location counter to a multiple of 2 to the
|
||||
<var>power</var> bytes, but only if <var>max_skip</var> or fewer bytes are needed to
|
||||
satisfy the alignment request. <var>power</var> and <var>max_skip</var> will be
|
||||
a C expression of type <code>int</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>All Debuggers - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Debugging-Info.html#Debugging-Info" title="Debugging Info">
|
||||
<link rel="next" href="DBX-Options.html#DBX-Options" title="DBX Options">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="All-Debuggers"></a>
|
||||
Next: <a rel="next" accesskey="n" href="DBX-Options.html#DBX-Options">DBX Options</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Debugging-Info.html#Debugging-Info">Debugging Info</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.22.1 Macros Affecting All Debugging Formats</h4>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>These macros affect all debugging formats.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_REGISTER_NUMBER</b> (<var>regno</var>)<var><a name="index-DBX_005fREGISTER_005fNUMBER-4689"></a></var><br>
|
||||
<blockquote><p>A C expression that returns the DBX register number for the compiler
|
||||
register number <var>regno</var>. In the default macro provided, the value
|
||||
of this expression will be <var>regno</var> itself. But sometimes there are
|
||||
some registers that the compiler knows about and DBX does not, or vice
|
||||
versa. In such cases, some register may need to have one number in the
|
||||
compiler and another for DBX.
|
||||
|
||||
<p>If two registers have consecutive numbers inside GCC, and they can be
|
||||
used as a pair to hold a multiword value, then they <em>must</em> have
|
||||
consecutive numbers after renumbering with <code>DBX_REGISTER_NUMBER</code>.
|
||||
Otherwise, debuggers will be unable to access such a pair, because they
|
||||
expect register pairs to be consecutive in their own numbering scheme.
|
||||
|
||||
<p>If you find yourself defining <code>DBX_REGISTER_NUMBER</code> in way that
|
||||
does not preserve register pairs, then what you must do instead is
|
||||
redefine the actual register numbering scheme.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DEBUGGER_AUTO_OFFSET</b> (<var>x</var>)<var><a name="index-DEBUGGER_005fAUTO_005fOFFSET-4690"></a></var><br>
|
||||
<blockquote><p>A C expression that returns the integer offset value for an automatic
|
||||
variable having address <var>x</var> (an RTL expression). The default
|
||||
computation assumes that <var>x</var> is based on the frame-pointer and
|
||||
gives the offset from the frame-pointer. This is required for targets
|
||||
that produce debugging output for DBX or COFF-style debugging output
|
||||
for SDB and allow the frame-pointer to be eliminated when the
|
||||
<samp><span class="option">-g</span></samp> options is used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DEBUGGER_ARG_OFFSET</b> (<var>offset, x</var>)<var><a name="index-DEBUGGER_005fARG_005fOFFSET-4691"></a></var><br>
|
||||
<blockquote><p>A C expression that returns the integer offset value for an argument
|
||||
having address <var>x</var> (an RTL expression). The nominal offset is
|
||||
<var>offset</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>PREFERRED_DEBUGGING_TYPE</b><var><a name="index-PREFERRED_005fDEBUGGING_005fTYPE-4692"></a></var><br>
|
||||
<blockquote><p>A C expression that returns the type of debugging output GCC should
|
||||
produce when the user specifies just <samp><span class="option">-g</span></samp>. Define
|
||||
this if you have arranged for GCC to support more than one format of
|
||||
debugging output. Currently, the allowable values are <code>DBX_DEBUG</code>,
|
||||
<code>SDB_DEBUG</code>, <code>DWARF_DEBUG</code>, <code>DWARF2_DEBUG</code>,
|
||||
<code>XCOFF_DEBUG</code>, <code>VMS_DEBUG</code>, and <code>VMS_AND_DWARF2_DEBUG</code>.
|
||||
|
||||
<p>When the user specifies <samp><span class="option">-ggdb</span></samp>, GCC normally also uses the
|
||||
value of this macro to select the debugging output format, but with two
|
||||
exceptions. If <code>DWARF2_DEBUGGING_INFO</code> is defined, GCC uses the
|
||||
value <code>DWARF2_DEBUG</code>. Otherwise, if <code>DBX_DEBUGGING_INFO</code> is
|
||||
defined, GCC uses <code>DBX_DEBUG</code>.
|
||||
|
||||
<p>The value of this macro only affects the default debugging output; the
|
||||
user can always get a specific type of output by using <samp><span class="option">-gstabs</span></samp>,
|
||||
<samp><span class="option">-gcoff</span></samp>, <samp><span class="option">-gdwarf-2</span></samp>, <samp><span class="option">-gxcoff</span></samp>, or <samp><span class="option">-gvms</span></samp>.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Allocation Order - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Registers.html#Registers" title="Registers">
|
||||
<link rel="prev" href="Register-Basics.html#Register-Basics" title="Register Basics">
|
||||
<link rel="next" href="Values-in-Registers.html#Values-in-Registers" title="Values in Registers">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Allocation-Order"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Values-in-Registers.html#Values-in-Registers">Values in Registers</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Register-Basics.html#Register-Basics">Register Basics</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Registers.html#Registers">Registers</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.7.2 Order of Allocation of Registers</h4>
|
||||
|
||||
<p><a name="index-order-of-register-allocation-4018"></a><a name="index-register-allocation-order-4019"></a>
|
||||
<!-- prevent bad page break with this line -->
|
||||
Registers are allocated in order.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>REG_ALLOC_ORDER</b><var><a name="index-REG_005fALLOC_005fORDER-4020"></a></var><br>
|
||||
<blockquote><p>If defined, an initializer for a vector of integers, containing the
|
||||
numbers of hard registers in the order in which GCC should prefer
|
||||
to use them (from most preferred to least).
|
||||
|
||||
<p>If this macro is not defined, registers are used lowest numbered first
|
||||
(all else being equal).
|
||||
|
||||
<p>One use of this macro is on machines where the highest numbered
|
||||
registers must always be saved and the save-multiple-registers
|
||||
instruction supports only sequences of consecutive registers. On such
|
||||
machines, define <code>REG_ALLOC_ORDER</code> to be an initializer that lists
|
||||
the highest numbered allocable register first.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ADJUST_REG_ALLOC_ORDER</b><var><a name="index-ADJUST_005fREG_005fALLOC_005fORDER-4021"></a></var><br>
|
||||
<blockquote><p>A C statement (sans semicolon) to choose the order in which to allocate
|
||||
hard registers for pseudo-registers local to a basic block.
|
||||
|
||||
<p>Store the desired register order in the array <code>reg_alloc_order</code>.
|
||||
Element 0 should be the register to allocate first; element 1, the next
|
||||
register; and so on.
|
||||
|
||||
<p>The macro body should not assume anything about the contents of
|
||||
<code>reg_alloc_order</code> before execution of the macro.
|
||||
|
||||
<p>On most machines, it is not necessary to define this macro.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>HONOR_REG_ALLOC_ORDER</b><var><a name="index-HONOR_005fREG_005fALLOC_005fORDER-4022"></a></var><br>
|
||||
<blockquote><p>Normally, IRA tries to estimate the costs for saving a register in the
|
||||
prologue and restoring it in the epilogue. This discourages it from
|
||||
using call-saved registers. If a machine wants to ensure that IRA
|
||||
allocates registers in the order given by REG_ALLOC_ORDER even if some
|
||||
call-saved registers appear earlier than call-used ones, this macro
|
||||
should be defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>IRA_HARD_REGNO_ADD_COST_MULTIPLIER</b> (<var>regno</var>)<var><a name="index-IRA_005fHARD_005fREGNO_005fADD_005fCOST_005fMULTIPLIER-4023"></a></var><br>
|
||||
<blockquote><p>In some case register allocation order is not enough for the
|
||||
Integrated Register Allocator (<acronym>IRA</acronym>) to generate a good code.
|
||||
If this macro is defined, it should return a floating point value
|
||||
based on <var>regno</var>. The cost of using <var>regno</var> for a pseudo will
|
||||
be increased by approximately the pseudo's usage frequency times the
|
||||
value returned by this macro. Not defining this macro is equivalent
|
||||
to having it always return <code>0.0</code>.
|
||||
|
||||
<p>On most machines, it is not necessary to define this macro.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Anchored Addresses - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="Addressing-Modes.html#Addressing-Modes" title="Addressing Modes">
|
||||
<link rel="next" href="Condition-Code.html#Condition-Code" title="Condition Code">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Anchored-Addresses"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Condition-Code.html#Condition-Code">Condition Code</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Addressing-Modes.html#Addressing-Modes">Addressing Modes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.15 Anchored Addresses</h3>
|
||||
|
||||
<p><a name="index-anchored-addresses-4361"></a><a name="index-g_t_0040option_007b_002dfsection_002danchors_007d-4362"></a>
|
||||
GCC usually addresses every static object as a separate entity.
|
||||
For example, if we have:
|
||||
|
||||
<pre class="smallexample"> static int a, b, c;
|
||||
int foo (void) { return a + b + c; }
|
||||
</pre>
|
||||
<p>the code for <code>foo</code> will usually calculate three separate symbolic
|
||||
addresses: those of <code>a</code>, <code>b</code> and <code>c</code>. On some targets,
|
||||
it would be better to calculate just one symbolic address and access
|
||||
the three variables relative to it. The equivalent pseudocode would
|
||||
be something like:
|
||||
|
||||
<pre class="smallexample"> int foo (void)
|
||||
{
|
||||
register int *xr = &x;
|
||||
return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
|
||||
}
|
||||
</pre>
|
||||
<p>(which isn't valid C). We refer to shared addresses like <code>x</code> as
|
||||
“section anchors”. Their use is controlled by <samp><span class="option">-fsection-anchors</span></samp>.
|
||||
|
||||
<p>The hooks below describe the target properties that GCC needs to know
|
||||
in order to make effective use of section anchors. It won't use
|
||||
section anchors at all unless either <code>TARGET_MIN_ANCHOR_OFFSET</code>
|
||||
or <code>TARGET_MAX_ANCHOR_OFFSET</code> is set to a nonzero value.
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: HOST_WIDE_INT <b>TARGET_MIN_ANCHOR_OFFSET</b><var><a name="index-TARGET_005fMIN_005fANCHOR_005fOFFSET-4363"></a></var><br>
|
||||
<blockquote><p>The minimum offset that should be applied to a section anchor.
|
||||
On most targets, it should be the smallest offset that can be
|
||||
applied to a base register while still giving a legitimate address
|
||||
for every mode. The default value is 0.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: HOST_WIDE_INT <b>TARGET_MAX_ANCHOR_OFFSET</b><var><a name="index-TARGET_005fMAX_005fANCHOR_005fOFFSET-4364"></a></var><br>
|
||||
<blockquote><p>Like <code>TARGET_MIN_ANCHOR_OFFSET</code>, but the maximum (inclusive)
|
||||
offset that should be applied to section anchors. The default
|
||||
value is 0.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_OUTPUT_ANCHOR</b> (<var>rtx x</var>)<var><a name="index-TARGET_005fASM_005fOUTPUT_005fANCHOR-4365"></a></var><br>
|
||||
<blockquote><p>Write the assembly code to define section anchor <var>x</var>, which is a
|
||||
<code>SYMBOL_REF</code> for which ‘<samp><span class="samp">SYMBOL_REF_ANCHOR_P (</span><var>x</var><span class="samp">)</span></samp>’ is true.
|
||||
The hook is called with the assembly output position set to the beginning
|
||||
of <code>SYMBOL_REF_BLOCK (</code><var>x</var><code>)</code>.
|
||||
|
||||
<p>If <code>ASM_OUTPUT_DEF</code> is available, the hook's default definition uses
|
||||
it to define the symbol as ‘<samp><span class="samp">. + SYMBOL_REF_BLOCK_OFFSET (</span><var>x</var><span class="samp">)</span></samp>’.
|
||||
If <code>ASM_OUTPUT_DEF</code> is not available, the hook's default definition
|
||||
is <code>NULL</code>, which disables the use of section anchors altogether.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_USE_ANCHORS_FOR_SYMBOL_P</b> (<var>const_rtx x</var>)<var><a name="index-TARGET_005fUSE_005fANCHORS_005fFOR_005fSYMBOL_005fP-4366"></a></var><br>
|
||||
<blockquote><p>Return true if GCC should attempt to use anchors to access <code>SYMBOL_REF</code>
|
||||
<var>x</var>. You can assume ‘<samp><span class="samp">SYMBOL_REF_HAS_BLOCK_INFO_P (</span><var>x</var><span class="samp">)</span></samp>’ and
|
||||
‘<samp><span class="samp">!SYMBOL_REF_ANCHOR_P (</span><var>x</var><span class="samp">)</span></samp>’.
|
||||
|
||||
<p>The default version is correct for most targets, but you might need to
|
||||
intercept this hook to handle things like target-specific attributes
|
||||
or target-specific sections.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Annotations - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Tree-SSA.html#Tree-SSA" title="Tree SSA">
|
||||
<link rel="next" href="SSA-Operands.html#SSA-Operands" title="SSA Operands">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Annotations"></a>
|
||||
Next: <a rel="next" accesskey="n" href="SSA-Operands.html#SSA-Operands">SSA Operands</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Tree-SSA.html#Tree-SSA">Tree SSA</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">13.1 Annotations</h3>
|
||||
|
||||
<p><a name="index-annotations-3079"></a>
|
||||
The optimizers need to associate attributes with variables during the
|
||||
optimization process. For instance, we need to know whether a
|
||||
variable has aliases. All these attributes are stored in data
|
||||
structures called annotations which are then linked to the field
|
||||
<code>ann</code> in <code>struct tree_common</code>.
|
||||
|
||||
<p>Presently, we define annotations for variables (<code>var_ann_t</code>).
|
||||
Annotations are defined and documented in <samp><span class="file">tree-flow.h</span></samp>.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,273 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Arithmetic - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Regs-and-Memory.html#Regs-and-Memory" title="Regs and Memory">
|
||||
<link rel="next" href="Comparisons.html#Comparisons" title="Comparisons">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Arithmetic"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Comparisons.html#Comparisons">Comparisons</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Regs-and-Memory.html#Regs-and-Memory">Regs and Memory</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.9 RTL Expressions for Arithmetic</h3>
|
||||
|
||||
<p><a name="index-arithmetic_002c-in-RTL-2027"></a><a name="index-math_002c-in-RTL-2028"></a><a name="index-RTL-expressions-for-arithmetic-2029"></a>
|
||||
Unless otherwise specified, all the operands of arithmetic expressions
|
||||
must be valid for mode <var>m</var>. An operand is valid for mode <var>m</var>
|
||||
if it has mode <var>m</var>, or if it is a <code>const_int</code> or
|
||||
<code>const_double</code> and <var>m</var> is a mode of class <code>MODE_INT</code>.
|
||||
|
||||
<p>For commutative binary operations, constants should be placed in the
|
||||
second operand.
|
||||
|
||||
|
||||
<a name="index-plus-2030"></a>
|
||||
<a name="index-ss_005fplus-2031"></a>
|
||||
<a name="index-us_005fplus-2032"></a>
|
||||
<a name="index-RTL-sum-2033"></a>
|
||||
<a name="index-RTL-addition-2034"></a>
|
||||
<a name="index-RTL-addition-with-signed-saturation-2035"></a>
|
||||
<a name="index-RTL-addition-with-unsigned-saturation-2036"></a>
|
||||
<dl><dt><code>(plus:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(ss_plus:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(us_plus:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>
|
||||
These three expressions all represent the sum of the values
|
||||
represented by <var>x</var> and <var>y</var> carried out in machine mode
|
||||
<var>m</var>. They differ in their behavior on overflow of integer modes.
|
||||
<code>plus</code> wraps round modulo the width of <var>m</var>; <code>ss_plus</code>
|
||||
saturates at the maximum signed value representable in <var>m</var>;
|
||||
<code>us_plus</code> saturates at the maximum unsigned value.
|
||||
|
||||
<!-- ??? What happens on overflow of floating point modes? -->
|
||||
<p><a name="index-lo_005fsum-2037"></a><br><dt><code>(lo_sum:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>
|
||||
This expression represents the sum of <var>x</var> and the low-order bits
|
||||
of <var>y</var>. It is used with <code>high</code> (see <a href="Constants.html#Constants">Constants</a>) to
|
||||
represent the typical two-instruction sequence used in RISC machines
|
||||
to reference a global memory location.
|
||||
|
||||
<p>The number of low order bits is machine-dependent but is
|
||||
normally the number of bits in a <code>Pmode</code> item minus the number of
|
||||
bits set by <code>high</code>.
|
||||
|
||||
<p><var>m</var> should be <code>Pmode</code>.
|
||||
|
||||
<p><a name="index-minus-2038"></a><a name="index-ss_005fminus-2039"></a><a name="index-us_005fminus-2040"></a><a name="index-RTL-difference-2041"></a><a name="index-RTL-subtraction-2042"></a><a name="index-RTL-subtraction-with-signed-saturation-2043"></a><a name="index-RTL-subtraction-with-unsigned-saturation-2044"></a><br><dt><code>(minus:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(ss_minus:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(us_minus:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>
|
||||
These three expressions represent the result of subtracting <var>y</var>
|
||||
from <var>x</var>, carried out in mode <var>M</var>. Behavior on overflow is
|
||||
the same as for the three variants of <code>plus</code> (see above).
|
||||
|
||||
<p><a name="index-compare-2045"></a><a name="index-RTL-comparison-2046"></a><br><dt><code>(compare:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Represents the result of subtracting <var>y</var> from <var>x</var> for purposes
|
||||
of comparison. The result is computed without overflow, as if with
|
||||
infinite precision.
|
||||
|
||||
<p>Of course, machines can't really subtract with infinite precision.
|
||||
However, they can pretend to do so when only the sign of the result will
|
||||
be used, which is the case when the result is stored in the condition
|
||||
code. And that is the <em>only</em> way this kind of expression may
|
||||
validly be used: as a value to be stored in the condition codes, either
|
||||
<code>(cc0)</code> or a register. See <a href="Comparisons.html#Comparisons">Comparisons</a>.
|
||||
|
||||
<p>The mode <var>m</var> is not related to the modes of <var>x</var> and <var>y</var>, but
|
||||
instead is the mode of the condition code value. If <code>(cc0)</code> is
|
||||
used, it is <code>VOIDmode</code>. Otherwise it is some mode in class
|
||||
<code>MODE_CC</code>, often <code>CCmode</code>. See <a href="Condition-Code.html#Condition-Code">Condition Code</a>. If <var>m</var>
|
||||
is <code>VOIDmode</code> or <code>CCmode</code>, the operation returns sufficient
|
||||
information (in an unspecified format) so that any comparison operator
|
||||
can be applied to the result of the <code>COMPARE</code> operation. For other
|
||||
modes in class <code>MODE_CC</code>, the operation only returns a subset of
|
||||
this information.
|
||||
|
||||
<p>Normally, <var>x</var> and <var>y</var> must have the same mode. Otherwise,
|
||||
<code>compare</code> is valid only if the mode of <var>x</var> is in class
|
||||
<code>MODE_INT</code> and <var>y</var> is a <code>const_int</code> or
|
||||
<code>const_double</code> with mode <code>VOIDmode</code>. The mode of <var>x</var>
|
||||
determines what mode the comparison is to be done in; thus it must not
|
||||
be <code>VOIDmode</code>.
|
||||
|
||||
<p>If one of the operands is a constant, it should be placed in the
|
||||
second operand and the comparison code adjusted as appropriate.
|
||||
|
||||
<p>A <code>compare</code> specifying two <code>VOIDmode</code> constants is not valid
|
||||
since there is no way to know in what mode the comparison is to be
|
||||
performed; the comparison must either be folded during the compilation
|
||||
or the first operand must be loaded into a register while its mode is
|
||||
still known.
|
||||
|
||||
<p><a name="index-neg-2047"></a><a name="index-ss_005fneg-2048"></a><a name="index-us_005fneg-2049"></a><a name="index-negation-2050"></a><a name="index-negation-with-signed-saturation-2051"></a><a name="index-negation-with-unsigned-saturation-2052"></a><br><dt><code>(neg:</code><var>m</var> <var>x</var><code>)</code><dt><code>(ss_neg:</code><var>m</var> <var>x</var><code>)</code><dt><code>(us_neg:</code><var>m</var> <var>x</var><code>)</code><dd>These two expressions represent the negation (subtraction from zero) of
|
||||
the value represented by <var>x</var>, carried out in mode <var>m</var>. They
|
||||
differ in the behavior on overflow of integer modes. In the case of
|
||||
<code>neg</code>, the negation of the operand may be a number not representable
|
||||
in mode <var>m</var>, in which case it is truncated to <var>m</var>. <code>ss_neg</code>
|
||||
and <code>us_neg</code> ensure that an out-of-bounds result saturates to the
|
||||
maximum or minimum signed or unsigned value.
|
||||
|
||||
<p><a name="index-mult-2053"></a><a name="index-ss_005fmult-2054"></a><a name="index-us_005fmult-2055"></a><a name="index-multiplication-2056"></a><a name="index-product-2057"></a><a name="index-multiplication-with-signed-saturation-2058"></a><a name="index-multiplication-with-unsigned-saturation-2059"></a><br><dt><code>(mult:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(ss_mult:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(us_mult:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Represents the signed product of the values represented by <var>x</var> and
|
||||
<var>y</var> carried out in machine mode <var>m</var>.
|
||||
<code>ss_mult</code> and <code>us_mult</code> ensure that an out-of-bounds result
|
||||
saturates to the maximum or minimum signed or unsigned value.
|
||||
|
||||
<p>Some machines support a multiplication that generates a product wider
|
||||
than the operands. Write the pattern for this as
|
||||
|
||||
<pre class="smallexample"> (mult:<var>m</var> (sign_extend:<var>m</var> <var>x</var>) (sign_extend:<var>m</var> <var>y</var>))
|
||||
</pre>
|
||||
<p>where <var>m</var> is wider than the modes of <var>x</var> and <var>y</var>, which need
|
||||
not be the same.
|
||||
|
||||
<p>For unsigned widening multiplication, use the same idiom, but with
|
||||
<code>zero_extend</code> instead of <code>sign_extend</code>.
|
||||
|
||||
<p><a name="index-fma-2060"></a><br><dt><code>(fma:</code><var>m</var> <var>x</var> <var>y</var> <var>z</var><code>)</code><dd>Represents the <code>fma</code>, <code>fmaf</code>, and <code>fmal</code> builtin
|
||||
functions that do a combined multiply of <var>x</var> and <var>y</var> and then
|
||||
adding to<var>z</var> without doing an intermediate rounding step.
|
||||
|
||||
<p><a name="index-div-2061"></a><a name="index-ss_005fdiv-2062"></a><a name="index-division-2063"></a><a name="index-signed-division-2064"></a><a name="index-signed-division-with-signed-saturation-2065"></a><a name="index-quotient-2066"></a><br><dt><code>(div:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(ss_div:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Represents the quotient in signed division of <var>x</var> by <var>y</var>,
|
||||
carried out in machine mode <var>m</var>. If <var>m</var> is a floating point
|
||||
mode, it represents the exact quotient; otherwise, the integerized
|
||||
quotient.
|
||||
<code>ss_div</code> ensures that an out-of-bounds result saturates to the maximum
|
||||
or minimum signed value.
|
||||
|
||||
<p>Some machines have division instructions in which the operands and
|
||||
quotient widths are not all the same; you should represent
|
||||
such instructions using <code>truncate</code> and <code>sign_extend</code> as in,
|
||||
|
||||
<pre class="smallexample"> (truncate:<var>m1</var> (div:<var>m2</var> <var>x</var> (sign_extend:<var>m2</var> <var>y</var>)))
|
||||
</pre>
|
||||
<p><a name="index-udiv-2067"></a><a name="index-unsigned-division-2068"></a><a name="index-unsigned-division-with-unsigned-saturation-2069"></a><a name="index-division-2070"></a><br><dt><code>(udiv:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(us_div:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Like <code>div</code> but represents unsigned division.
|
||||
<code>us_div</code> ensures that an out-of-bounds result saturates to the maximum
|
||||
or minimum unsigned value.
|
||||
|
||||
<p><a name="index-mod-2071"></a><a name="index-umod-2072"></a><a name="index-remainder-2073"></a><a name="index-division-2074"></a><br><dt><code>(mod:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(umod:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Like <code>div</code> and <code>udiv</code> but represent the remainder instead of
|
||||
the quotient.
|
||||
|
||||
<p><a name="index-smin-2075"></a><a name="index-smax-2076"></a><a name="index-signed-minimum-2077"></a><a name="index-signed-maximum-2078"></a><br><dt><code>(smin:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(smax:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Represents the smaller (for <code>smin</code>) or larger (for <code>smax</code>) of
|
||||
<var>x</var> and <var>y</var>, interpreted as signed values in mode <var>m</var>.
|
||||
When used with floating point, if both operands are zeros, or if either
|
||||
operand is <code>NaN</code>, then it is unspecified which of the two operands
|
||||
is returned as the result.
|
||||
|
||||
<p><a name="index-umin-2079"></a><a name="index-umax-2080"></a><a name="index-unsigned-minimum-and-maximum-2081"></a><br><dt><code>(umin:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(umax:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Like <code>smin</code> and <code>smax</code>, but the values are interpreted as unsigned
|
||||
integers.
|
||||
|
||||
<p><a name="index-not-2082"></a><a name="index-complement_002c-bitwise-2083"></a><a name="index-bitwise-complement-2084"></a><br><dt><code>(not:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the bitwise complement of the value represented by <var>x</var>,
|
||||
carried out in mode <var>m</var>, which must be a fixed-point machine mode.
|
||||
|
||||
<p><a name="index-and-2085"></a><a name="index-logical_002dand_002c-bitwise-2086"></a><a name="index-bitwise-logical_002dand-2087"></a><br><dt><code>(and:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Represents the bitwise logical-and of the values represented by
|
||||
<var>x</var> and <var>y</var>, carried out in machine mode <var>m</var>, which must be
|
||||
a fixed-point machine mode.
|
||||
|
||||
<p><a name="index-ior-2088"></a><a name="index-inclusive_002dor_002c-bitwise-2089"></a><a name="index-bitwise-inclusive_002dor-2090"></a><br><dt><code>(ior:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Represents the bitwise inclusive-or of the values represented by <var>x</var>
|
||||
and <var>y</var>, carried out in machine mode <var>m</var>, which must be a
|
||||
fixed-point mode.
|
||||
|
||||
<p><a name="index-xor-2091"></a><a name="index-exclusive_002dor_002c-bitwise-2092"></a><a name="index-bitwise-exclusive_002dor-2093"></a><br><dt><code>(xor:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Represents the bitwise exclusive-or of the values represented by <var>x</var>
|
||||
and <var>y</var>, carried out in machine mode <var>m</var>, which must be a
|
||||
fixed-point mode.
|
||||
|
||||
<p><a name="index-ashift-2094"></a><a name="index-ss_005fashift-2095"></a><a name="index-us_005fashift-2096"></a><a name="index-left-shift-2097"></a><a name="index-shift-2098"></a><a name="index-arithmetic-shift-2099"></a><a name="index-arithmetic-shift-with-signed-saturation-2100"></a><a name="index-arithmetic-shift-with-unsigned-saturation-2101"></a><br><dt><code>(ashift:</code><var>m</var> <var>x</var> <var>c</var><code>)</code><dt><code>(ss_ashift:</code><var>m</var> <var>x</var> <var>c</var><code>)</code><dt><code>(us_ashift:</code><var>m</var> <var>x</var> <var>c</var><code>)</code><dd>These three expressions represent the result of arithmetically shifting <var>x</var>
|
||||
left by <var>c</var> places. They differ in their behavior on overflow of integer
|
||||
modes. An <code>ashift</code> operation is a plain shift with no special behavior
|
||||
in case of a change in the sign bit; <code>ss_ashift</code> and <code>us_ashift</code>
|
||||
saturates to the minimum or maximum representable value if any of the bits
|
||||
shifted out differs from the final sign bit.
|
||||
|
||||
<p><var>x</var> have mode <var>m</var>, a fixed-point machine mode. <var>c</var>
|
||||
be a fixed-point mode or be a constant with mode <code>VOIDmode</code>; which
|
||||
mode is determined by the mode called for in the machine description
|
||||
entry for the left-shift instruction. For example, on the VAX, the mode
|
||||
of <var>c</var> is <code>QImode</code> regardless of <var>m</var>.
|
||||
|
||||
<p><a name="index-lshiftrt-2102"></a><a name="index-right-shift-2103"></a><a name="index-ashiftrt-2104"></a><br><dt><code>(lshiftrt:</code><var>m</var> <var>x</var> <var>c</var><code>)</code><dt><code>(ashiftrt:</code><var>m</var> <var>x</var> <var>c</var><code>)</code><dd>Like <code>ashift</code> but for right shift. Unlike the case for left shift,
|
||||
these two operations are distinct.
|
||||
|
||||
<p><a name="index-rotate-2105"></a><a name="index-rotate-2106"></a><a name="index-left-rotate-2107"></a><a name="index-rotatert-2108"></a><a name="index-right-rotate-2109"></a><br><dt><code>(rotate:</code><var>m</var> <var>x</var> <var>c</var><code>)</code><dt><code>(rotatert:</code><var>m</var> <var>x</var> <var>c</var><code>)</code><dd>Similar but represent left and right rotate. If <var>c</var> is a constant,
|
||||
use <code>rotate</code>.
|
||||
|
||||
<p><a name="index-abs-2110"></a><a name="index-ss_005fabs-2111"></a><a name="index-absolute-value-2112"></a><br><dt><code>(abs:</code><var>m</var> <var>x</var><code>)</code><br><dt><code>(ss_abs:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the absolute value of <var>x</var>, computed in mode <var>m</var>.
|
||||
<code>ss_abs</code> ensures that an out-of-bounds result saturates to the
|
||||
maximum signed value.
|
||||
|
||||
<p><a name="index-sqrt-2113"></a><a name="index-square-root-2114"></a><br><dt><code>(sqrt:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the square root of <var>x</var>, computed in mode <var>m</var>.
|
||||
Most often <var>m</var> will be a floating point mode.
|
||||
|
||||
<p><a name="index-ffs-2115"></a><br><dt><code>(ffs:</code><var>m</var> <var>x</var><code>)</code><dd>Represents one plus the index of the least significant 1-bit in
|
||||
<var>x</var>, represented as an integer of mode <var>m</var>. (The value is
|
||||
zero if <var>x</var> is zero.) The mode of <var>x</var> must be <var>m</var>
|
||||
or <code>VOIDmode</code>.
|
||||
|
||||
<p><a name="index-clrsb-2116"></a><br><dt><code>(clrsb:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the number of redundant leading sign bits in <var>x</var>,
|
||||
represented as an integer of mode <var>m</var>, starting at the most
|
||||
significant bit position. This is one less than the number of leading
|
||||
sign bits (either 0 or 1), with no special cases. The mode of <var>x</var>
|
||||
must be <var>m</var> or <code>VOIDmode</code>.
|
||||
|
||||
<p><a name="index-clz-2117"></a><br><dt><code>(clz:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the number of leading 0-bits in <var>x</var>, represented as an
|
||||
integer of mode <var>m</var>, starting at the most significant bit position.
|
||||
If <var>x</var> is zero, the value is determined by
|
||||
<code>CLZ_DEFINED_VALUE_AT_ZERO</code> (see <a href="Misc.html#Misc">Misc</a>). Note that this is one of
|
||||
the few expressions that is not invariant under widening. The mode of
|
||||
<var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
|
||||
|
||||
<p><a name="index-ctz-2118"></a><br><dt><code>(ctz:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the number of trailing 0-bits in <var>x</var>, represented as an
|
||||
integer of mode <var>m</var>, starting at the least significant bit position.
|
||||
If <var>x</var> is zero, the value is determined by
|
||||
<code>CTZ_DEFINED_VALUE_AT_ZERO</code> (see <a href="Misc.html#Misc">Misc</a>). Except for this case,
|
||||
<code>ctz(x)</code> is equivalent to <code>ffs(</code><var>x</var><code>) - 1</code>. The mode of
|
||||
<var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
|
||||
|
||||
<p><a name="index-popcount-2119"></a><br><dt><code>(popcount:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the number of 1-bits in <var>x</var>, represented as an integer of
|
||||
mode <var>m</var>. The mode of <var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
|
||||
|
||||
<p><a name="index-parity-2120"></a><br><dt><code>(parity:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the number of 1-bits modulo 2 in <var>x</var>, represented as an
|
||||
integer of mode <var>m</var>. The mode of <var>x</var> must be <var>m</var> or
|
||||
<code>VOIDmode</code>.
|
||||
|
||||
<p><a name="index-bswap-2121"></a><br><dt><code>(bswap:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the value <var>x</var> with the order of bytes reversed, carried out
|
||||
in mode <var>m</var>, which must be a fixed-point machine mode.
|
||||
The mode of <var>x</var> must be <var>m</var> or <code>VOIDmode</code>.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Assembler Format - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="PIC.html#PIC" title="PIC">
|
||||
<link rel="next" href="Debugging-Info.html#Debugging-Info" title="Debugging Info">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Assembler-Format"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Debugging-Info.html#Debugging-Info">Debugging Info</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="PIC.html#PIC">PIC</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.21 Defining the Output Assembler Language</h3>
|
||||
|
||||
<p>This section describes macros whose principal purpose is to describe how
|
||||
to write instructions in assembler language—rather than what the
|
||||
instructions do.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="File-Framework.html#File-Framework">File Framework</a>: Structural information for the assembler file.
|
||||
<li><a accesskey="2" href="Data-Output.html#Data-Output">Data Output</a>: Output of constants (numbers, strings, addresses).
|
||||
<li><a accesskey="3" href="Uninitialized-Data.html#Uninitialized-Data">Uninitialized Data</a>: Output of uninitialized variables.
|
||||
<li><a accesskey="4" href="Label-Output.html#Label-Output">Label Output</a>: Output and generation of labels.
|
||||
<li><a accesskey="5" href="Initialization.html#Initialization">Initialization</a>: General principles of initialization
|
||||
and termination routines.
|
||||
<li><a accesskey="6" href="Macros-for-Initialization.html#Macros-for-Initialization">Macros for Initialization</a>
|
||||
Specific macros that control the handling of
|
||||
initialization and termination routines.
|
||||
<li><a accesskey="7" href="Instruction-Output.html#Instruction-Output">Instruction Output</a>: Output of actual instructions.
|
||||
<li><a accesskey="8" href="Dispatch-Tables.html#Dispatch-Tables">Dispatch Tables</a>: Output of jump tables.
|
||||
<li><a accesskey="9" href="Exception-Region-Output.html#Exception-Region-Output">Exception Region Output</a>: Output of exception region code.
|
||||
<li><a href="Alignment-Output.html#Alignment-Output">Alignment Output</a>: Pseudo ops for alignment and skipping data.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Assembler - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Incdec.html#Incdec" title="Incdec">
|
||||
<link rel="next" href="Debug-Information.html#Debug-Information" title="Debug Information">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Assembler"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Debug-Information.html#Debug-Information">Debug Information</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Incdec.html#Incdec">Incdec</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.17 Assembler Instructions as Expressions</h3>
|
||||
|
||||
<p><a name="index-assembler-instructions-in-RTL-2208"></a>
|
||||
<a name="index-g_t_0040code_007basm_005foperands_007d_002c-usage-2209"></a>The RTX code <code>asm_operands</code> represents a value produced by a
|
||||
user-specified assembler instruction. It is used to represent
|
||||
an <code>asm</code> statement with arguments. An <code>asm</code> statement with
|
||||
a single output operand, like this:
|
||||
|
||||
<pre class="smallexample"> asm ("foo %1,%2,%0" : "=a" (outputvar) : "g" (x + y), "di" (*z));
|
||||
</pre>
|
||||
<p class="noindent">is represented using a single <code>asm_operands</code> RTX which represents
|
||||
the value that is stored in <code>outputvar</code>:
|
||||
|
||||
<pre class="smallexample"> (set <var>rtx-for-outputvar</var>
|
||||
(asm_operands "foo %1,%2,%0" "a" 0
|
||||
[<var>rtx-for-addition-result</var> <var>rtx-for-*z</var>]
|
||||
[(asm_input:<var>m1</var> "g")
|
||||
(asm_input:<var>m2</var> "di")]))
|
||||
</pre>
|
||||
<p class="noindent">Here the operands of the <code>asm_operands</code> RTX are the assembler
|
||||
template string, the output-operand's constraint, the index-number of the
|
||||
output operand among the output operands specified, a vector of input
|
||||
operand RTX's, and a vector of input-operand modes and constraints. The
|
||||
mode <var>m1</var> is the mode of the sum <code>x+y</code>; <var>m2</var> is that of
|
||||
<code>*z</code>.
|
||||
|
||||
<p>When an <code>asm</code> statement has multiple output values, its insn has
|
||||
several such <code>set</code> RTX's inside of a <code>parallel</code>. Each <code>set</code>
|
||||
contains an <code>asm_operands</code>; all of these share the same assembler
|
||||
template and vectors, but each contains the constraint for the respective
|
||||
output operand. They are also distinguished by the output-operand index
|
||||
number, which is 0, 1, <small class="dots">...</small> for successive output operands.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Attr Example - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Insn-Attributes.html#Insn-Attributes" title="Insn Attributes">
|
||||
<link rel="prev" href="Tagging-Insns.html#Tagging-Insns" title="Tagging Insns">
|
||||
<link rel="next" href="Insn-Lengths.html#Insn-Lengths" title="Insn Lengths">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Attr-Example"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Insn-Lengths.html#Insn-Lengths">Insn Lengths</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Tagging-Insns.html#Tagging-Insns">Tagging Insns</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.19.4 Example of Attribute Specifications</h4>
|
||||
|
||||
<p><a name="index-attribute-specifications-example-3705"></a><a name="index-attribute-specifications-3706"></a>
|
||||
The judicious use of defaulting is important in the efficient use of
|
||||
insn attributes. Typically, insns are divided into <dfn>types</dfn> and an
|
||||
attribute, customarily called <code>type</code>, is used to represent this
|
||||
value. This attribute is normally used only to define the default value
|
||||
for other attributes. An example will clarify this usage.
|
||||
|
||||
<p>Assume we have a RISC machine with a condition code and in which only
|
||||
full-word operations are performed in registers. Let us assume that we
|
||||
can divide all insns into loads, stores, (integer) arithmetic
|
||||
operations, floating point operations, and branches.
|
||||
|
||||
<p>Here we will concern ourselves with determining the effect of an insn on
|
||||
the condition code and will limit ourselves to the following possible
|
||||
effects: The condition code can be set unpredictably (clobbered), not
|
||||
be changed, be set to agree with the results of the operation, or only
|
||||
changed if the item previously set into the condition code has been
|
||||
modified.
|
||||
|
||||
<p>Here is part of a sample <samp><span class="file">md</span></samp> file for such a machine:
|
||||
|
||||
<pre class="smallexample"> (define_attr "type" "load,store,arith,fp,branch" (const_string "arith"))
|
||||
|
||||
(define_attr "cc" "clobber,unchanged,set,change0"
|
||||
(cond [(eq_attr "type" "load")
|
||||
(const_string "change0")
|
||||
(eq_attr "type" "store,branch")
|
||||
(const_string "unchanged")
|
||||
(eq_attr "type" "arith")
|
||||
(if_then_else (match_operand:SI 0 "" "")
|
||||
(const_string "set")
|
||||
(const_string "clobber"))]
|
||||
(const_string "clobber")))
|
||||
|
||||
(define_insn ""
|
||||
[(set (match_operand:SI 0 "general_operand" "=r,r,m")
|
||||
(match_operand:SI 1 "general_operand" "r,m,r"))]
|
||||
""
|
||||
"@
|
||||
move %0,%1
|
||||
load %0,%1
|
||||
store %0,%1"
|
||||
[(set_attr "type" "arith,load,store")])
|
||||
</pre>
|
||||
<p>Note that we assume in the above example that arithmetic operations
|
||||
performed on quantities smaller than a machine word clobber the condition
|
||||
code since they will set the condition code to a value corresponding to the
|
||||
full-word result.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Attributes - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="GENERIC.html#GENERIC" title="GENERIC">
|
||||
<link rel="prev" href="Declarations.html#Declarations" title="Declarations">
|
||||
<link rel="next" href="Expression-trees.html#Expression-trees" title="Expression trees">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Attributes"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Expression-trees.html#Expression-trees">Expression trees</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Declarations.html#Declarations">Declarations</a>,
|
||||
Up: <a rel="up" accesskey="u" href="GENERIC.html#GENERIC">GENERIC</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">11.5 Attributes in trees</h3>
|
||||
|
||||
<p><a name="index-attributes-2406"></a>
|
||||
Attributes, as specified using the <code>__attribute__</code> keyword, are
|
||||
represented internally as a <code>TREE_LIST</code>. The <code>TREE_PURPOSE</code>
|
||||
is the name of the attribute, as an <code>IDENTIFIER_NODE</code>. The
|
||||
<code>TREE_VALUE</code> is a <code>TREE_LIST</code> of the arguments of the
|
||||
attribute, if any, or <code>NULL_TREE</code> if there are no arguments; the
|
||||
arguments are stored as the <code>TREE_VALUE</code> of successive entries in
|
||||
the list, and may be identifiers or expressions. The <code>TREE_CHAIN</code>
|
||||
of the attribute is the next attribute in a list of attributes applying
|
||||
to the same declaration or type, or <code>NULL_TREE</code> if there are no
|
||||
further attributes in the list.
|
||||
|
||||
<p>Attributes may be attached to declarations and to types; these
|
||||
attributes may be accessed with the following macros. All attributes
|
||||
are stored in this way, and many also cause other changes to the
|
||||
declaration or type or to other internal compiler data structures.
|
||||
|
||||
<div class="defun">
|
||||
— Tree Macro: tree <b>DECL_ATTRIBUTES</b> (<var>tree decl</var>)<var><a name="index-DECL_005fATTRIBUTES-2407"></a></var><br>
|
||||
<blockquote><p>This macro returns the attributes on the declaration <var>decl</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Tree Macro: tree <b>TYPE_ATTRIBUTES</b> (<var>tree type</var>)<var><a name="index-TYPE_005fATTRIBUTES-2408"></a></var><br>
|
||||
<blockquote><p>This macro returns the attributes on the type <var>type</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<!-- -->
|
||||
<!-- Expressions -->
|
||||
<!-- -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Back End - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="gcc-Directory.html#gcc-Directory" title="gcc Directory">
|
||||
<link rel="prev" href="Front-End.html#Front-End" title="Front End">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Back-End"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Front-End.html#Front-End">Front End</a>,
|
||||
Up: <a rel="up" accesskey="u" href="gcc-Directory.html#gcc-Directory">gcc Directory</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">6.3.9 Anatomy of a Target Back End</h4>
|
||||
|
||||
<p>A back end for a target architecture in GCC has the following parts:
|
||||
|
||||
<ul>
|
||||
<li>A directory <samp><var>machine</var></samp> under <samp><span class="file">gcc/config</span></samp>, containing a
|
||||
machine description <samp><var>machine</var><span class="file">.md</span></samp> file (see <a href="Machine-Desc.html#Machine-Desc">Machine Descriptions</a>), header files <samp><var>machine</var><span class="file">.h</span></samp> and
|
||||
<samp><var>machine</var><span class="file">-protos.h</span></samp> and a source file <samp><var>machine</var><span class="file">.c</span></samp>
|
||||
(see <a href="Target-Macros.html#Target-Macros">Target Description Macros and Functions</a>),
|
||||
possibly a target Makefile fragment <samp><span class="file">t-</span><var>machine</var></samp>
|
||||
(see <a href="Target-Fragment.html#Target-Fragment">The Target Makefile Fragment</a>), and maybe
|
||||
some other files. The names of these files may be changed from the
|
||||
defaults given by explicit specifications in <samp><span class="file">config.gcc</span></samp>.
|
||||
<li>If necessary, a file <samp><var>machine</var><span class="file">-modes.def</span></samp> in the
|
||||
<samp><var>machine</var></samp> directory, containing additional machine modes to
|
||||
represent condition codes. See <a href="Condition-Code.html#Condition-Code">Condition Code</a>, for further details.
|
||||
<li>An optional <samp><var>machine</var><span class="file">.opt</span></samp> file in the <samp><var>machine</var></samp>
|
||||
directory, containing a list of target-specific options. You can also
|
||||
add other option files using the <code>extra_options</code> variable in
|
||||
<samp><span class="file">config.gcc</span></samp>. See <a href="Options.html#Options">Options</a>.
|
||||
<li>Entries in <samp><span class="file">config.gcc</span></samp> (see <a href="System-Config.html#System-Config">The <samp><span class="file">config.gcc</span></samp> File</a>) for the systems with this target
|
||||
architecture.
|
||||
<li>Documentation in <samp><span class="file">gcc/doc/invoke.texi</span></samp> for any command-line
|
||||
options supported by this target (see <a href="Run_002dtime-Target.html#Run_002dtime-Target">Run-time Target Specification</a>). This means both entries in the summary table
|
||||
of options and details of the individual options.
|
||||
<li>Documentation in <samp><span class="file">gcc/doc/extend.texi</span></samp> for any target-specific
|
||||
attributes supported (see <a href="Target-Attributes.html#Target-Attributes">Defining target-specific uses of <code>__attribute__</code></a>), including where the
|
||||
same attribute is already supported on some targets, which are
|
||||
enumerated in the manual.
|
||||
<li>Documentation in <samp><span class="file">gcc/doc/extend.texi</span></samp> for any target-specific
|
||||
pragmas supported.
|
||||
<li>Documentation in <samp><span class="file">gcc/doc/extend.texi</span></samp> of any target-specific
|
||||
built-in functions supported.
|
||||
<li>Documentation in <samp><span class="file">gcc/doc/extend.texi</span></samp> of any target-specific
|
||||
format checking styles supported.
|
||||
<li>Documentation in <samp><span class="file">gcc/doc/md.texi</span></samp> of any target-specific
|
||||
constraint letters (see <a href="Machine-Constraints.html#Machine-Constraints">Constraints for Particular Machines</a>).
|
||||
<li>A note in <samp><span class="file">gcc/doc/contrib.texi</span></samp> under the person or people who
|
||||
contributed the target support.
|
||||
<li>Entries in <samp><span class="file">gcc/doc/install.texi</span></samp> for all target triplets
|
||||
supported with this target architecture, giving details of any special
|
||||
notes about installation for this target, or saying that there are no
|
||||
special notes if there are none.
|
||||
<li>Possibly other support outside the <samp><span class="file">gcc</span></samp> directory for runtime
|
||||
libraries. FIXME: reference docs for this. The <code>libstdc++</code> porting
|
||||
manual needs to be installed as info for this to work, or to be a
|
||||
chapter of this manual.
|
||||
</ul>
|
||||
|
||||
<p>If the back end is added to the official GCC source repository, the
|
||||
following are also necessary:
|
||||
|
||||
<ul>
|
||||
<li>An entry for the target architecture in <samp><span class="file">readings.html</span></samp> on the
|
||||
GCC web site, with any relevant links.
|
||||
<li>Details of the properties of the back end and target architecture in
|
||||
<samp><span class="file">backends.html</span></samp> on the GCC web site.
|
||||
<li>A news item about the contribution of support for that target
|
||||
architecture, in <samp><span class="file">index.html</span></samp> on the GCC web site.
|
||||
<li>Normally, one or more maintainers of that target listed in
|
||||
<samp><span class="file">MAINTAINERS</span></samp>. Some existing architectures may be unmaintained,
|
||||
but it would be unusual to add support for a target that does not have
|
||||
a maintainer when support is added.
|
||||
<li>Target triplets covering all <samp><span class="file">config.gcc</span></samp> stanzas for the target,
|
||||
in the list in <samp><span class="file">contrib/config-list.mk</span></samp>.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,164 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Basic Blocks - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Control-Flow.html#Control-Flow" title="Control Flow">
|
||||
<link rel="next" href="Edges.html#Edges" title="Edges">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Basic-Blocks"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Edges.html#Edges">Edges</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Control-Flow.html#Control-Flow">Control Flow</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">15.1 Basic Blocks</h3>
|
||||
|
||||
<p><a name="index-basic-block-3122"></a><a name="index-basic_005fblock-3123"></a>A basic block is a straight-line sequence of code with only one entry
|
||||
point and only one exit. In GCC, basic blocks are represented using
|
||||
the <code>basic_block</code> data type.
|
||||
|
||||
<p><a name="index-ENTRY_005fBLOCK_005fPTR_002c-EXIT_005fBLOCK_005fPTR-3124"></a>Special basic blocks represent possible entry and exit points of a
|
||||
function. These blocks are called <code>ENTRY_BLOCK_PTR</code> and
|
||||
<code>EXIT_BLOCK_PTR</code>. These blocks do not contain any code.
|
||||
|
||||
<p><a name="index-BASIC_005fBLOCK-3125"></a>The <code>BASIC_BLOCK</code> array contains all basic blocks in an
|
||||
unspecified order. Each <code>basic_block</code> structure has a field
|
||||
that holds a unique integer identifier <code>index</code> that is the
|
||||
index of the block in the <code>BASIC_BLOCK</code> array.
|
||||
The total number of basic blocks in the function is
|
||||
<code>n_basic_blocks</code>. Both the basic block indices and
|
||||
the total number of basic blocks may vary during the compilation
|
||||
process, as passes reorder, create, duplicate, and destroy basic
|
||||
blocks. The index for any block should never be greater than
|
||||
<code>last_basic_block</code>. The indices 0 and 1 are special codes
|
||||
reserved for <code>ENTRY_BLOCK</code> and <code>EXIT_BLOCK</code>, the
|
||||
indices of <code>ENTRY_BLOCK_PTR</code> and <code>EXIT_BLOCK_PTR</code>.
|
||||
|
||||
<p><a name="index-next_005fbb_002c-prev_005fbb_002c-FOR_005fEACH_005fBB_002c-FOR_005fALL_005fBB-3126"></a>Two pointer members of the <code>basic_block</code> structure are the
|
||||
pointers <code>next_bb</code> and <code>prev_bb</code>. These are used to keep
|
||||
doubly linked chain of basic blocks in the same order as the
|
||||
underlying instruction stream. The chain of basic blocks is updated
|
||||
transparently by the provided API for manipulating the CFG. The macro
|
||||
<code>FOR_EACH_BB</code> can be used to visit all the basic blocks in
|
||||
lexicographical order, except <code>ENTRY_BLOCK</code> and <code>EXIT_BLOCK</code>.
|
||||
The macro <code>FOR_ALL_BB</code> also visits all basic blocks in
|
||||
lexicographical order, including <code>ENTRY_BLOCK</code> and <code>EXIT_BLOCK</code>.
|
||||
|
||||
<p><a name="index-post_005forder_005fcompute_002c-inverted_005fpost_005forder_005fcompute_002c-walk_005fdominator_005ftree-3127"></a>The functions <code>post_order_compute</code> and <code>inverted_post_order_compute</code>
|
||||
can be used to compute topological orders of the CFG. The orders are
|
||||
stored as vectors of basic block indices. The <code>BASIC_BLOCK</code> array
|
||||
can be used to iterate each basic block by index.
|
||||
Dominator traversals are also possible using
|
||||
<code>walk_dominator_tree</code>. Given two basic blocks A and B, block A
|
||||
dominates block B if A is <em>always</em> executed before B.
|
||||
|
||||
<p>Each <code>basic_block</code> also contains pointers to the first
|
||||
instruction (the <dfn>head</dfn>) and the last instruction (the <dfn>tail</dfn>)
|
||||
or <dfn>end</dfn> of the instruction stream contained in a basic block. In
|
||||
fact, since the <code>basic_block</code> data type is used to represent
|
||||
blocks in both major intermediate representations of GCC (<code>GIMPLE</code>
|
||||
and RTL), there are pointers to the head and end of a basic block for
|
||||
both representations, stored in intermediate representation specific
|
||||
data in the <code>il</code> field of <code>struct basic_block_def</code>.
|
||||
|
||||
<p><a name="index-CODE_005fLABEL-3128"></a><a name="index-NOTE_005fINSN_005fBASIC_005fBLOCK-3129"></a>For RTL, these pointers are <code>BB_HEAD</code> and <code>BB_END</code>.
|
||||
|
||||
<p><a name="index-insn-notes_002c-notes-3130"></a><a name="index-NOTE_005fINSN_005fBASIC_005fBLOCK-3131"></a>In the RTL representation of a function, the instruction stream
|
||||
contains not only the “real” instructions, but also <dfn>notes</dfn>
|
||||
or <dfn>insn notes</dfn> (to distinguish them from <dfn>reg notes</dfn>).
|
||||
Any function that moves or duplicates the basic blocks needs
|
||||
to take care of updating of these notes. Many of these notes expect
|
||||
that the instruction stream consists of linear regions, so updating
|
||||
can sometimes be tedious. All types of insn notes are defined
|
||||
in <samp><span class="file">insn-notes.def</span></samp>.
|
||||
|
||||
<p>In the RTL function representation, the instructions contained in a
|
||||
basic block always follow a <code>NOTE_INSN_BASIC_BLOCK</code>, but zero
|
||||
or more <code>CODE_LABEL</code> nodes can precede the block note.
|
||||
A basic block ends with a control flow instruction or with the last
|
||||
instruction before the next <code>CODE_LABEL</code> or
|
||||
<code>NOTE_INSN_BASIC_BLOCK</code>.
|
||||
By definition, a <code>CODE_LABEL</code> cannot appear in the middle of
|
||||
the instruction stream of a basic block.
|
||||
|
||||
<p><a name="index-can_005ffallthru-3132"></a><a name="index-table-jump-3133"></a>In addition to notes, the jump table vectors are also represented as
|
||||
“pseudo-instructions” inside the insn stream. These vectors never
|
||||
appear in the basic block and should always be placed just after the
|
||||
table jump instructions referencing them. After removing the
|
||||
table-jump it is often difficult to eliminate the code computing the
|
||||
address and referencing the vector, so cleaning up these vectors is
|
||||
postponed until after liveness analysis. Thus the jump table vectors
|
||||
may appear in the insn stream unreferenced and without any purpose.
|
||||
Before any edge is made <dfn>fall-thru</dfn>, the existence of such
|
||||
construct in the way needs to be checked by calling
|
||||
<code>can_fallthru</code> function.
|
||||
|
||||
<p><a name="index-GIMPLE-statement-iterators-3134"></a>For the <code>GIMPLE</code> representation, the PHI nodes and statements
|
||||
contained in a basic block are in a <code>gimple_seq</code> pointed to by
|
||||
the basic block intermediate language specific pointers.
|
||||
Abstract containers and iterators are used to access the PHI nodes
|
||||
and statements in a basic blocks. These iterators are called
|
||||
<dfn>GIMPLE statement iterators</dfn> (GSIs). Grep for <code>^gsi</code>
|
||||
in the various <samp><span class="file">gimple-*</span></samp> and <samp><span class="file">tree-*</span></samp> files.
|
||||
The following snippet will pretty-print all PHI nodes the statements
|
||||
of the current function in the GIMPLE representation.
|
||||
|
||||
<pre class="smallexample"> basic_block bb;
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
gimple_stmt_iterator si;
|
||||
|
||||
for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
|
||||
{
|
||||
gimple phi = gsi_stmt (si);
|
||||
print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
|
||||
}
|
||||
for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
|
||||
{
|
||||
gimple stmt = gsi_stmt (si);
|
||||
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Basic Statements - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Statements.html#Statements" title="Statements">
|
||||
<link rel="next" href="Blocks.html#Blocks" title="Blocks">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Basic-Statements"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Blocks.html#Blocks">Blocks</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Statements.html#Statements">Statements</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.7.1 Basic Statements</h4>
|
||||
|
||||
<p><a name="index-Basic-Statements-2519"></a>
|
||||
<dl>
|
||||
<dt><code>ASM_EXPR</code><dd>
|
||||
Used to represent an inline assembly statement. For an inline assembly
|
||||
statement like:
|
||||
<pre class="smallexample"> asm ("mov x, y");
|
||||
</pre>
|
||||
<p>The <code>ASM_STRING</code> macro will return a <code>STRING_CST</code> node for
|
||||
<code>"mov x, y"</code>. If the original statement made use of the
|
||||
extended-assembly syntax, then <code>ASM_OUTPUTS</code>,
|
||||
<code>ASM_INPUTS</code>, and <code>ASM_CLOBBERS</code> will be the outputs, inputs,
|
||||
and clobbers for the statement, represented as <code>STRING_CST</code> nodes.
|
||||
The extended-assembly syntax looks like:
|
||||
<pre class="smallexample"> asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
|
||||
</pre>
|
||||
<p>The first string is the <code>ASM_STRING</code>, containing the instruction
|
||||
template. The next two strings are the output and inputs, respectively;
|
||||
this statement has no clobbers. As this example indicates, “plain”
|
||||
assembly statements are merely a special case of extended assembly
|
||||
statements; they have no cv-qualifiers, outputs, inputs, or clobbers.
|
||||
All of the strings will be <code>NUL</code>-terminated, and will contain no
|
||||
embedded <code>NUL</code>-characters.
|
||||
|
||||
<p>If the assembly statement is declared <code>volatile</code>, or if the
|
||||
statement was not an extended assembly statement, and is therefore
|
||||
implicitly volatile, then the predicate <code>ASM_VOLATILE_P</code> will hold
|
||||
of the <code>ASM_EXPR</code>.
|
||||
|
||||
<br><dt><code>DECL_EXPR</code><dd>
|
||||
Used to represent a local declaration. The <code>DECL_EXPR_DECL</code> macro
|
||||
can be used to obtain the entity declared. This declaration may be a
|
||||
<code>LABEL_DECL</code>, indicating that the label declared is a local label.
|
||||
(As an extension, GCC allows the declaration of labels with scope.) In
|
||||
C, this declaration may be a <code>FUNCTION_DECL</code>, indicating the
|
||||
use of the GCC nested function extension. For more information,
|
||||
see <a href="Functions.html#Functions">Functions</a>.
|
||||
|
||||
<br><dt><code>LABEL_EXPR</code><dd>
|
||||
Used to represent a label. The <code>LABEL_DECL</code> declared by this
|
||||
statement can be obtained with the <code>LABEL_EXPR_LABEL</code> macro. The
|
||||
<code>IDENTIFIER_NODE</code> giving the name of the label can be obtained from
|
||||
the <code>LABEL_DECL</code> with <code>DECL_NAME</code>.
|
||||
|
||||
<br><dt><code>GOTO_EXPR</code><dd>
|
||||
Used to represent a <code>goto</code> statement. The <code>GOTO_DESTINATION</code> will
|
||||
usually be a <code>LABEL_DECL</code>. However, if the “computed goto” extension
|
||||
has been used, the <code>GOTO_DESTINATION</code> will be an arbitrary expression
|
||||
indicating the destination. This expression will always have pointer type.
|
||||
|
||||
<br><dt><code>RETURN_EXPR</code><dd>
|
||||
Used to represent a <code>return</code> statement. Operand 0 represents the
|
||||
value to return. It should either be the <code>RESULT_DECL</code> for the
|
||||
containing function, or a <code>MODIFY_EXPR</code> or <code>INIT_EXPR</code>
|
||||
setting the function's <code>RESULT_DECL</code>. It will be
|
||||
<code>NULL_TREE</code> if the statement was just
|
||||
<pre class="smallexample"> return;
|
||||
</pre>
|
||||
<br><dt><code>LOOP_EXPR</code><dd>These nodes represent “infinite” loops. The <code>LOOP_EXPR_BODY</code>
|
||||
represents the body of the loop. It should be executed forever, unless
|
||||
an <code>EXIT_EXPR</code> is encountered.
|
||||
|
||||
<br><dt><code>EXIT_EXPR</code><dd>These nodes represent conditional exits from the nearest enclosing
|
||||
<code>LOOP_EXPR</code>. The single operand is the condition; if it is
|
||||
nonzero, then the loop should be exited. An <code>EXIT_EXPR</code> will only
|
||||
appear within a <code>LOOP_EXPR</code>.
|
||||
|
||||
<br><dt><code>SWITCH_STMT</code><dd>
|
||||
Used to represent a <code>switch</code> statement. The <code>SWITCH_STMT_COND</code>
|
||||
is the expression on which the switch is occurring. See the documentation
|
||||
for an <code>IF_STMT</code> for more information on the representation used
|
||||
for the condition. The <code>SWITCH_STMT_BODY</code> is the body of the switch
|
||||
statement. The <code>SWITCH_STMT_TYPE</code> is the original type of switch
|
||||
expression as given in the source, before any compiler conversions.
|
||||
|
||||
<br><dt><code>CASE_LABEL_EXPR</code><dd>
|
||||
Use to represent a <code>case</code> label, range of <code>case</code> labels, or a
|
||||
<code>default</code> label. If <code>CASE_LOW</code> is <code>NULL_TREE</code>, then this is a
|
||||
<code>default</code> label. Otherwise, if <code>CASE_HIGH</code> is <code>NULL_TREE</code>, then
|
||||
this is an ordinary <code>case</code> label. In this case, <code>CASE_LOW</code> is
|
||||
an expression giving the value of the label. Both <code>CASE_LOW</code> and
|
||||
<code>CASE_HIGH</code> are <code>INTEGER_CST</code> nodes. These values will have
|
||||
the same type as the condition expression in the switch statement.
|
||||
|
||||
<p>Otherwise, if both <code>CASE_LOW</code> and <code>CASE_HIGH</code> are defined, the
|
||||
statement is a range of case labels. Such statements originate with the
|
||||
extension that allows users to write things of the form:
|
||||
<pre class="smallexample"> case 2 ... 5:
|
||||
</pre>
|
||||
<p>The first value will be <code>CASE_LOW</code>, while the second will be
|
||||
<code>CASE_HIGH</code>.
|
||||
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Bit-Fields - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Comparisons.html#Comparisons" title="Comparisons">
|
||||
<link rel="next" href="Vector-Operations.html#Vector-Operations" title="Vector Operations">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Bit-Fields"></a>
|
||||
<a name="Bit_002dFields"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Vector-Operations.html#Vector-Operations">Vector Operations</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Comparisons.html#Comparisons">Comparisons</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.11 Bit-Fields</h3>
|
||||
|
||||
<p><a name="index-bit_002dfields-2147"></a>
|
||||
Special expression codes exist to represent bit-field instructions.
|
||||
|
||||
|
||||
<a name="index-sign_005fextract-2148"></a>
|
||||
<a name="index-g_t_0040code_007bBITS_005fBIG_005fENDIAN_007d_002c-effect-on-_0040code_007bsign_005fextract_007d-2149"></a>
|
||||
<dl><dt><code>(sign_extract:</code><var>m</var> <var>loc</var> <var>size</var> <var>pos</var><code>)</code><dd>This represents a reference to a sign-extended bit-field contained or
|
||||
starting in <var>loc</var> (a memory or register reference). The bit-field
|
||||
is <var>size</var> bits wide and starts at bit <var>pos</var>. The compilation
|
||||
option <code>BITS_BIG_ENDIAN</code> says which end of the memory unit
|
||||
<var>pos</var> counts from.
|
||||
|
||||
<p>If <var>loc</var> is in memory, its mode must be a single-byte integer mode.
|
||||
If <var>loc</var> is in a register, the mode to use is specified by the
|
||||
operand of the <code>insv</code> or <code>extv</code> pattern
|
||||
(see <a href="Standard-Names.html#Standard-Names">Standard Names</a>) and is usually a full-word integer mode,
|
||||
which is the default if none is specified.
|
||||
|
||||
<p>The mode of <var>pos</var> is machine-specific and is also specified
|
||||
in the <code>insv</code> or <code>extv</code> pattern.
|
||||
|
||||
<p>The mode <var>m</var> is the same as the mode that would be used for
|
||||
<var>loc</var> if it were a register.
|
||||
|
||||
<p>A <code>sign_extract</code> can not appear as an lvalue, or part thereof,
|
||||
in RTL.
|
||||
|
||||
<p><a name="index-zero_005fextract-2150"></a><br><dt><code>(zero_extract:</code><var>m</var> <var>loc</var> <var>size</var> <var>pos</var><code>)</code><dd>Like <code>sign_extract</code> but refers to an unsigned or zero-extended
|
||||
bit-field. The same sequence of bits are extracted, but they
|
||||
are filled to an entire word with zeros instead of by sign-extension.
|
||||
|
||||
<p>Unlike <code>sign_extract</code>, this type of expressions can be lvalues
|
||||
in RTL; they may appear on the left side of an assignment, indicating
|
||||
insertion of a value into the specified bit-field.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Blocks - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Statements.html#Statements" title="Statements">
|
||||
<link rel="prev" href="Basic-Statements.html#Basic-Statements" title="Basic Statements">
|
||||
<link rel="next" href="Statement-Sequences.html#Statement-Sequences" title="Statement Sequences">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Blocks"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Statement-Sequences.html#Statement-Sequences">Statement Sequences</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Basic-Statements.html#Basic-Statements">Basic Statements</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Statements.html#Statements">Statements</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.7.2 Blocks</h4>
|
||||
|
||||
<p><a name="index-Blocks-2520"></a>
|
||||
Block scopes and the variables they declare in GENERIC are
|
||||
expressed using the <code>BIND_EXPR</code> code, which in previous
|
||||
versions of GCC was primarily used for the C statement-expression
|
||||
extension.
|
||||
|
||||
<p>Variables in a block are collected into <code>BIND_EXPR_VARS</code> in
|
||||
declaration order through their <code>TREE_CHAIN</code> field. Any runtime
|
||||
initialization is moved out of <code>DECL_INITIAL</code> and into a
|
||||
statement in the controlled block. When gimplifying from C or C++,
|
||||
this initialization replaces the <code>DECL_STMT</code>. These variables
|
||||
will never require cleanups. The scope of these variables is just the
|
||||
body
|
||||
|
||||
<p>Variable-length arrays (VLAs) complicate this process, as their
|
||||
size often refers to variables initialized earlier in the block.
|
||||
To handle this, we currently split the block at that point, and
|
||||
move the VLA into a new, inner <code>BIND_EXPR</code>. This strategy
|
||||
may change in the future.
|
||||
|
||||
<p>A C++ program will usually contain more <code>BIND_EXPR</code>s than
|
||||
there are syntactic blocks in the source code, since several C++
|
||||
constructs have implicit scopes associated with them. On the
|
||||
other hand, although the C++ front end uses pseudo-scopes to
|
||||
handle cleanups for objects with destructors, these don't
|
||||
translate into the GIMPLE form; multiple declarations at the same
|
||||
level use the same <code>BIND_EXPR</code>.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Build - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="gcc-Directory.html#gcc-Directory" title="gcc Directory">
|
||||
<link rel="prev" href="Configuration.html#Configuration" title="Configuration">
|
||||
<link rel="next" href="Makefile.html#Makefile" title="Makefile">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Build"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Makefile.html#Makefile">Makefile</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Configuration.html#Configuration">Configuration</a>,
|
||||
Up: <a rel="up" accesskey="u" href="gcc-Directory.html#gcc-Directory">gcc Directory</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">6.3.3 Build System in the <samp><span class="file">gcc</span></samp> Directory</h4>
|
||||
|
||||
<p>FIXME: describe the build system, including what is built in what
|
||||
stages. Also list the various source files that are used in the build
|
||||
process but aren't source files of GCC itself and so aren't documented
|
||||
below (see <a href="Passes.html#Passes">Passes</a>).
|
||||
|
||||
<!-- Copyright (C) 2001-2013 Free Software Foundation, Inc. -->
|
||||
<!-- This is part of the GCC manual. -->
|
||||
<!-- For copying conditions, see the file gcc.texi. -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>C Constraint Interface - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Constraints.html#Constraints" title="Constraints">
|
||||
<link rel="prev" href="Define-Constraints.html#Define-Constraints" title="Define Constraints">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="C-Constraint-Interface"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Define-Constraints.html#Define-Constraints">Define Constraints</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Constraints.html#Constraints">Constraints</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.8.8 Testing constraints from C</h4>
|
||||
|
||||
<p><a name="index-testing-constraints-3323"></a><a name="index-constraints_002c-testing-3324"></a>
|
||||
It is occasionally useful to test a constraint from C code rather than
|
||||
implicitly via the constraint string in a <code>match_operand</code>. The
|
||||
generated file <samp><span class="file">tm_p.h</span></samp> declares a few interfaces for working
|
||||
with machine-specific constraints. None of these interfaces work with
|
||||
the generic constraints described in <a href="Simple-Constraints.html#Simple-Constraints">Simple Constraints</a>. This
|
||||
may change in the future.
|
||||
|
||||
<p><strong>Warning:</strong> <samp><span class="file">tm_p.h</span></samp> may declare other functions that
|
||||
operate on constraints, besides the ones documented here. Do not use
|
||||
those functions from machine-dependent code. They exist to implement
|
||||
the old constraint interface that machine-independent components of
|
||||
the compiler still expect. They will change or disappear in the
|
||||
future.
|
||||
|
||||
<p>Some valid constraint names are not valid C identifiers, so there is a
|
||||
mangling scheme for referring to them from C. Constraint names that
|
||||
do not contain angle brackets or underscores are left unchanged.
|
||||
Underscores are doubled, each ‘<samp><span class="samp"><</span></samp>’ is replaced with ‘<samp><span class="samp">_l</span></samp>’, and
|
||||
each ‘<samp><span class="samp">></span></samp>’ with ‘<samp><span class="samp">_g</span></samp>’. Here are some examples:
|
||||
|
||||
<!-- the @c's prevent double blank lines in the printed manual. -->
|
||||
<pre class="example">
|
||||
<p><table summary=""><tr align="left"><td valign="top"><strong>Original</strong> </td><td valign="top"><strong>Mangled</strong> <br></td></tr><tr align="left"><td valign="top"><code>x</code> </td><td valign="top"><code>x</code> <br></td></tr><tr align="left"><td valign="top"><code>P42x</code> </td><td valign="top"><code>P42x</code> <br></td></tr><tr align="left"><td valign="top"><code>P4_x</code> </td><td valign="top"><code>P4__x</code> <br></td></tr><tr align="left"><td valign="top"><code>P4>x</code> </td><td valign="top"><code>P4_gx</code> <br></td></tr><tr align="left"><td valign="top"><code>P4>></code> </td><td valign="top"><code>P4_g_g</code> <br></td></tr><tr align="left"><td valign="top"><code>P4_g></code> </td><td valign="top"><code>P4__g_g</code>
|
||||
<br></td></tr></table>
|
||||
</pre>
|
||||
<p>Throughout this section, the variable <var>c</var> is either a constraint
|
||||
in the abstract sense, or a constant from <code>enum constraint_num</code>;
|
||||
the variable <var>m</var> is a mangled constraint name (usually as part of
|
||||
a larger identifier).
|
||||
|
||||
<div class="defun">
|
||||
— Enum: <b>constraint_num</b><var><a name="index-constraint_005fnum-3325"></a></var><br>
|
||||
<blockquote><p>For each machine-specific constraint, there is a corresponding
|
||||
enumeration constant: ‘<samp><span class="samp">CONSTRAINT_</span></samp>’ plus the mangled name of the
|
||||
constraint. Functions that take an <code>enum constraint_num</code> as an
|
||||
argument expect one of these constants.
|
||||
|
||||
<p>Machine-independent constraints do not have associated constants.
|
||||
This may change in the future.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Function: inline bool <b>satisfies_constraint_</b><var>m </var>(<var>rtx exp</var>)<var><a name="index-satisfies_005fconstraint_005f-3326"></a></var><br>
|
||||
<blockquote><p>For each machine-specific, non-register constraint <var>m</var>, there is
|
||||
one of these functions; it returns <code>true</code> if <var>exp</var> satisfies the
|
||||
constraint. These functions are only visible if <samp><span class="file">rtl.h</span></samp> was included
|
||||
before <samp><span class="file">tm_p.h</span></samp>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Function: bool <b>constraint_satisfied_p</b> (<var>rtx exp, enum constraint_num c</var>)<var><a name="index-constraint_005fsatisfied_005fp-3327"></a></var><br>
|
||||
<blockquote><p>Like the <code>satisfies_constraint_</code><var>m</var> functions, but the
|
||||
constraint to test is given as an argument, <var>c</var>. If <var>c</var>
|
||||
specifies a register constraint, this function will always return
|
||||
<code>false</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Function: enum reg_class <b>regclass_for_constraint</b> (<var>enum constraint_num c</var>)<var><a name="index-regclass_005ffor_005fconstraint-3328"></a></var><br>
|
||||
<blockquote><p>Returns the register class associated with <var>c</var>. If <var>c</var> is not
|
||||
a register constraint, or those registers are not available for the
|
||||
currently selected subtarget, returns <code>NO_REGS</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p>Here is an example use of <code>satisfies_constraint_</code><var>m</var>. In
|
||||
peephole optimizations (see <a href="Peephole-Definitions.html#Peephole-Definitions">Peephole Definitions</a>), operand
|
||||
constraint strings are ignored, so if there are relevant constraints,
|
||||
they must be tested in the C condition. In the example, the
|
||||
optimization is applied if operand 2 does <em>not</em> satisfy the
|
||||
‘<samp><span class="samp">K</span></samp>’ constraint. (This is a simplified version of a peephole
|
||||
definition from the i386 machine description.)
|
||||
|
||||
<pre class="smallexample"> (define_peephole2
|
||||
[(match_scratch:SI 3 "r")
|
||||
(set (match_operand:SI 0 "register_operand" "")
|
||||
(mult:SI (match_operand:SI 1 "memory_operand" "")
|
||||
(match_operand:SI 2 "immediate_operand" "")))]
|
||||
|
||||
"!satisfies_constraint_K (operands[2])"
|
||||
|
||||
[(set (match_dup 3) (match_dup 1))
|
||||
(set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2)))]
|
||||
|
||||
"")
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>C Tests - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Testsuites.html#Testsuites" title="Testsuites">
|
||||
<link rel="prev" href="Ada-Tests.html#Ada-Tests" title="Ada Tests">
|
||||
<link rel="next" href="libgcj-Tests.html#libgcj-Tests" title="libgcj Tests">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="C-Tests"></a>
|
||||
Next: <a rel="next" accesskey="n" href="libgcj-Tests.html#libgcj-Tests">libgcj Tests</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Ada-Tests.html#Ada-Tests">Ada Tests</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Testsuites.html#Testsuites">Testsuites</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">7.4 C Language Testsuites</h3>
|
||||
|
||||
<p>GCC contains the following C language testsuites, in the
|
||||
<samp><span class="file">gcc/testsuite</span></samp> directory:
|
||||
|
||||
<dl>
|
||||
<dt><samp><span class="file">gcc.dg</span></samp><dd>This contains tests of particular features of the C compiler, using the
|
||||
more modern ‘<samp><span class="samp">dg</span></samp>’ harness. Correctness tests for various compiler
|
||||
features should go here if possible.
|
||||
|
||||
<p>Magic comments determine whether the file
|
||||
is preprocessed, compiled, linked or run. In these tests, error and warning
|
||||
message texts are compared against expected texts or regular expressions
|
||||
given in comments. These tests are run with the options ‘<samp><span class="samp">-ansi -pedantic</span></samp>’
|
||||
unless other options are given in the test. Except as noted below they
|
||||
are not run with multiple optimization options.
|
||||
<br><dt><samp><span class="file">gcc.dg/compat</span></samp><dd>This subdirectory contains tests for binary compatibility using
|
||||
<samp><span class="file">lib/compat.exp</span></samp>, which in turn uses the language-independent support
|
||||
(see <a href="compat-Testing.html#compat-Testing">Support for testing binary compatibility</a>).
|
||||
<br><dt><samp><span class="file">gcc.dg/cpp</span></samp><dd>This subdirectory contains tests of the preprocessor.
|
||||
<br><dt><samp><span class="file">gcc.dg/debug</span></samp><dd>This subdirectory contains tests for debug formats. Tests in this
|
||||
subdirectory are run for each debug format that the compiler supports.
|
||||
<br><dt><samp><span class="file">gcc.dg/format</span></samp><dd>This subdirectory contains tests of the <samp><span class="option">-Wformat</span></samp> format
|
||||
checking. Tests in this directory are run with and without
|
||||
<samp><span class="option">-DWIDE</span></samp>.
|
||||
<br><dt><samp><span class="file">gcc.dg/noncompile</span></samp><dd>This subdirectory contains tests of code that should not compile and
|
||||
does not need any special compilation options. They are run with
|
||||
multiple optimization options, since sometimes invalid code crashes
|
||||
the compiler with optimization.
|
||||
<br><dt><samp><span class="file">gcc.dg/special</span></samp><dd>FIXME: describe this.
|
||||
|
||||
<br><dt><samp><span class="file">gcc.c-torture</span></samp><dd>This contains particular code fragments which have historically broken easily.
|
||||
These tests are run with multiple optimization options, so tests for features
|
||||
which only break at some optimization levels belong here. This also contains
|
||||
tests to check that certain optimizations occur. It might be worthwhile to
|
||||
separate the correctness tests cleanly from the code quality tests, but
|
||||
it hasn't been done yet.
|
||||
|
||||
<br><dt><samp><span class="file">gcc.c-torture/compat</span></samp><dd>FIXME: describe this.
|
||||
|
||||
<p>This directory should probably not be used for new tests.
|
||||
<br><dt><samp><span class="file">gcc.c-torture/compile</span></samp><dd>This testsuite contains test cases that should compile, but do not
|
||||
need to link or run. These test cases are compiled with several
|
||||
different combinations of optimization options. All warnings are
|
||||
disabled for these test cases, so this directory is not suitable if
|
||||
you wish to test for the presence or absence of compiler warnings.
|
||||
While special options can be set, and tests disabled on specific
|
||||
platforms, by the use of <samp><span class="file">.x</span></samp> files, mostly these test cases
|
||||
should not contain platform dependencies. FIXME: discuss how defines
|
||||
such as <code>NO_LABEL_VALUES</code> and <code>STACK_SIZE</code> are used.
|
||||
<br><dt><samp><span class="file">gcc.c-torture/execute</span></samp><dd>This testsuite contains test cases that should compile, link and run;
|
||||
otherwise the same comments as for <samp><span class="file">gcc.c-torture/compile</span></samp> apply.
|
||||
<br><dt><samp><span class="file">gcc.c-torture/execute/ieee</span></samp><dd>This contains tests which are specific to IEEE floating point.
|
||||
<br><dt><samp><span class="file">gcc.c-torture/unsorted</span></samp><dd>FIXME: describe this.
|
||||
|
||||
<p>This directory should probably not be used for new tests.
|
||||
<br><dt><samp><span class="file">gcc.misc-tests</span></samp><dd>This directory contains C tests that require special handling. Some
|
||||
of these tests have individual expect files, and others share
|
||||
special-purpose expect files:
|
||||
|
||||
<dl>
|
||||
<dt><samp><code>bprob*.c</code></samp><dd>Test <samp><span class="option">-fbranch-probabilities</span></samp> using
|
||||
<samp><span class="file">gcc.misc-tests/bprob.exp</span></samp>, which
|
||||
in turn uses the generic, language-independent framework
|
||||
(see <a href="profopt-Testing.html#profopt-Testing">Support for testing profile-directed optimizations</a>).
|
||||
|
||||
<br><dt><samp><code>gcov*.c</code></samp><dd>Test <samp><span class="command">gcov</span></samp> output using <samp><span class="file">gcov.exp</span></samp>, which in turn uses the
|
||||
language-independent support (see <a href="gcov-Testing.html#gcov-Testing">Support for testing gcov</a>).
|
||||
|
||||
<br><dt><samp><code>i386-pf-*.c</code></samp><dd>Test i386-specific support for data prefetch using <samp><span class="file">i386-prefetch.exp</span></samp>.
|
||||
</dl>
|
||||
|
||||
<br><dt><samp><span class="file">gcc.test-framework</span></samp><dd>
|
||||
<dl>
|
||||
<dt><samp><code>dg-*.c</code></samp><dd>Test the testsuite itself using <samp><span class="file">gcc.test-framework/test-framework.exp</span></samp>.
|
||||
</dl>
|
||||
|
||||
</dl>
|
||||
|
||||
<p>FIXME: merge in <samp><span class="file">testsuite/README.gcc</span></samp> and discuss the format of
|
||||
test cases and magic comments more.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>C and C++ Trees - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="GENERIC.html#GENERIC" title="GENERIC">
|
||||
<link rel="prev" href="Language_002ddependent-trees.html#Language_002ddependent-trees" title="Language-dependent trees">
|
||||
<link rel="next" href="Java-Trees.html#Java-Trees" title="Java Trees">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="C-and-C++-Trees"></a>
|
||||
<a name="C-and-C_002b_002b-Trees"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Java-Trees.html#Java-Trees">Java Trees</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Language_002ddependent-trees.html#Language_002ddependent-trees">Language-dependent trees</a>,
|
||||
Up: <a rel="up" accesskey="u" href="GENERIC.html#GENERIC">GENERIC</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">11.10 C and C++ Trees</h3>
|
||||
|
||||
<p>This section documents the internal representation used by GCC to
|
||||
represent C and C++ source programs. When presented with a C or C++
|
||||
source program, GCC parses the program, performs semantic analysis
|
||||
(including the generation of error messages), and then produces the
|
||||
internal representation described here. This representation contains a
|
||||
complete representation for the entire translation unit provided as
|
||||
input to the front end. This representation is then typically processed
|
||||
by a code-generator in order to produce machine code, but could also be
|
||||
used in the creation of source browsers, intelligent editors, automatic
|
||||
documentation generators, interpreters, and any other programs needing
|
||||
the ability to process C or C++ code.
|
||||
|
||||
<p>This section explains the internal representation. In particular, it
|
||||
documents the internal representation for C and C++ source
|
||||
constructs, and the macros, functions, and variables that can be used to
|
||||
access these constructs. The C++ representation is largely a superset
|
||||
of the representation used in the C front end. There is only one
|
||||
construct used in C that does not appear in the C++ front end and that
|
||||
is the GNU “nested function” extension. Many of the macros documented
|
||||
here do not apply in C because the corresponding language constructs do
|
||||
not appear in C.
|
||||
|
||||
<p>The C and C++ front ends generate a mix of GENERIC trees and ones
|
||||
specific to C and C++. These language-specific trees are higher-level
|
||||
constructs than the ones in GENERIC to make the parser's job easier.
|
||||
This section describes those trees that aren't part of GENERIC as well
|
||||
as aspects of GENERIC trees that are treated in a language-specific
|
||||
manner.
|
||||
|
||||
<p>If you are developing a “back end”, be it is a code-generator or some
|
||||
other tool, that uses this representation, you may occasionally find
|
||||
that you need to ask questions not easily answered by the functions and
|
||||
macros available here. If that situation occurs, it is quite likely
|
||||
that GCC already supports the functionality you desire, but that the
|
||||
interface is simply not documented here. In that case, you should ask
|
||||
the GCC maintainers (via mail to <a href="mailto:gcc@gcc.gnu.org">gcc@gcc.gnu.org</a>) about
|
||||
documenting the functionality you require. Similarly, if you find
|
||||
yourself writing functions that do not deal directly with your back end,
|
||||
but instead might be useful to other people using the GCC front end, you
|
||||
should submit your patches for inclusion in GCC.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Types-for-C_002b_002b.html#Types-for-C_002b_002b">Types for C++</a>: Fundamental and aggregate types.
|
||||
<li><a accesskey="2" href="Namespaces.html#Namespaces">Namespaces</a>: Namespaces.
|
||||
<li><a accesskey="3" href="Classes.html#Classes">Classes</a>: Classes.
|
||||
<li><a accesskey="4" href="Functions-for-C_002b_002b.html#Functions-for-C_002b_002b">Functions for C++</a>: Overloading and accessors for C++.
|
||||
<li><a accesskey="5" href="Statements-for-C_002b_002b.html#Statements-for-C_002b_002b">Statements for C++</a>: Statements specific to C and C++.
|
||||
<li><a accesskey="6" href="C_002b_002b-Expressions.html#C_002b_002b-Expressions">C++ Expressions</a>: From <code>typeid</code> to <code>throw</code>.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>CC0 Condition Codes - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Condition-Code.html#Condition-Code" title="Condition Code">
|
||||
<link rel="next" href="MODE_005fCC-Condition-Codes.html#MODE_005fCC-Condition-Codes" title="MODE_CC Condition Codes">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="CC0-Condition-Codes"></a>
|
||||
Next: <a rel="next" accesskey="n" href="MODE_005fCC-Condition-Codes.html#MODE_005fCC-Condition-Codes">MODE_CC Condition Codes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Condition-Code.html#Condition-Code">Condition Code</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.16.1 Representation of condition codes using <code>(cc0)</code></h4>
|
||||
|
||||
<p><a name="index-cc0-4368"></a>
|
||||
<a name="index-cc_005fstatus-4369"></a>The file <samp><span class="file">conditions.h</span></samp> defines a variable <code>cc_status</code> to
|
||||
describe how the condition code was computed (in case the interpretation of
|
||||
the condition code depends on the instruction that it was set by). This
|
||||
variable contains the RTL expressions on which the condition code is
|
||||
currently based, and several standard flags.
|
||||
|
||||
<p>Sometimes additional machine-specific flags must be defined in the machine
|
||||
description header file. It can also add additional machine-specific
|
||||
information by defining <code>CC_STATUS_MDEP</code>.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CC_STATUS_MDEP</b><var><a name="index-CC_005fSTATUS_005fMDEP-4370"></a></var><br>
|
||||
<blockquote><p>C code for a data type which is used for declaring the <code>mdep</code>
|
||||
component of <code>cc_status</code>. It defaults to <code>int</code>.
|
||||
|
||||
<p>This macro is not used on machines that do not use <code>cc0</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CC_STATUS_MDEP_INIT</b><var><a name="index-CC_005fSTATUS_005fMDEP_005fINIT-4371"></a></var><br>
|
||||
<blockquote><p>A C expression to initialize the <code>mdep</code> field to “empty”.
|
||||
The default definition does nothing, since most machines don't use
|
||||
the field anyway. If you want to use the field, you should probably
|
||||
define this macro to initialize it.
|
||||
|
||||
<p>This macro is not used on machines that do not use <code>cc0</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>NOTICE_UPDATE_CC</b> (<var>exp, insn</var>)<var><a name="index-NOTICE_005fUPDATE_005fCC-4372"></a></var><br>
|
||||
<blockquote><p>A C compound statement to set the components of <code>cc_status</code>
|
||||
appropriately for an insn <var>insn</var> whose body is <var>exp</var>. It is
|
||||
this macro's responsibility to recognize insns that set the condition
|
||||
code as a byproduct of other activity as well as those that explicitly
|
||||
set <code>(cc0)</code>.
|
||||
|
||||
<p>This macro is not used on machines that do not use <code>cc0</code>.
|
||||
|
||||
<p>If there are insns that do not set the condition code but do alter
|
||||
other machine registers, this macro must check to see whether they
|
||||
invalidate the expressions that the condition code is recorded as
|
||||
reflecting. For example, on the 68000, insns that store in address
|
||||
registers do not set the condition code, which means that usually
|
||||
<code>NOTICE_UPDATE_CC</code> can leave <code>cc_status</code> unaltered for such
|
||||
insns. But suppose that the previous insn set the condition code
|
||||
based on location ‘<samp><span class="samp">a4@(102)</span></samp>’ and the current insn stores a new
|
||||
value in ‘<samp><span class="samp">a4</span></samp>’. Although the condition code is not changed by
|
||||
this, it will no longer be true that it reflects the contents of
|
||||
‘<samp><span class="samp">a4@(102)</span></samp>’. Therefore, <code>NOTICE_UPDATE_CC</code> must alter
|
||||
<code>cc_status</code> in this case to say that nothing is known about the
|
||||
condition code value.
|
||||
|
||||
<p>The definition of <code>NOTICE_UPDATE_CC</code> must be prepared to deal
|
||||
with the results of peephole optimization: insns whose patterns are
|
||||
<code>parallel</code> RTXs containing various <code>reg</code>, <code>mem</code> or
|
||||
constants which are just the operands. The RTL structure of these
|
||||
insns is not sufficient to indicate what the insns actually do. What
|
||||
<code>NOTICE_UPDATE_CC</code> should do when it sees one is just to run
|
||||
<code>CC_STATUS_INIT</code>.
|
||||
|
||||
<p>A possible definition of <code>NOTICE_UPDATE_CC</code> is to call a function
|
||||
that looks at an attribute (see <a href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>) named, for example,
|
||||
‘<samp><span class="samp">cc</span></samp>’. This avoids having detailed information about patterns in
|
||||
two places, the <samp><span class="file">md</span></samp> file and in <code>NOTICE_UPDATE_CC</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>C++ ABI - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="PCH-Target.html#PCH-Target" title="PCH Target">
|
||||
<link rel="next" href="Named-Address-Spaces.html#Named-Address-Spaces" title="Named Address Spaces">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="C++-ABI"></a>
|
||||
<a name="C_002b_002b-ABI"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Named-Address-Spaces.html#Named-Address-Spaces">Named Address Spaces</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="PCH-Target.html#PCH-Target">PCH Target</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.29 C++ ABI parameters</h3>
|
||||
|
||||
<p><a name="index-parameters_002c-c_002b_002b-abi-4807"></a>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_CXX_GUARD_TYPE</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fGUARD_005fTYPE-4808"></a></var><br>
|
||||
<blockquote><p>Define this hook to override the integer type used for guard variables.
|
||||
These are used to implement one-time construction of static objects. The
|
||||
default is long_long_integer_type_node.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_GUARD_MASK_BIT</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fGUARD_005fMASK_005fBIT-4809"></a></var><br>
|
||||
<blockquote><p>This hook determines how guard variables are used. It should return
|
||||
<code>false</code> (the default) if the first byte should be used. A return value of
|
||||
<code>true</code> indicates that only the least significant bit should be used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_CXX_GET_COOKIE_SIZE</b> (<var>tree type</var>)<var><a name="index-TARGET_005fCXX_005fGET_005fCOOKIE_005fSIZE-4810"></a></var><br>
|
||||
<blockquote><p>This hook returns the size of the cookie to use when allocating an array
|
||||
whose elements have the indicated <var>type</var>. Assumes that it is already
|
||||
known that a cookie is needed. The default is
|
||||
<code>max(sizeof (size_t), alignof(type))</code>, as defined in section 2.7 of the
|
||||
IA64/Generic C++ ABI.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_COOKIE_HAS_SIZE</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fCOOKIE_005fHAS_005fSIZE-4811"></a></var><br>
|
||||
<blockquote><p>This hook should return <code>true</code> if the element size should be stored in
|
||||
array cookies. The default is to return <code>false</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_CXX_IMPORT_EXPORT_CLASS</b> (<var>tree type, int import_export</var>)<var><a name="index-TARGET_005fCXX_005fIMPORT_005fEXPORT_005fCLASS-4812"></a></var><br>
|
||||
<blockquote><p>If defined by a backend this hook allows the decision made to export
|
||||
class <var>type</var> to be overruled. Upon entry <var>import_export</var>
|
||||
will contain 1 if the class is going to be exported, −1 if it is going
|
||||
to be imported and 0 otherwise. This function should return the
|
||||
modified value and perform any other actions necessary to support the
|
||||
backend's targeted operating system.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_CDTOR_RETURNS_THIS</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fCDTOR_005fRETURNS_005fTHIS-4813"></a></var><br>
|
||||
<blockquote><p>This hook should return <code>true</code> if constructors and destructors return
|
||||
the address of the object created/destroyed. The default is to return
|
||||
<code>false</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_KEY_METHOD_MAY_BE_INLINE</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fKEY_005fMETHOD_005fMAY_005fBE_005fINLINE-4814"></a></var><br>
|
||||
<blockquote><p>This hook returns true if the key method for a class (i.e., the method
|
||||
which, if defined in the current translation unit, causes the virtual
|
||||
table to be emitted) may be an inline function. Under the standard
|
||||
Itanium C++ ABI the key method may be an inline function so long as
|
||||
the function is not declared inline in the class definition. Under
|
||||
some variants of the ABI, an inline function can never be the key
|
||||
method. The default is to return <code>true</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY</b> (<var>tree decl</var>)<var><a name="index-TARGET_005fCXX_005fDETERMINE_005fCLASS_005fDATA_005fVISIBILITY-4815"></a></var><br>
|
||||
<blockquote><p><var>decl</var> is a virtual table, virtual table table, typeinfo object, or other similar implicit class data object that will be emitted with external linkage in this translation unit. No ELF visibility has been explicitly specified. If the target needs to specify a visibility other than that of the containing class, use this hook to set <code>DECL_VISIBILITY</code> and <code>DECL_VISIBILITY_SPECIFIED</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fCLASS_005fDATA_005fALWAYS_005fCOMDAT-4816"></a></var><br>
|
||||
<blockquote><p>This hook returns true (the default) if virtual tables and other
|
||||
similar implicit class data objects are always COMDAT if they have
|
||||
external linkage. If this hook returns false, then class data for
|
||||
classes whose virtual table will be emitted in only one translation
|
||||
unit will not be COMDAT.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_LIBRARY_RTTI_COMDAT</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fLIBRARY_005fRTTI_005fCOMDAT-4817"></a></var><br>
|
||||
<blockquote><p>This hook returns true (the default) if the RTTI information for
|
||||
the basic types which is defined in the C++ runtime should always
|
||||
be COMDAT, false if it should not be COMDAT.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_USE_AEABI_ATEXIT</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fUSE_005fAEABI_005fATEXIT-4818"></a></var><br>
|
||||
<blockquote><p>This hook returns true if <code>__aeabi_atexit</code> (as defined by the ARM EABI)
|
||||
should be used to register static destructors when <samp><span class="option">-fuse-cxa-atexit</span></samp>
|
||||
is in effect. The default is to return false to use <code>__cxa_atexit</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT</b> (<var>void</var>)<var><a name="index-TARGET_005fCXX_005fUSE_005fATEXIT_005fFOR_005fCXA_005fATEXIT-4819"></a></var><br>
|
||||
<blockquote><p>This hook returns true if the target <code>atexit</code> function can be used
|
||||
in the same manner as <code>__cxa_atexit</code> to register C++ static
|
||||
destructors. This requires that <code>atexit</code>-registered functions in
|
||||
shared libraries are run in the correct order when the libraries are
|
||||
unloaded. The default is to return false.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_CXX_ADJUST_CLASS_AT_DEFINITION</b> (<var>tree type</var>)<var><a name="index-TARGET_005fCXX_005fADJUST_005fCLASS_005fAT_005fDEFINITION-4820"></a></var><br>
|
||||
<blockquote><p><var>type</var> is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has just been defined. Use this hook to make adjustments to the class (eg, tweak visibility or perform any other required target modifications).
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_CXX_DECL_MANGLING_CONTEXT</b> (<var>const_tree decl</var>)<var><a name="index-TARGET_005fCXX_005fDECL_005fMANGLING_005fCONTEXT-4821"></a></var><br>
|
||||
<blockquote><p>Return target-specific mangling context of <var>decl</var> or <code>NULL_TREE</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>C++ Expressions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="C-and-C_002b_002b-Trees.html#C-and-C_002b_002b-Trees" title="C and C++ Trees">
|
||||
<link rel="prev" href="Statements-for-C_002b_002b.html#Statements-for-C_002b_002b" title="Statements for C++">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="C++-Expressions"></a>
|
||||
<a name="C_002b_002b-Expressions"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Statements-for-C_002b_002b.html#Statements-for-C_002b_002b">Statements for C++</a>,
|
||||
Up: <a rel="up" accesskey="u" href="C-and-C_002b_002b-Trees.html#C-and-C_002b_002b-Trees">C and C++ Trees</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.10.6 C++ Expressions</h4>
|
||||
|
||||
<p>This section describes expressions specific to the C and C++ front
|
||||
ends.
|
||||
|
||||
<dl>
|
||||
<dt><code>TYPEID_EXPR</code><dd>
|
||||
Used to represent a <code>typeid</code> expression.
|
||||
|
||||
<br><dt><code>NEW_EXPR</code><dt><code>VEC_NEW_EXPR</code><dd>
|
||||
Used to represent a call to <code>new</code> and <code>new[]</code> respectively.
|
||||
|
||||
<br><dt><code>DELETE_EXPR</code><dt><code>VEC_DELETE_EXPR</code><dd>
|
||||
Used to represent a call to <code>delete</code> and <code>delete[]</code> respectively.
|
||||
|
||||
<br><dt><code>MEMBER_REF</code><dd>
|
||||
Represents a reference to a member of a class.
|
||||
|
||||
<br><dt><code>THROW_EXPR</code><dd>
|
||||
Represents an instance of <code>throw</code> in the program. Operand 0,
|
||||
which is the expression to throw, may be <code>NULL_TREE</code>.
|
||||
|
||||
<br><dt><code>AGGR_INIT_EXPR</code><dd>An <code>AGGR_INIT_EXPR</code> represents the initialization as the return
|
||||
value of a function call, or as the result of a constructor. An
|
||||
<code>AGGR_INIT_EXPR</code> will only appear as a full-expression, or as the
|
||||
second operand of a <code>TARGET_EXPR</code>. <code>AGGR_INIT_EXPR</code>s have
|
||||
a representation similar to that of <code>CALL_EXPR</code>s. You can use
|
||||
the <code>AGGR_INIT_EXPR_FN</code> and <code>AGGR_INIT_EXPR_ARG</code> macros to access
|
||||
the function to call and the arguments to pass.
|
||||
|
||||
<p>If <code>AGGR_INIT_VIA_CTOR_P</code> holds of the <code>AGGR_INIT_EXPR</code>, then
|
||||
the initialization is via a constructor call. The address of the
|
||||
<code>AGGR_INIT_EXPR_SLOT</code> operand, which is always a <code>VAR_DECL</code>,
|
||||
is taken, and this value replaces the first argument in the argument
|
||||
list.
|
||||
|
||||
<p>In either case, the expression is void.
|
||||
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Caller Saves - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Stack-and-Calling.html#Stack-and-Calling" title="Stack and Calling">
|
||||
<link rel="prev" href="Aggregate-Return.html#Aggregate-Return" title="Aggregate Return">
|
||||
<link rel="next" href="Function-Entry.html#Function-Entry" title="Function Entry">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Caller-Saves"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Function-Entry.html#Function-Entry">Function Entry</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Aggregate-Return.html#Aggregate-Return">Aggregate Return</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Stack-and-Calling.html#Stack-and-Calling">Stack and Calling</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.10.10 Caller-Saves Register Allocation</h4>
|
||||
|
||||
<p>If you enable it, GCC can save registers around function calls. This
|
||||
makes it possible to use call-clobbered registers to hold variables that
|
||||
must live across calls.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CALLER_SAVE_PROFITABLE</b> (<var>refs, calls</var>)<var><a name="index-CALLER_005fSAVE_005fPROFITABLE-4240"></a></var><br>
|
||||
<blockquote><p>A C expression to determine whether it is worthwhile to consider placing
|
||||
a pseudo-register in a call-clobbered hard register and saving and
|
||||
restoring it around each function call. The expression should be 1 when
|
||||
this is worth doing, and 0 otherwise.
|
||||
|
||||
<p>If you don't define this macro, a default is used which is good on most
|
||||
machines: <code>4 * </code><var>calls</var><code> < </code><var>refs</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>HARD_REGNO_CALLER_SAVE_MODE</b> (<var>regno, nregs</var>)<var><a name="index-HARD_005fREGNO_005fCALLER_005fSAVE_005fMODE-4241"></a></var><br>
|
||||
<blockquote><p>A C expression specifying which mode is required for saving <var>nregs</var>
|
||||
of a pseudo-register in call-clobbered hard register <var>regno</var>. If
|
||||
<var>regno</var> is unsuitable for caller save, <code>VOIDmode</code> should be
|
||||
returned. For most machines this macro need not be defined since GCC
|
||||
will select the smallest suitable mode.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Calls - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Insns.html#Insns" title="Insns">
|
||||
<link rel="next" href="Sharing.html#Sharing" title="Sharing">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Calls"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Sharing.html#Sharing">Sharing</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Insns.html#Insns">Insns</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.20 RTL Representation of Function-Call Insns</h3>
|
||||
|
||||
<p><a name="index-calling-functions-in-RTL-2280"></a><a name="index-RTL-function_002dcall-insns-2281"></a><a name="index-function_002dcall-insns-2282"></a>
|
||||
Insns that call subroutines have the RTL expression code <code>call_insn</code>.
|
||||
These insns must satisfy special rules, and their bodies must use a special
|
||||
RTL expression code, <code>call</code>.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bcall_007d-usage-2283"></a>A <code>call</code> expression has two operands, as follows:
|
||||
|
||||
<pre class="smallexample"> (call (mem:<var>fm</var> <var>addr</var>) <var>nbytes</var>)
|
||||
</pre>
|
||||
<p class="noindent">Here <var>nbytes</var> is an operand that represents the number of bytes of
|
||||
argument data being passed to the subroutine, <var>fm</var> is a machine mode
|
||||
(which must equal as the definition of the <code>FUNCTION_MODE</code> macro in
|
||||
the machine description) and <var>addr</var> represents the address of the
|
||||
subroutine.
|
||||
|
||||
<p>For a subroutine that returns no value, the <code>call</code> expression as
|
||||
shown above is the entire body of the insn, except that the insn might
|
||||
also contain <code>use</code> or <code>clobber</code> expressions.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bBLKmode_007d_002c-and-function-return-values-2284"></a>For a subroutine that returns a value whose mode is not <code>BLKmode</code>,
|
||||
the value is returned in a hard register. If this register's number is
|
||||
<var>r</var>, then the body of the call insn looks like this:
|
||||
|
||||
<pre class="smallexample"> (set (reg:<var>m</var> <var>r</var>)
|
||||
(call (mem:<var>fm</var> <var>addr</var>) <var>nbytes</var>))
|
||||
</pre>
|
||||
<p class="noindent">This RTL expression makes it clear (to the optimizer passes) that the
|
||||
appropriate register receives a useful value in this insn.
|
||||
|
||||
<p>When a subroutine returns a <code>BLKmode</code> value, it is handled by
|
||||
passing to the subroutine the address of a place to store the value.
|
||||
So the call insn itself does not “return” any value, and it has the
|
||||
same RTL form as a call that returns nothing.
|
||||
|
||||
<p>On some machines, the call instruction itself clobbers some register,
|
||||
for example to contain the return address. <code>call_insn</code> insns
|
||||
on these machines should have a body which is a <code>parallel</code>
|
||||
that contains both the <code>call</code> expression and <code>clobber</code>
|
||||
expressions that indicate which registers are destroyed. Similarly,
|
||||
if the call instruction requires some register other than the stack
|
||||
pointer that is not explicitly mentioned in its RTL, a <code>use</code>
|
||||
subexpression should mention that register.
|
||||
|
||||
<p>Functions that are called are assumed to modify all registers listed in
|
||||
the configuration macro <code>CALL_USED_REGISTERS</code> (see <a href="Register-Basics.html#Register-Basics">Register Basics</a>) and, with the exception of <code>const</code> functions and library
|
||||
calls, to modify all of memory.
|
||||
|
||||
<p>Insns containing just <code>use</code> expressions directly precede the
|
||||
<code>call_insn</code> insn to indicate which registers contain inputs to the
|
||||
function. Similarly, if registers other than those in
|
||||
<code>CALL_USED_REGISTERS</code> are clobbered by the called function, insns
|
||||
containing a single <code>clobber</code> follow immediately after the call to
|
||||
indicate which registers.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Class Preferences - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Constraints.html#Constraints" title="Constraints">
|
||||
<link rel="prev" href="Multi_002dAlternative.html#Multi_002dAlternative" title="Multi-Alternative">
|
||||
<link rel="next" href="Modifiers.html#Modifiers" title="Modifiers">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Class-Preferences"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Modifiers.html#Modifiers">Modifiers</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Multi_002dAlternative.html#Multi_002dAlternative">Multi-Alternative</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Constraints.html#Constraints">Constraints</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.8.3 Register Class Preferences</h4>
|
||||
|
||||
<p><a name="index-class-preference-constraints-3302"></a><a name="index-register-class-preference-constraints-3303"></a>
|
||||
<a name="index-voting-between-constraint-alternatives-3304"></a>The operand constraints have another function: they enable the compiler
|
||||
to decide which kind of hardware register a pseudo register is best
|
||||
allocated to. The compiler examines the constraints that apply to the
|
||||
insns that use the pseudo register, looking for the machine-dependent
|
||||
letters such as ‘<samp><span class="samp">d</span></samp>’ and ‘<samp><span class="samp">a</span></samp>’ that specify classes of registers.
|
||||
The pseudo register is put in whichever class gets the most “votes”.
|
||||
The constraint letters ‘<samp><span class="samp">g</span></samp>’ and ‘<samp><span class="samp">r</span></samp>’ also vote: they vote in
|
||||
favor of a general register. The machine description says which registers
|
||||
are considered general.
|
||||
|
||||
<p>Of course, on some machines all registers are equivalent, and no register
|
||||
classes are defined. Then none of this complexity is relevant.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="C-and-C_002b_002b-Trees.html#C-and-C_002b_002b-Trees" title="C and C++ Trees">
|
||||
<link rel="prev" href="Namespaces.html#Namespaces" title="Namespaces">
|
||||
<link rel="next" href="Functions-for-C_002b_002b.html#Functions-for-C_002b_002b" title="Functions for C++">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Classes"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Functions-for-C_002b_002b.html#Functions-for-C_002b_002b">Functions for C++</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Namespaces.html#Namespaces">Namespaces</a>,
|
||||
Up: <a rel="up" accesskey="u" href="C-and-C_002b_002b-Trees.html#C-and-C_002b_002b-Trees">C and C++ Trees</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.10.3 Classes</h4>
|
||||
|
||||
<p><a name="index-class_002c-scope-2611"></a><a name="index-RECORD_005fTYPE-2612"></a><a name="index-UNION_005fTYPE-2613"></a><a name="index-CLASSTYPE_005fDECLARED_005fCLASS-2614"></a><a name="index-TYPE_005fBINFO-2615"></a><a name="index-BINFO_005fTYPE-2616"></a><a name="index-TYPE_005fFIELDS-2617"></a><a name="index-TYPE_005fVFIELD-2618"></a><a name="index-TYPE_005fMETHODS-2619"></a>
|
||||
Besides namespaces, the other high-level scoping construct in C++ is the
|
||||
class. (Throughout this manual the term <dfn>class</dfn> is used to mean the
|
||||
types referred to in the ANSI/ISO C++ Standard as classes; these include
|
||||
types defined with the <code>class</code>, <code>struct</code>, and <code>union</code>
|
||||
keywords.)
|
||||
|
||||
<p>A class type is represented by either a <code>RECORD_TYPE</code> or a
|
||||
<code>UNION_TYPE</code>. A class declared with the <code>union</code> tag is
|
||||
represented by a <code>UNION_TYPE</code>, while classes declared with either
|
||||
the <code>struct</code> or the <code>class</code> tag are represented by
|
||||
<code>RECORD_TYPE</code>s. You can use the <code>CLASSTYPE_DECLARED_CLASS</code>
|
||||
macro to discern whether or not a particular type is a <code>class</code> as
|
||||
opposed to a <code>struct</code>. This macro will be true only for classes
|
||||
declared with the <code>class</code> tag.
|
||||
|
||||
<p>Almost all non-function members are available on the <code>TYPE_FIELDS</code>
|
||||
list. Given one member, the next can be found by following the
|
||||
<code>TREE_CHAIN</code>. You should not depend in any way on the order in
|
||||
which fields appear on this list. All nodes on this list will be
|
||||
‘<samp><span class="samp">DECL</span></samp>’ nodes. A <code>FIELD_DECL</code> is used to represent a non-static
|
||||
data member, a <code>VAR_DECL</code> is used to represent a static data
|
||||
member, and a <code>TYPE_DECL</code> is used to represent a type. Note that
|
||||
the <code>CONST_DECL</code> for an enumeration constant will appear on this
|
||||
list, if the enumeration type was declared in the class. (Of course,
|
||||
the <code>TYPE_DECL</code> for the enumeration type will appear here as well.)
|
||||
There are no entries for base classes on this list. In particular,
|
||||
there is no <code>FIELD_DECL</code> for the “base-class portion” of an
|
||||
object.
|
||||
|
||||
<p>The <code>TYPE_VFIELD</code> is a compiler-generated field used to point to
|
||||
virtual function tables. It may or may not appear on the
|
||||
<code>TYPE_FIELDS</code> list. However, back ends should handle the
|
||||
<code>TYPE_VFIELD</code> just like all the entries on the <code>TYPE_FIELDS</code>
|
||||
list.
|
||||
|
||||
<p>The function members are available on the <code>TYPE_METHODS</code> list.
|
||||
Again, subsequent members are found by following the <code>TREE_CHAIN</code>
|
||||
field. If a function is overloaded, each of the overloaded functions
|
||||
appears; no <code>OVERLOAD</code> nodes appear on the <code>TYPE_METHODS</code>
|
||||
list. Implicitly declared functions (including default constructors,
|
||||
copy constructors, assignment operators, and destructors) will appear on
|
||||
this list as well.
|
||||
|
||||
<p>Every class has an associated <dfn>binfo</dfn>, which can be obtained with
|
||||
<code>TYPE_BINFO</code>. Binfos are used to represent base-classes. The
|
||||
binfo given by <code>TYPE_BINFO</code> is the degenerate case, whereby every
|
||||
class is considered to be its own base-class. The base binfos for a
|
||||
particular binfo are held in a vector, whose length is obtained with
|
||||
<code>BINFO_N_BASE_BINFOS</code>. The base binfos themselves are obtained
|
||||
with <code>BINFO_BASE_BINFO</code> and <code>BINFO_BASE_ITERATE</code>. To add a
|
||||
new binfo, use <code>BINFO_BASE_APPEND</code>. The vector of base binfos can
|
||||
be obtained with <code>BINFO_BASE_BINFOS</code>, but normally you do not need
|
||||
to use that. The class type associated with a binfo is given by
|
||||
<code>BINFO_TYPE</code>. It is not always the case that <code>BINFO_TYPE
|
||||
(TYPE_BINFO (x))</code>, because of typedefs and qualified types. Neither is
|
||||
it the case that <code>TYPE_BINFO (BINFO_TYPE (y))</code> is the same binfo as
|
||||
<code>y</code>. The reason is that if <code>y</code> is a binfo representing a
|
||||
base-class <code>B</code> of a derived class <code>D</code>, then <code>BINFO_TYPE
|
||||
(y)</code> will be <code>B</code>, and <code>TYPE_BINFO (BINFO_TYPE (y))</code> will be
|
||||
<code>B</code> as its own base-class, rather than as a base-class of <code>D</code>.
|
||||
|
||||
<p>The access to a base type can be found with <code>BINFO_BASE_ACCESS</code>.
|
||||
This will produce <code>access_public_node</code>, <code>access_private_node</code>
|
||||
or <code>access_protected_node</code>. If bases are always public,
|
||||
<code>BINFO_BASE_ACCESSES</code> may be <code>NULL</code>.
|
||||
|
||||
<p><code>BINFO_VIRTUAL_P</code> is used to specify whether the binfo is inherited
|
||||
virtually or not. The other flags, <code>BINFO_MARKED_P</code> and
|
||||
<code>BINFO_FLAG_1</code> to <code>BINFO_FLAG_6</code> can be used for language
|
||||
specific use.
|
||||
|
||||
<p>The following macros can be used on a tree node representing a class-type.
|
||||
|
||||
<dl>
|
||||
<dt><code>LOCAL_CLASS_P</code><a name="index-LOCAL_005fCLASS_005fP-2620"></a><dd>This predicate holds if the class is local class <em>i.e.</em> declared
|
||||
inside a function body.
|
||||
|
||||
<br><dt><code>TYPE_POLYMORPHIC_P</code><a name="index-TYPE_005fPOLYMORPHIC_005fP-2621"></a><dd>This predicate holds if the class has at least one virtual function
|
||||
(declared or inherited).
|
||||
|
||||
<br><dt><code>TYPE_HAS_DEFAULT_CONSTRUCTOR</code><a name="index-TYPE_005fHAS_005fDEFAULT_005fCONSTRUCTOR-2622"></a><dd>This predicate holds whenever its argument represents a class-type with
|
||||
default constructor.
|
||||
|
||||
<br><dt><code>CLASSTYPE_HAS_MUTABLE</code><a name="index-CLASSTYPE_005fHAS_005fMUTABLE-2623"></a><dt><code>TYPE_HAS_MUTABLE_P</code><a name="index-TYPE_005fHAS_005fMUTABLE_005fP-2624"></a><dd>These predicates hold for a class-type having a mutable data member.
|
||||
|
||||
<br><dt><code>CLASSTYPE_NON_POD_P</code><a name="index-CLASSTYPE_005fNON_005fPOD_005fP-2625"></a><dd>This predicate holds only for class-types that are not PODs.
|
||||
|
||||
<br><dt><code>TYPE_HAS_NEW_OPERATOR</code><a name="index-TYPE_005fHAS_005fNEW_005fOPERATOR-2626"></a><dd>This predicate holds for a class-type that defines
|
||||
<code>operator new</code>.
|
||||
|
||||
<br><dt><code>TYPE_HAS_ARRAY_NEW_OPERATOR</code><a name="index-TYPE_005fHAS_005fARRAY_005fNEW_005fOPERATOR-2627"></a><dd>This predicate holds for a class-type for which
|
||||
<code>operator new[]</code> is defined.
|
||||
|
||||
<br><dt><code>TYPE_OVERLOADS_CALL_EXPR</code><a name="index-TYPE_005fOVERLOADS_005fCALL_005fEXPR-2628"></a><dd>This predicate holds for class-type for which the function call
|
||||
<code>operator()</code> is overloaded.
|
||||
|
||||
<br><dt><code>TYPE_OVERLOADS_ARRAY_REF</code><a name="index-TYPE_005fOVERLOADS_005fARRAY_005fREF-2629"></a><dd>This predicate holds for a class-type that overloads
|
||||
<code>operator[]</code>
|
||||
|
||||
<br><dt><code>TYPE_OVERLOADS_ARROW</code><a name="index-TYPE_005fOVERLOADS_005fARROW-2630"></a><dd>This predicate holds for a class-type for which <code>operator-></code> is
|
||||
overloaded.
|
||||
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Cleanups - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Statements.html#Statements" title="Statements">
|
||||
<link rel="prev" href="Jumps.html#Jumps" title="Jumps">
|
||||
<link rel="next" href="OpenMP.html#OpenMP" title="OpenMP">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Cleanups"></a>
|
||||
Next: <a rel="next" accesskey="n" href="OpenMP.html#OpenMP">OpenMP</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Jumps.html#Jumps">Jumps</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Statements.html#Statements">Statements</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.7.6 Cleanups</h4>
|
||||
|
||||
<p><a name="index-Cleanups-2524"></a>
|
||||
Destructors for local C++ objects and similar dynamic cleanups are
|
||||
represented in GIMPLE by a <code>TRY_FINALLY_EXPR</code>.
|
||||
<code>TRY_FINALLY_EXPR</code> has two operands, both of which are a sequence
|
||||
of statements to execute. The first sequence is executed. When it
|
||||
completes the second sequence is executed.
|
||||
|
||||
<p>The first sequence may complete in the following ways:
|
||||
|
||||
<ol type=1 start=1>
|
||||
|
||||
<li>Execute the last statement in the sequence and fall off the
|
||||
end.
|
||||
|
||||
<li>Execute a goto statement (<code>GOTO_EXPR</code>) to an ordinary
|
||||
label outside the sequence.
|
||||
|
||||
<li>Execute a return statement (<code>RETURN_EXPR</code>).
|
||||
|
||||
<li>Throw an exception. This is currently not explicitly represented in
|
||||
GIMPLE.
|
||||
|
||||
</ol>
|
||||
|
||||
<p>The second sequence is not executed if the first sequence completes by
|
||||
calling <code>setjmp</code> or <code>exit</code> or any other function that does
|
||||
not return. The second sequence is also not executed if the first
|
||||
sequence completes via a non-local goto or a computed goto (in general
|
||||
the compiler does not know whether such a goto statement exits the
|
||||
first sequence or not, so we assume that it doesn't).
|
||||
|
||||
<p>After the second sequence is executed, if it completes normally by
|
||||
falling off the end, execution continues wherever the first sequence
|
||||
would have continued, by falling off the end, or doing a goto, etc.
|
||||
|
||||
<p><code>TRY_FINALLY_EXPR</code> complicates the flow graph, since the cleanup
|
||||
needs to appear on every edge out of the controlled block; this
|
||||
reduces the freedom to move code across these edges. Therefore, the
|
||||
EH lowering pass which runs before most of the optimization passes
|
||||
eliminates these expressions by explicitly adding the cleanup to each
|
||||
edge. Rethrowing the exception is represented using <code>RESX_EXPR</code>.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Code Iterators - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Iterators.html#Iterators" title="Iterators">
|
||||
<link rel="prev" href="Mode-Iterators.html#Mode-Iterators" title="Mode Iterators">
|
||||
<link rel="next" href="Int-Iterators.html#Int-Iterators" title="Int Iterators">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Code-Iterators"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Int-Iterators.html#Int-Iterators">Int Iterators</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Mode-Iterators.html#Mode-Iterators">Mode Iterators</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Iterators.html#Iterators">Iterators</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.23.2 Code Iterators</h4>
|
||||
|
||||
<p><a name="index-code-iterators-in-_0040file_007b_002emd_007d-files-3778"></a><a name="index-define_005fcode_005fiterator-3779"></a><a name="index-define_005fcode_005fattr-3780"></a>
|
||||
Code iterators operate in a similar way to mode iterators. See <a href="Mode-Iterators.html#Mode-Iterators">Mode Iterators</a>.
|
||||
|
||||
<p>The construct:
|
||||
|
||||
<pre class="smallexample"> (define_code_iterator <var>name</var> [(<var>code1</var> "<var>cond1</var>") ... (<var>coden</var> "<var>condn</var>")])
|
||||
</pre>
|
||||
<p>defines a pseudo rtx code <var>name</var> that can be instantiated as
|
||||
<var>codei</var> if condition <var>condi</var> is true. Each <var>codei</var>
|
||||
must have the same rtx format. See <a href="RTL-Classes.html#RTL-Classes">RTL Classes</a>.
|
||||
|
||||
<p>As with mode iterators, each pattern that uses <var>name</var> will be
|
||||
expanded <var>n</var> times, once with all uses of <var>name</var> replaced by
|
||||
<var>code1</var>, once with all uses replaced by <var>code2</var>, and so on.
|
||||
See <a href="Defining-Mode-Iterators.html#Defining-Mode-Iterators">Defining Mode Iterators</a>.
|
||||
|
||||
<p>It is possible to define attributes for codes as well as for modes.
|
||||
There are two standard code attributes: <code>code</code>, the name of the
|
||||
code in lower case, and <code>CODE</code>, the name of the code in upper case.
|
||||
Other attributes are defined using:
|
||||
|
||||
<pre class="smallexample"> (define_code_attr <var>name</var> [(<var>code1</var> "<var>value1</var>") ... (<var>coden</var> "<var>valuen</var>")])
|
||||
</pre>
|
||||
<p>Here's an example of code iterators in action, taken from the MIPS port:
|
||||
|
||||
<pre class="smallexample"> (define_code_iterator any_cond [unordered ordered unlt unge uneq ltgt unle ungt
|
||||
eq ne gt ge lt le gtu geu ltu leu])
|
||||
|
||||
(define_expand "b<code>"
|
||||
[(set (pc)
|
||||
(if_then_else (any_cond:CC (cc0)
|
||||
(const_int 0))
|
||||
(label_ref (match_operand 0 ""))
|
||||
(pc)))]
|
||||
""
|
||||
{
|
||||
gen_conditional_branch (operands, <CODE>);
|
||||
DONE;
|
||||
})
|
||||
</pre>
|
||||
<p>This is equivalent to:
|
||||
|
||||
<pre class="smallexample"> (define_expand "bunordered"
|
||||
[(set (pc)
|
||||
(if_then_else (unordered:CC (cc0)
|
||||
(const_int 0))
|
||||
(label_ref (match_operand 0 ""))
|
||||
(pc)))]
|
||||
""
|
||||
{
|
||||
gen_conditional_branch (operands, UNORDERED);
|
||||
DONE;
|
||||
})
|
||||
|
||||
(define_expand "bordered"
|
||||
[(set (pc)
|
||||
(if_then_else (ordered:CC (cc0)
|
||||
(const_int 0))
|
||||
(label_ref (match_operand 0 ""))
|
||||
(pc)))]
|
||||
""
|
||||
{
|
||||
gen_conditional_branch (operands, ORDERED);
|
||||
DONE;
|
||||
})
|
||||
|
||||
...
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Collect2 - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="prev" href="Fragments.html#Fragments" title="Fragments">
|
||||
<link rel="next" href="Header-Dirs.html#Header-Dirs" title="Header Dirs">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Collect2"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Header-Dirs.html#Header-Dirs">Header Dirs</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Fragments.html#Fragments">Fragments</a>,
|
||||
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h2 class="chapter">20 <code>collect2</code></h2>
|
||||
|
||||
<p>GCC uses a utility called <code>collect2</code> on nearly all systems to arrange
|
||||
to call various initialization functions at start time.
|
||||
|
||||
<p>The program <code>collect2</code> works by linking the program once and
|
||||
looking through the linker output file for symbols with particular names
|
||||
indicating they are constructor functions. If it finds any, it
|
||||
creates a new temporary ‘<samp><span class="samp">.c</span></samp>’ file containing a table of them,
|
||||
compiles it, and links the program a second time including that file.
|
||||
|
||||
<p><a name="index-g_t_005f_005fmain-4984"></a><a name="index-constructors_002c-automatic-calls-4985"></a>The actual calls to the constructors are carried out by a subroutine
|
||||
called <code>__main</code>, which is called (automatically) at the beginning
|
||||
of the body of <code>main</code> (provided <code>main</code> was compiled with GNU
|
||||
CC). Calling <code>__main</code> is necessary, even when compiling C code, to
|
||||
allow linking C and C++ object code together. (If you use
|
||||
<samp><span class="option">-nostdlib</span></samp>, you get an unresolved reference to <code>__main</code>,
|
||||
since it's defined in the standard GCC library. Include <samp><span class="option">-lgcc</span></samp> at
|
||||
the end of your compiler command line to resolve this reference.)
|
||||
|
||||
<p>The program <code>collect2</code> is installed as <code>ld</code> in the directory
|
||||
where the passes of the compiler are installed. When <code>collect2</code>
|
||||
needs to find the <em>real</em> <code>ld</code>, it tries the following file
|
||||
names:
|
||||
|
||||
<ul>
|
||||
<li>a hard coded linker file name, if GCC was configured with the
|
||||
<samp><span class="option">--with-ld</span></samp> option.
|
||||
|
||||
<li><samp><span class="file">real-ld</span></samp> in the directories listed in the compiler's search
|
||||
directories.
|
||||
|
||||
<li><samp><span class="file">real-ld</span></samp> in the directories listed in the environment variable
|
||||
<code>PATH</code>.
|
||||
|
||||
<li>The file specified in the <code>REAL_LD_FILE_NAME</code> configuration macro,
|
||||
if specified.
|
||||
|
||||
<li><samp><span class="file">ld</span></samp> in the compiler's search directories, except that
|
||||
<code>collect2</code> will not execute itself recursively.
|
||||
|
||||
<li><samp><span class="file">ld</span></samp> in <code>PATH</code>.
|
||||
</ul>
|
||||
|
||||
<p>“The compiler's search directories” means all the directories where
|
||||
<samp><span class="command">gcc</span></samp> searches for passes of the compiler. This includes
|
||||
directories that you specify with <samp><span class="option">-B</span></samp>.
|
||||
|
||||
<p>Cross-compilers search a little differently:
|
||||
|
||||
<ul>
|
||||
<li><samp><span class="file">real-ld</span></samp> in the compiler's search directories.
|
||||
|
||||
<li><samp><var>target</var><span class="file">-real-ld</span></samp> in <code>PATH</code>.
|
||||
|
||||
<li>The file specified in the <code>REAL_LD_FILE_NAME</code> configuration macro,
|
||||
if specified.
|
||||
|
||||
<li><samp><span class="file">ld</span></samp> in the compiler's search directories.
|
||||
|
||||
<li><samp><var>target</var><span class="file">-ld</span></samp> in <code>PATH</code>.
|
||||
</ul>
|
||||
|
||||
<p><code>collect2</code> explicitly avoids running <code>ld</code> using the file name
|
||||
under which <code>collect2</code> itself was invoked. In fact, it remembers
|
||||
up a list of such names—in case one copy of <code>collect2</code> finds
|
||||
another copy (or version) of <code>collect2</code> installed as <code>ld</code> in a
|
||||
second place in the search path.
|
||||
|
||||
<p><code>collect2</code> searches for the utilities <code>nm</code> and <code>strip</code>
|
||||
using the same algorithm as above for <code>ld</code>.
|
||||
|
||||
<!-- Copyright (C) 1988-2013 Free Software Foundation, Inc. -->
|
||||
<!-- This is part of the GCC manual. -->
|
||||
<!-- For copying conditions, see the file gcc.texi. -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Comparisons - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Arithmetic.html#Arithmetic" title="Arithmetic">
|
||||
<link rel="next" href="Bit_002dFields.html#Bit_002dFields" title="Bit-Fields">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Comparisons"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Bit_002dFields.html#Bit_002dFields">Bit-Fields</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Arithmetic.html#Arithmetic">Arithmetic</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.10 Comparison Operations</h3>
|
||||
|
||||
<p><a name="index-RTL-comparison-operations-2122"></a>
|
||||
Comparison operators test a relation on two operands and are considered
|
||||
to represent a machine-dependent nonzero value described by, but not
|
||||
necessarily equal to, <code>STORE_FLAG_VALUE</code> (see <a href="Misc.html#Misc">Misc</a>)
|
||||
if the relation holds, or zero if it does not, for comparison operators
|
||||
whose results have a `MODE_INT' mode,
|
||||
<code>FLOAT_STORE_FLAG_VALUE</code> (see <a href="Misc.html#Misc">Misc</a>) if the relation holds, or
|
||||
zero if it does not, for comparison operators that return floating-point
|
||||
values, and a vector of either <code>VECTOR_STORE_FLAG_VALUE</code> (see <a href="Misc.html#Misc">Misc</a>)
|
||||
if the relation holds, or of zeros if it does not, for comparison operators
|
||||
that return vector results.
|
||||
The mode of the comparison operation is independent of the mode
|
||||
of the data being compared. If the comparison operation is being tested
|
||||
(e.g., the first operand of an <code>if_then_else</code>), the mode must be
|
||||
<code>VOIDmode</code>.
|
||||
|
||||
<p><a name="index-condition-codes-2123"></a>There are two ways that comparison operations may be used. The
|
||||
comparison operators may be used to compare the condition codes
|
||||
<code>(cc0)</code> against zero, as in <code>(eq (cc0) (const_int 0))</code>. Such
|
||||
a construct actually refers to the result of the preceding instruction
|
||||
in which the condition codes were set. The instruction setting the
|
||||
condition code must be adjacent to the instruction using the condition
|
||||
code; only <code>note</code> insns may separate them.
|
||||
|
||||
<p>Alternatively, a comparison operation may directly compare two data
|
||||
objects. The mode of the comparison is determined by the operands; they
|
||||
must both be valid for a common machine mode. A comparison with both
|
||||
operands constant would be invalid as the machine mode could not be
|
||||
deduced from it, but such a comparison should never exist in RTL due to
|
||||
constant folding.
|
||||
|
||||
<p>In the example above, if <code>(cc0)</code> were last set to
|
||||
<code>(compare </code><var>x</var> <var>y</var><code>)</code>, the comparison operation is
|
||||
identical to <code>(eq </code><var>x</var> <var>y</var><code>)</code>. Usually only one style
|
||||
of comparisons is supported on a particular machine, but the combine
|
||||
pass will try to merge the operations to produce the <code>eq</code> shown
|
||||
in case it exists in the context of the particular insn involved.
|
||||
|
||||
<p>Inequality comparisons come in two flavors, signed and unsigned. Thus,
|
||||
there are distinct expression codes <code>gt</code> and <code>gtu</code> for signed and
|
||||
unsigned greater-than. These can produce different results for the same
|
||||
pair of integer values: for example, 1 is signed greater-than −1 but not
|
||||
unsigned greater-than, because −1 when regarded as unsigned is actually
|
||||
<code>0xffffffff</code> which is greater than 1.
|
||||
|
||||
<p>The signed comparisons are also used for floating point values. Floating
|
||||
point comparisons are distinguished by the machine modes of the operands.
|
||||
|
||||
|
||||
<a name="index-eq-2124"></a>
|
||||
<a name="index-equal-2125"></a>
|
||||
<dl><dt><code>(eq:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd><code>STORE_FLAG_VALUE</code> if the values represented by <var>x</var> and <var>y</var>
|
||||
are equal, otherwise 0.
|
||||
|
||||
<p><a name="index-ne-2126"></a><a name="index-not-equal-2127"></a><br><dt><code>(ne:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd><code>STORE_FLAG_VALUE</code> if the values represented by <var>x</var> and <var>y</var>
|
||||
are not equal, otherwise 0.
|
||||
|
||||
<p><a name="index-gt-2128"></a><a name="index-greater-than-2129"></a><br><dt><code>(gt:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd><code>STORE_FLAG_VALUE</code> if the <var>x</var> is greater than <var>y</var>. If they
|
||||
are fixed-point, the comparison is done in a signed sense.
|
||||
|
||||
<p><a name="index-gtu-2130"></a><a name="index-greater-than-2131"></a><a name="index-unsigned-greater-than-2132"></a><br><dt><code>(gtu:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Like <code>gt</code> but does unsigned comparison, on fixed-point numbers only.
|
||||
|
||||
<p><a name="index-lt-2133"></a><a name="index-less-than-2134"></a><a name="index-ltu-2135"></a><a name="index-unsigned-less-than-2136"></a><br><dt><code>(lt:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(ltu:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Like <code>gt</code> and <code>gtu</code> but test for “less than”.
|
||||
|
||||
<p><a name="index-ge-2137"></a><a name="index-greater-than-2138"></a><a name="index-geu-2139"></a><a name="index-unsigned-greater-than-2140"></a><br><dt><code>(ge:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(geu:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Like <code>gt</code> and <code>gtu</code> but test for “greater than or equal”.
|
||||
|
||||
<p><a name="index-le-2141"></a><a name="index-less-than-or-equal-2142"></a><a name="index-leu-2143"></a><a name="index-unsigned-less-than-2144"></a><br><dt><code>(le:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dt><code>(leu:</code><var>m</var> <var>x</var> <var>y</var><code>)</code><dd>Like <code>gt</code> and <code>gtu</code> but test for “less than or equal”.
|
||||
|
||||
<p><a name="index-if_005fthen_005felse-2145"></a><br><dt><code>(if_then_else </code><var>cond</var> <var>then</var> <var>else</var><code>)</code><dd>This is not a comparison operation but is listed here because it is
|
||||
always used in conjunction with a comparison operation. To be
|
||||
precise, <var>cond</var> is a comparison expression. This expression
|
||||
represents a choice, according to <var>cond</var>, between the value
|
||||
represented by <var>then</var> and the one represented by <var>else</var>.
|
||||
|
||||
<p>On most machines, <code>if_then_else</code> expressions are valid only
|
||||
to express conditional jumps.
|
||||
|
||||
<p><a name="index-cond-2146"></a><br><dt><code>(cond [</code><var>test1</var> <var>value1</var> <var>test2</var> <var>value2</var><code> ...] </code><var>default</var><code>)</code><dd>Similar to <code>if_then_else</code>, but more general. Each of <var>test1</var>,
|
||||
<var>test2</var>, <small class="dots">...</small> is performed in turn. The result of this expression is
|
||||
the <var>value</var> corresponding to the first nonzero test, or <var>default</var> if
|
||||
none of the tests are nonzero expressions.
|
||||
|
||||
<p>This is currently not valid for instruction patterns and is supported only
|
||||
for insn attributes. See <a href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Compound Expressions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Operands.html#Operands" title="Operands">
|
||||
<link rel="next" href="Compound-Lvalues.html#Compound-Lvalues" title="Compound Lvalues">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Compound-Expressions"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Compound-Lvalues.html#Compound-Lvalues">Compound Lvalues</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Operands.html#Operands">Operands</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">12.5.1 Compound Expressions</h4>
|
||||
|
||||
<p><a name="index-Compound-Expressions-2712"></a>
|
||||
The left-hand side of a C comma expression is simply moved into a separate
|
||||
statement.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Compound Lvalues - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Operands.html#Operands" title="Operands">
|
||||
<link rel="prev" href="Compound-Expressions.html#Compound-Expressions" title="Compound Expressions">
|
||||
<link rel="next" href="Conditional-Expressions.html#Conditional-Expressions" title="Conditional Expressions">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Compound-Lvalues"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Conditional-Expressions.html#Conditional-Expressions">Conditional Expressions</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Compound-Expressions.html#Compound-Expressions">Compound Expressions</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Operands.html#Operands">Operands</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">12.5.2 Compound Lvalues</h4>
|
||||
|
||||
<p><a name="index-Compound-Lvalues-2713"></a>
|
||||
Currently compound lvalues involving array and structure field references
|
||||
are not broken down; an expression like <code>a.b[2] = 42</code> is not reduced
|
||||
any further (though complex array subscripts are). This restriction is a
|
||||
workaround for limitations in later optimizers; if we were to convert this
|
||||
to
|
||||
|
||||
<pre class="smallexample"> T1 = &a.b;
|
||||
T1[2] = 42;
|
||||
</pre>
|
||||
<p>alias analysis would not remember that the reference to <code>T1[2]</code> came
|
||||
by way of <code>a.b</code>, so it would think that the assignment could alias
|
||||
another member of <code>a</code>; this broke <code>struct-alias-1.c</code>. Future
|
||||
optimizer improvements may make this limitation unnecessary.
|
||||
|
||||
</body></html>
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,61 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Cond Exec Macros - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Condition-Code.html#Condition-Code" title="Condition Code">
|
||||
<link rel="prev" href="MODE_005fCC-Condition-Codes.html#MODE_005fCC-Condition-Codes" title="MODE_CC Condition Codes">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Cond-Exec-Macros"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="MODE_005fCC-Condition-Codes.html#MODE_005fCC-Condition-Codes">MODE_CC Condition Codes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Condition-Code.html#Condition-Code">Condition Code</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.16.3 Macros to control conditional execution</h4>
|
||||
|
||||
<p><a name="index-conditional-execution-4381"></a><a name="index-predication-4382"></a>
|
||||
There is one macro that may need to be defined for targets
|
||||
supporting conditional execution, independent of how they
|
||||
represent conditional branches.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Condition Code - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="Anchored-Addresses.html#Anchored-Addresses" title="Anchored Addresses">
|
||||
<link rel="next" href="Costs.html#Costs" title="Costs">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Condition-Code"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Costs.html#Costs">Costs</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Anchored-Addresses.html#Anchored-Addresses">Anchored Addresses</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.16 Condition Code Status</h3>
|
||||
|
||||
<p><a name="index-condition-code-status-4367"></a>
|
||||
The macros in this section can be split in two families, according to the
|
||||
two ways of representing condition codes in GCC.
|
||||
|
||||
<p>The first representation is the so called <code>(cc0)</code> representation
|
||||
(see <a href="Jump-Patterns.html#Jump-Patterns">Jump Patterns</a>), where all instructions can have an implicit
|
||||
clobber of the condition codes. The second is the condition code
|
||||
register representation, which provides better schedulability for
|
||||
architectures that do have a condition code register, but on which
|
||||
most instructions do not affect it. The latter category includes
|
||||
most RISC machines.
|
||||
|
||||
<p>The implicit clobbering poses a strong restriction on the placement of
|
||||
the definition and use of the condition code, which need to be in adjacent
|
||||
insns for machines using <code>(cc0)</code>. This can prevent important
|
||||
optimizations on some machines. For example, on the IBM RS/6000, there
|
||||
is a delay for taken branches unless the condition code register is set
|
||||
three instructions earlier than the conditional branch. The instruction
|
||||
scheduler cannot perform this optimization if it is not permitted to
|
||||
separate the definition and use of the condition code register.
|
||||
|
||||
<p>For this reason, it is possible and suggested to use a register to
|
||||
represent the condition code for new ports. If there is a specific
|
||||
condition code register in the machine, use a hard register. If the
|
||||
condition code or comparison result can be placed in any general register,
|
||||
or if there are multiple condition registers, use a pseudo register.
|
||||
Registers used to store the condition code value will usually have a mode
|
||||
that is in class <code>MODE_CC</code>.
|
||||
|
||||
<p>Alternatively, you can use <code>BImode</code> if the comparison operator is
|
||||
specified already in the compare instruction. In this case, you are not
|
||||
interested in most macros in this section.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="CC0-Condition-Codes.html#CC0-Condition-Codes">CC0 Condition Codes</a>: Old style representation of condition codes.
|
||||
<li><a accesskey="2" href="MODE_005fCC-Condition-Codes.html#MODE_005fCC-Condition-Codes">MODE_CC Condition Codes</a>: Modern representation of condition codes.
|
||||
<li><a accesskey="3" href="Cond-Exec-Macros.html#Cond-Exec-Macros">Cond Exec Macros</a>: Macros to control conditional execution.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Conditional Execution - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Machine-Desc.html#Machine-Desc" title="Machine Desc">
|
||||
<link rel="prev" href="Insn-Attributes.html#Insn-Attributes" title="Insn Attributes">
|
||||
<link rel="next" href="Define-Subst.html#Define-Subst" title="Define Subst">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Conditional-Execution"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Define-Subst.html#Define-Subst">Define Subst</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Machine-Desc.html#Machine-Desc">Machine Desc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">16.20 Conditional Execution</h3>
|
||||
|
||||
<p><a name="index-conditional-execution-3757"></a><a name="index-predication-3758"></a>
|
||||
A number of architectures provide for some form of conditional
|
||||
execution, or predication. The hallmark of this feature is the
|
||||
ability to nullify most of the instructions in the instruction set.
|
||||
When the instruction set is large and not entirely symmetric, it
|
||||
can be quite tedious to describe these forms directly in the
|
||||
<samp><span class="file">.md</span></samp> file. An alternative is the <code>define_cond_exec</code> template.
|
||||
|
||||
<p><a name="index-define_005fcond_005fexec-3759"></a>
|
||||
<pre class="smallexample"> (define_cond_exec
|
||||
[<var>predicate-pattern</var>]
|
||||
"<var>condition</var>"
|
||||
"<var>output-template</var>")
|
||||
</pre>
|
||||
<p><var>predicate-pattern</var> is the condition that must be true for the
|
||||
insn to be executed at runtime and should match a relational operator.
|
||||
One can use <code>match_operator</code> to match several relational operators
|
||||
at once. Any <code>match_operand</code> operands must have no more than one
|
||||
alternative.
|
||||
|
||||
<p><var>condition</var> is a C expression that must be true for the generated
|
||||
pattern to match.
|
||||
|
||||
<p><a name="index-current_005finsn_005fpredicate-3760"></a><var>output-template</var> is a string similar to the <code>define_insn</code>
|
||||
output template (see <a href="Output-Template.html#Output-Template">Output Template</a>), except that the ‘<samp><span class="samp">*</span></samp>’
|
||||
and ‘<samp><span class="samp">@</span></samp>’ special cases do not apply. This is only useful if the
|
||||
assembly text for the predicate is a simple prefix to the main insn.
|
||||
In order to handle the general case, there is a global variable
|
||||
<code>current_insn_predicate</code> that will contain the entire predicate
|
||||
if the current insn is predicated, and will otherwise be <code>NULL</code>.
|
||||
|
||||
<p>When <code>define_cond_exec</code> is used, an implicit reference to
|
||||
the <code>predicable</code> instruction attribute is made.
|
||||
See <a href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>. This attribute must be a boolean (i.e. have
|
||||
exactly two elements in its <var>list-of-values</var>), with the possible
|
||||
values being <code>no</code> and <code>yes</code>. The default and all uses in
|
||||
the insns must be a simple constant, not a complex expressions. It
|
||||
may, however, depend on the alternative, by using a comma-separated
|
||||
list of values. If that is the case, the port should also define an
|
||||
<code>enabled</code> attribute (see <a href="Disable-Insn-Alternatives.html#Disable-Insn-Alternatives">Disable Insn Alternatives</a>), which
|
||||
should also allow only <code>no</code> and <code>yes</code> as its values.
|
||||
|
||||
<p>For each <code>define_insn</code> for which the <code>predicable</code>
|
||||
attribute is true, a new <code>define_insn</code> pattern will be
|
||||
generated that matches a predicated version of the instruction.
|
||||
For example,
|
||||
|
||||
<pre class="smallexample"> (define_insn "addsi"
|
||||
[(set (match_operand:SI 0 "register_operand" "r")
|
||||
(plus:SI (match_operand:SI 1 "register_operand" "r")
|
||||
(match_operand:SI 2 "register_operand" "r")))]
|
||||
"<var>test1</var>"
|
||||
"add %2,%1,%0")
|
||||
|
||||
(define_cond_exec
|
||||
[(ne (match_operand:CC 0 "register_operand" "c")
|
||||
(const_int 0))]
|
||||
"<var>test2</var>"
|
||||
"(%0)")
|
||||
</pre>
|
||||
<p class="noindent">generates a new pattern
|
||||
|
||||
<pre class="smallexample"> (define_insn ""
|
||||
[(cond_exec
|
||||
(ne (match_operand:CC 3 "register_operand" "c") (const_int 0))
|
||||
(set (match_operand:SI 0 "register_operand" "r")
|
||||
(plus:SI (match_operand:SI 1 "register_operand" "r")
|
||||
(match_operand:SI 2 "register_operand" "r"))))]
|
||||
"(<var>test2</var>) && (<var>test1</var>)"
|
||||
"(%3) add %2,%1,%0")
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Conditional Expressions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Operands.html#Operands" title="Operands">
|
||||
<link rel="prev" href="Compound-Lvalues.html#Compound-Lvalues" title="Compound Lvalues">
|
||||
<link rel="next" href="Logical-Operators.html#Logical-Operators" title="Logical Operators">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Conditional-Expressions"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Logical-Operators.html#Logical-Operators">Logical Operators</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Compound-Lvalues.html#Compound-Lvalues">Compound Lvalues</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Operands.html#Operands">Operands</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">12.5.3 Conditional Expressions</h4>
|
||||
|
||||
<p><a name="index-Conditional-Expressions-2714"></a>
|
||||
A C <code>?:</code> expression is converted into an <code>if</code> statement with
|
||||
each branch assigning to the same temporary. So,
|
||||
|
||||
<pre class="smallexample"> a = b ? c : d;
|
||||
</pre>
|
||||
<p>becomes
|
||||
<pre class="smallexample"> if (b == 1)
|
||||
T1 = c;
|
||||
else
|
||||
T1 = d;
|
||||
a = T1;
|
||||
</pre>
|
||||
<p>The GIMPLE level if-conversion pass re-introduces <code>?:</code>
|
||||
expression, if appropriate. It is used to vectorize loops with
|
||||
conditions using vector conditional operations.
|
||||
|
||||
<p>Note that in GIMPLE, <code>if</code> statements are represented using
|
||||
<code>GIMPLE_COND</code>, as described below.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Config Fragments - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Configuration.html#Configuration" title="Configuration">
|
||||
<link rel="next" href="System-Config.html#System-Config" title="System Config">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Config-Fragments"></a>
|
||||
Next: <a rel="next" accesskey="n" href="System-Config.html#System-Config">System Config</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Configuration.html#Configuration">Configuration</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h5 class="subsubsection">6.3.2.1 Scripts Used by <samp><span class="file">configure</span></samp></h5>
|
||||
|
||||
<p><samp><span class="file">configure</span></samp> uses some other scripts to help in its work:
|
||||
|
||||
<ul>
|
||||
<li>The standard GNU <samp><span class="file">config.sub</span></samp> and <samp><span class="file">config.guess</span></samp>
|
||||
files, kept in the top level directory, are used.
|
||||
|
||||
<li>The file <samp><span class="file">config.gcc</span></samp> is used to handle configuration
|
||||
specific to the particular target machine. The file
|
||||
<samp><span class="file">config.build</span></samp> is used to handle configuration specific to the
|
||||
particular build machine. The file <samp><span class="file">config.host</span></samp> is used to handle
|
||||
configuration specific to the particular host machine. (In general,
|
||||
these should only be used for features that cannot reasonably be tested in
|
||||
Autoconf feature tests.)
|
||||
See <a href="System-Config.html#System-Config">The <samp><span class="file">config.build</span></samp>; <samp><span class="file">config.host</span></samp>; and <samp><span class="file">config.gcc</span></samp> Files</a>, for details of the contents of these files.
|
||||
|
||||
<li>Each language subdirectory has a file
|
||||
<samp><var>language</var><span class="file">/config-lang.in</span></samp> that is used for
|
||||
front-end-specific configuration. See <a href="Front-End-Config.html#Front-End-Config">The Front End <samp><span class="file">config-lang.in</span></samp> File</a>, for details of this file.
|
||||
|
||||
<li>A helper script <samp><span class="file">configure.frag</span></samp> is used as part of
|
||||
creating the output of <samp><span class="file">configure</span></samp>.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Configuration Files - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Configuration.html#Configuration" title="Configuration">
|
||||
<link rel="prev" href="System-Config.html#System-Config" title="System Config">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Configuration-Files"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="System-Config.html#System-Config">System Config</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Configuration.html#Configuration">Configuration</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h5 class="subsubsection">6.3.2.3 Files Created by <code>configure</code></h5>
|
||||
|
||||
<p>Here we spell out what files will be set up by <samp><span class="file">configure</span></samp> in the
|
||||
<samp><span class="file">gcc</span></samp> directory. Some other files are created as temporary files
|
||||
in the configuration process, and are not used in the subsequent
|
||||
build; these are not documented.
|
||||
|
||||
<ul>
|
||||
<li><samp><span class="file">Makefile</span></samp> is constructed from <samp><span class="file">Makefile.in</span></samp>, together with
|
||||
the host and target fragments (see <a href="Fragments.html#Fragments">Makefile Fragments</a>) <samp><span class="file">t-</span><var>target</var></samp> and <samp><span class="file">x-</span><var>host</var></samp> from
|
||||
<samp><span class="file">config</span></samp>, if any, and language Makefile fragments
|
||||
<samp><var>language</var><span class="file">/Make-lang.in</span></samp>.
|
||||
<li><samp><span class="file">auto-host.h</span></samp> contains information about the host machine
|
||||
determined by <samp><span class="file">configure</span></samp>. If the host machine is different from
|
||||
the build machine, then <samp><span class="file">auto-build.h</span></samp> is also created,
|
||||
containing such information about the build machine.
|
||||
<li><samp><span class="file">config.status</span></samp> is a script that may be run to recreate the
|
||||
current configuration.
|
||||
<li><samp><span class="file">configargs.h</span></samp> is a header containing details of the arguments
|
||||
passed to <samp><span class="file">configure</span></samp> to configure GCC, and of the thread model
|
||||
used.
|
||||
<li><samp><span class="file">cstamp-h</span></samp> is used as a timestamp.
|
||||
<li>If a language <samp><span class="file">config-lang.in</span></samp> file (see <a href="Front-End-Config.html#Front-End-Config">The Front End <samp><span class="file">config-lang.in</span></samp> File</a>) sets <code>outputs</code>, then
|
||||
the files listed in <code>outputs</code> there are also generated.
|
||||
</ul>
|
||||
|
||||
<p>The following configuration headers are created from the Makefile,
|
||||
using <samp><span class="file">mkconfig.sh</span></samp>, rather than directly by <samp><span class="file">configure</span></samp>.
|
||||
<samp><span class="file">config.h</span></samp>, <samp><span class="file">bconfig.h</span></samp> and <samp><span class="file">tconfig.h</span></samp> all contain the
|
||||
<samp><span class="file">xm-</span><var>machine</var><span class="file">.h</span></samp> header, if any, appropriate to the host,
|
||||
build and target machines respectively, the configuration headers for
|
||||
the target, and some definitions; for the host and build machines,
|
||||
these include the autoconfigured headers generated by
|
||||
<samp><span class="file">configure</span></samp>. The other configuration headers are determined by
|
||||
<samp><span class="file">config.gcc</span></samp>. They also contain the typedefs for <code>rtx</code>,
|
||||
<code>rtvec</code> and <code>tree</code>.
|
||||
|
||||
<ul>
|
||||
<li><samp><span class="file">config.h</span></samp>, for use in programs that run on the host machine.
|
||||
<li><samp><span class="file">bconfig.h</span></samp>, for use in programs that run on the build machine.
|
||||
<li><samp><span class="file">tconfig.h</span></samp>, for use in programs and libraries for the target
|
||||
machine.
|
||||
<li><samp><span class="file">tm_p.h</span></samp>, which includes the header <samp><var>machine</var><span class="file">-protos.h</span></samp>
|
||||
that contains prototypes for functions in the target
|
||||
<samp><var>machine</var><span class="file">.c</span></samp> file. The header <samp><var>machine</var><span class="file">-protos.h</span></samp>
|
||||
can include prototypes of functions that use rtl and tree data
|
||||
structures inside appropriate <code>#ifdef RTX_CODE</code> and <code>#ifdef
|
||||
TREE_CODE</code> conditional code segements. The
|
||||
<samp><var>machine</var><span class="file">-protos.h</span></samp> is included after the <samp><span class="file">rtl.h</span></samp>
|
||||
and/or <samp><span class="file">tree.h</span></samp> would have been included. The <samp><span class="file">tm_p.h</span></samp> also
|
||||
includes the header <samp><span class="file">tm-preds.h</span></samp> which is generated by
|
||||
<samp><span class="file">genpreds</span></samp> program during the build to define the declarations
|
||||
and inline functions for the predicate functions.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Configuration - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="gcc-Directory.html#gcc-Directory" title="gcc Directory">
|
||||
<link rel="prev" href="Subdirectories.html#Subdirectories" title="Subdirectories">
|
||||
<link rel="next" href="Build.html#Build" title="Build">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Configuration"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Build.html#Build">Build</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Subdirectories.html#Subdirectories">Subdirectories</a>,
|
||||
Up: <a rel="up" accesskey="u" href="gcc-Directory.html#gcc-Directory">gcc Directory</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">6.3.2 Configuration in the <samp><span class="file">gcc</span></samp> Directory</h4>
|
||||
|
||||
<p>The <samp><span class="file">gcc</span></samp> directory is configured with an Autoconf-generated
|
||||
script <samp><span class="file">configure</span></samp>. The <samp><span class="file">configure</span></samp> script is generated
|
||||
from <samp><span class="file">configure.ac</span></samp> and <samp><span class="file">aclocal.m4</span></samp>. From the files
|
||||
<samp><span class="file">configure.ac</span></samp> and <samp><span class="file">acconfig.h</span></samp>, Autoheader generates the
|
||||
file <samp><span class="file">config.in</span></samp>. The file <samp><span class="file">cstamp-h.in</span></samp> is used as a
|
||||
timestamp.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Config-Fragments.html#Config-Fragments">Config Fragments</a>: Scripts used by <samp><span class="file">configure</span></samp>.
|
||||
<li><a accesskey="2" href="System-Config.html#System-Config">System Config</a>: The <samp><span class="file">config.build</span></samp>, <samp><span class="file">config.host</span></samp>, and
|
||||
<samp><span class="file">config.gcc</span></samp> files.
|
||||
<li><a accesskey="3" href="Configuration-Files.html#Configuration-Files">Configuration Files</a>: Files created by running <samp><span class="file">configure</span></samp>.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Configure Terms - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Source-Tree.html#Source-Tree" title="Source Tree">
|
||||
<link rel="next" href="Top-Level.html#Top-Level" title="Top Level">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Configure-Terms"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Top-Level.html#Top-Level">Top Level</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Source-Tree.html#Source-Tree">Source Tree</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">6.1 Configure Terms and History</h3>
|
||||
|
||||
<p><a name="index-configure-terms-1662"></a><a name="index-canadian-1663"></a>
|
||||
The configure and build process has a long and colorful history, and can
|
||||
be confusing to anyone who doesn't know why things are the way they are.
|
||||
While there are other documents which describe the configuration process
|
||||
in detail, here are a few things that everyone working on GCC should
|
||||
know.
|
||||
|
||||
<p>There are three system names that the build knows about: the machine you
|
||||
are building on (<dfn>build</dfn>), the machine that you are building for
|
||||
(<dfn>host</dfn>), and the machine that GCC will produce code for
|
||||
(<dfn>target</dfn>). When you configure GCC, you specify these with
|
||||
<samp><span class="option">--build=</span></samp>, <samp><span class="option">--host=</span></samp>, and <samp><span class="option">--target=</span></samp>.
|
||||
|
||||
<p>Specifying the host without specifying the build should be avoided, as
|
||||
<samp><span class="command">configure</span></samp> may (and once did) assume that the host you specify
|
||||
is also the build, which may not be true.
|
||||
|
||||
<p>If build, host, and target are all the same, this is called a
|
||||
<dfn>native</dfn>. If build and host are the same but target is different,
|
||||
this is called a <dfn>cross</dfn>. If build, host, and target are all
|
||||
different this is called a <dfn>canadian</dfn> (for obscure reasons dealing
|
||||
with Canada's political party and the background of the person working
|
||||
on the build at that time). If host and target are the same, but build
|
||||
is different, you are using a cross-compiler to build a native for a
|
||||
different system. Some people call this a <dfn>host-x-host</dfn>,
|
||||
<dfn>crossed native</dfn>, or <dfn>cross-built native</dfn>. If build and target
|
||||
are the same, but host is different, you are using a cross compiler to
|
||||
build a cross compiler that produces code for the machine you're
|
||||
building on. This is rare, so there is no common way of describing it.
|
||||
There is a proposal to call this a <dfn>crossback</dfn>.
|
||||
|
||||
<p>If build and host are the same, the GCC you are building will also be
|
||||
used to build the target libraries (like <code>libstdc++</code>). If build and host
|
||||
are different, you must have already built and installed a cross
|
||||
compiler that will be used to build the target libraries (if you
|
||||
configured with <samp><span class="option">--target=foo-bar</span></samp>, this compiler will be called
|
||||
<samp><span class="command">foo-bar-gcc</span></samp>).
|
||||
|
||||
<p>In the case of target libraries, the machine you're building for is the
|
||||
machine you specified with <samp><span class="option">--target</span></samp>. So, build is the machine
|
||||
you're building on (no change there), host is the machine you're
|
||||
building for (the target libraries are built for the target, so host is
|
||||
the target you specified), and target doesn't apply (because you're not
|
||||
building a compiler, you're building libraries). The configure/make
|
||||
process will adjust these variables as needed. It also sets
|
||||
<code>$with_cross_host</code> to the original <samp><span class="option">--host</span></samp> value in case you
|
||||
need it.
|
||||
|
||||
<p>The <code>libiberty</code> support library is built up to three times: once
|
||||
for the host, once for the target (even if they are the same), and once
|
||||
for the build if build and host are different. This allows it to be
|
||||
used by all programs which are generated in the course of the build
|
||||
process.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Constant Attributes - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Insn-Attributes.html#Insn-Attributes" title="Insn Attributes">
|
||||
<link rel="prev" href="Insn-Lengths.html#Insn-Lengths" title="Insn Lengths">
|
||||
<link rel="next" href="Delay-Slots.html#Delay-Slots" title="Delay Slots">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Constant-Attributes"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Delay-Slots.html#Delay-Slots">Delay Slots</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Insn-Lengths.html#Insn-Lengths">Insn Lengths</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.19.6 Constant Attributes</h4>
|
||||
|
||||
<p><a name="index-constant-attributes-3715"></a>
|
||||
A special form of <code>define_attr</code>, where the expression for the
|
||||
default value is a <code>const</code> expression, indicates an attribute that
|
||||
is constant for a given run of the compiler. Constant attributes may be
|
||||
used to specify which variety of processor is used. For example,
|
||||
|
||||
<pre class="smallexample"> (define_attr "cpu" "m88100,m88110,m88000"
|
||||
(const
|
||||
(cond [(symbol_ref "TARGET_88100") (const_string "m88100")
|
||||
(symbol_ref "TARGET_88110") (const_string "m88110")]
|
||||
(const_string "m88000"))))
|
||||
|
||||
(define_attr "memory" "fast,slow"
|
||||
(const
|
||||
(if_then_else (symbol_ref "TARGET_FAST_MEM")
|
||||
(const_string "fast")
|
||||
(const_string "slow"))))
|
||||
</pre>
|
||||
<p>The routine generated for constant attributes has no parameters as it
|
||||
does not depend on any particular insn. RTL expressions used to define
|
||||
the value of a constant attribute may use the <code>symbol_ref</code> form,
|
||||
but may not use either the <code>match_operand</code> form or <code>eq_attr</code>
|
||||
forms involving insn attributes.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Constant Definitions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Machine-Desc.html#Machine-Desc" title="Machine Desc">
|
||||
<link rel="prev" href="Define-Subst.html#Define-Subst" title="Define Subst">
|
||||
<link rel="next" href="Iterators.html#Iterators" title="Iterators">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Constant-Definitions"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Iterators.html#Iterators">Iterators</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Define-Subst.html#Define-Subst">Define Subst</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Machine-Desc.html#Machine-Desc">Machine Desc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">16.22 Constant Definitions</h3>
|
||||
|
||||
<p><a name="index-constant-definitions-3766"></a><a name="index-define_005fconstants-3767"></a>
|
||||
Using literal constants inside instruction patterns reduces legibility and
|
||||
can be a maintenance problem.
|
||||
|
||||
<p>To overcome this problem, you may use the <code>define_constants</code>
|
||||
expression. It contains a vector of name-value pairs. From that
|
||||
point on, wherever any of the names appears in the MD file, it is as
|
||||
if the corresponding value had been written instead. You may use
|
||||
<code>define_constants</code> multiple times; each appearance adds more
|
||||
constants to the table. It is an error to redefine a constant with
|
||||
a different value.
|
||||
|
||||
<p>To come back to the a29k load multiple example, instead of
|
||||
|
||||
<pre class="smallexample"> (define_insn ""
|
||||
[(match_parallel 0 "load_multiple_operation"
|
||||
[(set (match_operand:SI 1 "gpc_reg_operand" "=r")
|
||||
(match_operand:SI 2 "memory_operand" "m"))
|
||||
(use (reg:SI 179))
|
||||
(clobber (reg:SI 179))])]
|
||||
""
|
||||
"loadm 0,0,%1,%2")
|
||||
</pre>
|
||||
<p>You could write:
|
||||
|
||||
<pre class="smallexample"> (define_constants [
|
||||
(R_BP 177)
|
||||
(R_FC 178)
|
||||
(R_CR 179)
|
||||
(R_Q 180)
|
||||
])
|
||||
|
||||
(define_insn ""
|
||||
[(match_parallel 0 "load_multiple_operation"
|
||||
[(set (match_operand:SI 1 "gpc_reg_operand" "=r")
|
||||
(match_operand:SI 2 "memory_operand" "m"))
|
||||
(use (reg:SI R_CR))
|
||||
(clobber (reg:SI R_CR))])]
|
||||
""
|
||||
"loadm 0,0,%1,%2")
|
||||
</pre>
|
||||
<p>The constants that are defined with a define_constant are also output
|
||||
in the insn-codes.h header file as #defines.
|
||||
|
||||
<p><a name="index-enumerations-3768"></a><a name="index-define_005fc_005fenum-3769"></a>You can also use the machine description file to define enumerations.
|
||||
Like the constants defined by <code>define_constant</code>, these enumerations
|
||||
are visible to both the machine description file and the main C code.
|
||||
|
||||
<p>The syntax is as follows:
|
||||
|
||||
<pre class="smallexample"> (define_c_enum "<var>name</var>" [
|
||||
<var>value0</var>
|
||||
<var>value1</var>
|
||||
...
|
||||
<var>valuen</var>
|
||||
])
|
||||
</pre>
|
||||
<p>This definition causes the equivalent of the following C code to appear
|
||||
in <samp><span class="file">insn-constants.h</span></samp>:
|
||||
|
||||
<pre class="smallexample"> enum <var>name</var> {
|
||||
<var>value0</var> = 0,
|
||||
<var>value1</var> = 1,
|
||||
...
|
||||
<var>valuen</var> = <var>n</var>
|
||||
};
|
||||
#define NUM_<var>cname</var>_VALUES (<var>n</var> + 1)
|
||||
</pre>
|
||||
<p>where <var>cname</var> is the capitalized form of <var>name</var>.
|
||||
It also makes each <var>valuei</var> available in the machine description
|
||||
file, just as if it had been declared with:
|
||||
|
||||
<pre class="smallexample"> (define_constants [(<var>valuei</var> <var>i</var>)])
|
||||
</pre>
|
||||
<p>Each <var>valuei</var> is usually an upper-case identifier and usually
|
||||
begins with <var>cname</var>.
|
||||
|
||||
<p>You can split the enumeration definition into as many statements as
|
||||
you like. The above example is directly equivalent to:
|
||||
|
||||
<pre class="smallexample"> (define_c_enum "<var>name</var>" [<var>value0</var>])
|
||||
(define_c_enum "<var>name</var>" [<var>value1</var>])
|
||||
...
|
||||
(define_c_enum "<var>name</var>" [<var>valuen</var>])
|
||||
</pre>
|
||||
<p>Splitting the enumeration helps to improve the modularity of each
|
||||
individual <code>.md</code> file. For example, if a port defines its
|
||||
synchronization instructions in a separate <samp><span class="file">sync.md</span></samp> file,
|
||||
it is convenient to define all synchronization-specific enumeration
|
||||
values in <samp><span class="file">sync.md</span></samp> rather than in the main <samp><span class="file">.md</span></samp> file.
|
||||
|
||||
<p>Some enumeration names have special significance to GCC:
|
||||
|
||||
<dl>
|
||||
<dt><code>unspecv</code><dd><a name="index-unspec_005fvolatile-3770"></a>If an enumeration called <code>unspecv</code> is defined, GCC will use it
|
||||
when printing out <code>unspec_volatile</code> expressions. For example:
|
||||
|
||||
<pre class="smallexample"> (define_c_enum "unspecv" [
|
||||
UNSPECV_BLOCKAGE
|
||||
])
|
||||
</pre>
|
||||
<p>causes GCC to print ‘<samp><span class="samp">(unspec_volatile ... 0)</span></samp>’ as:
|
||||
|
||||
<pre class="smallexample"> (unspec_volatile ... UNSPECV_BLOCKAGE)
|
||||
</pre>
|
||||
<br><dt><code>unspec</code><dd><a name="index-unspec-3771"></a>If an enumeration called <code>unspec</code> is defined, GCC will use
|
||||
it when printing out <code>unspec</code> expressions. GCC will also use
|
||||
it when printing out <code>unspec_volatile</code> expressions unless an
|
||||
<code>unspecv</code> enumeration is also defined. You can therefore
|
||||
decide whether to keep separate enumerations for volatile and
|
||||
non-volatile expressions or whether to use the same enumeration
|
||||
for both.
|
||||
</dl>
|
||||
|
||||
<p><a name="index-define_005fenum-3772"></a><a name="define_005fenum"></a>Another way of defining an enumeration is to use <code>define_enum</code>:
|
||||
|
||||
<pre class="smallexample"> (define_enum "<var>name</var>" [
|
||||
<var>value0</var>
|
||||
<var>value1</var>
|
||||
...
|
||||
<var>valuen</var>
|
||||
])
|
||||
</pre>
|
||||
<p>This directive implies:
|
||||
|
||||
<pre class="smallexample"> (define_c_enum "<var>name</var>" [
|
||||
<var>cname</var>_<var>cvalue0</var>
|
||||
<var>cname</var>_<var>cvalue1</var>
|
||||
...
|
||||
<var>cname</var>_<var>cvaluen</var>
|
||||
])
|
||||
</pre>
|
||||
<p><a name="index-define_005fenum_005fattr-3773"></a>where <var>cvaluei</var> is the capitalized form of <var>valuei</var>.
|
||||
However, unlike <code>define_c_enum</code>, the enumerations defined
|
||||
by <code>define_enum</code> can be used in attribute specifications
|
||||
(see <a href="define_005fenum_005fattr.html#define_005fenum_005fattr">define_enum_attr</a>).
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Constant expressions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Expression-trees.html#Expression-trees" title="Expression trees">
|
||||
<link rel="next" href="Storage-References.html#Storage-References" title="Storage References">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Constant-expressions"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Storage-References.html#Storage-References">Storage References</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Expression-trees.html#Expression-trees">Expression trees</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.6.1 Constant expressions</h4>
|
||||
|
||||
<p><a name="index-INTEGER_005fCST-2413"></a><a name="index-TREE_005fINT_005fCST_005fHIGH-2414"></a><a name="index-TREE_005fINT_005fCST_005fLOW-2415"></a><a name="index-tree_005fint_005fcst_005flt-2416"></a><a name="index-tree_005fint_005fcst_005fequal-2417"></a><a name="index-REAL_005fCST-2418"></a><a name="index-FIXED_005fCST-2419"></a><a name="index-COMPLEX_005fCST-2420"></a><a name="index-VECTOR_005fCST-2421"></a><a name="index-STRING_005fCST-2422"></a><a name="index-TREE_005fSTRING_005fLENGTH-2423"></a><a name="index-TREE_005fSTRING_005fPOINTER-2424"></a>
|
||||
The table below begins with constants, moves on to unary expressions,
|
||||
then proceeds to binary expressions, and concludes with various other
|
||||
kinds of expressions:
|
||||
|
||||
<dl>
|
||||
<dt><code>INTEGER_CST</code><dd>These nodes represent integer constants. Note that the type of these
|
||||
constants is obtained with <code>TREE_TYPE</code>; they are not always of type
|
||||
<code>int</code>. In particular, <code>char</code> constants are represented with
|
||||
<code>INTEGER_CST</code> nodes. The value of the integer constant <code>e</code> is
|
||||
given by
|
||||
<pre class="smallexample"> ((TREE_INT_CST_HIGH (e) << HOST_BITS_PER_WIDE_INT)
|
||||
+ TREE_INST_CST_LOW (e))
|
||||
</pre>
|
||||
<p class="noindent">HOST_BITS_PER_WIDE_INT is at least thirty-two on all platforms. Both
|
||||
<code>TREE_INT_CST_HIGH</code> and <code>TREE_INT_CST_LOW</code> return a
|
||||
<code>HOST_WIDE_INT</code>. The value of an <code>INTEGER_CST</code> is interpreted
|
||||
as a signed or unsigned quantity depending on the type of the constant.
|
||||
In general, the expression given above will overflow, so it should not
|
||||
be used to calculate the value of the constant.
|
||||
|
||||
<p>The variable <code>integer_zero_node</code> is an integer constant with value
|
||||
zero. Similarly, <code>integer_one_node</code> is an integer constant with
|
||||
value one. The <code>size_zero_node</code> and <code>size_one_node</code> variables
|
||||
are analogous, but have type <code>size_t</code> rather than <code>int</code>.
|
||||
|
||||
<p>The function <code>tree_int_cst_lt</code> is a predicate which holds if its
|
||||
first argument is less than its second. Both constants are assumed to
|
||||
have the same signedness (i.e., either both should be signed or both
|
||||
should be unsigned.) The full width of the constant is used when doing
|
||||
the comparison; the usual rules about promotions and conversions are
|
||||
ignored. Similarly, <code>tree_int_cst_equal</code> holds if the two
|
||||
constants are equal. The <code>tree_int_cst_sgn</code> function returns the
|
||||
sign of a constant. The value is <code>1</code>, <code>0</code>, or <code>-1</code>
|
||||
according on whether the constant is greater than, equal to, or less
|
||||
than zero. Again, the signedness of the constant's type is taken into
|
||||
account; an unsigned constant is never less than zero, no matter what
|
||||
its bit-pattern.
|
||||
|
||||
<br><dt><code>REAL_CST</code><dd>
|
||||
FIXME: Talk about how to obtain representations of this constant, do
|
||||
comparisons, and so forth.
|
||||
|
||||
<br><dt><code>FIXED_CST</code><dd>
|
||||
These nodes represent fixed-point constants. The type of these constants
|
||||
is obtained with <code>TREE_TYPE</code>. <code>TREE_FIXED_CST_PTR</code> points to
|
||||
a <code>struct fixed_value</code>; <code>TREE_FIXED_CST</code> returns the structure
|
||||
itself. <code>struct fixed_value</code> contains <code>data</code> with the size of two
|
||||
<code>HOST_BITS_PER_WIDE_INT</code> and <code>mode</code> as the associated fixed-point
|
||||
machine mode for <code>data</code>.
|
||||
|
||||
<br><dt><code>COMPLEX_CST</code><dd>These nodes are used to represent complex number constants, that is a
|
||||
<code>__complex__</code> whose parts are constant nodes. The
|
||||
<code>TREE_REALPART</code> and <code>TREE_IMAGPART</code> return the real and the
|
||||
imaginary parts respectively.
|
||||
|
||||
<br><dt><code>VECTOR_CST</code><dd>These nodes are used to represent vector constants, whose parts are
|
||||
constant nodes. Each individual constant node is either an integer or a
|
||||
double constant node. The first operand is a <code>TREE_LIST</code> of the
|
||||
constant nodes and is accessed through <code>TREE_VECTOR_CST_ELTS</code>.
|
||||
|
||||
<br><dt><code>STRING_CST</code><dd>These nodes represent string-constants. The <code>TREE_STRING_LENGTH</code>
|
||||
returns the length of the string, as an <code>int</code>. The
|
||||
<code>TREE_STRING_POINTER</code> is a <code>char*</code> containing the string
|
||||
itself. The string may not be <code>NUL</code>-terminated, and it may contain
|
||||
embedded <code>NUL</code> characters. Therefore, the
|
||||
<code>TREE_STRING_LENGTH</code> includes the trailing <code>NUL</code> if it is
|
||||
present.
|
||||
|
||||
<p>For wide string constants, the <code>TREE_STRING_LENGTH</code> is the number
|
||||
of bytes in the string, and the <code>TREE_STRING_POINTER</code>
|
||||
points to an array of the bytes of the string, as represented on the
|
||||
target system (that is, as integers in the target endianness). Wide and
|
||||
non-wide string constants are distinguished only by the <code>TREE_TYPE</code>
|
||||
of the <code>STRING_CST</code>.
|
||||
|
||||
<p>FIXME: The formats of string constants are not well-defined when the
|
||||
target system bytes are not the same width as host system bytes.
|
||||
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Constants - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Machine-Modes.html#Machine-Modes" title="Machine Modes">
|
||||
<link rel="next" href="Regs-and-Memory.html#Regs-and-Memory" title="Regs and Memory">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Constants"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Regs-and-Memory.html#Regs-and-Memory">Regs and Memory</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Machine-Modes.html#Machine-Modes">Machine Modes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.7 Constant Expression Types</h3>
|
||||
|
||||
<p><a name="index-RTL-constants-1970"></a><a name="index-RTL-constant-expression-types-1971"></a>
|
||||
The simplest RTL expressions are those that represent constant values.
|
||||
|
||||
|
||||
<a name="index-const_005fint-1972"></a>
|
||||
<dl><dt><code>(const_int </code><var>i</var><code>)</code><dd>This type of expression represents the integer value <var>i</var>. <var>i</var>
|
||||
is customarily accessed with the macro <code>INTVAL</code> as in
|
||||
<code>INTVAL (</code><var>exp</var><code>)</code>, which is equivalent to <code>XWINT (</code><var>exp</var><code>, 0)</code>.
|
||||
|
||||
<p>Constants generated for modes with fewer bits than in
|
||||
<code>HOST_WIDE_INT</code> must be sign extended to full width (e.g., with
|
||||
<code>gen_int_mode</code>). For constants for modes with more bits than in
|
||||
<code>HOST_WIDE_INT</code> the implied high order bits of that constant are
|
||||
copies of the top bit. Note however that values are neither
|
||||
inherently signed nor inherently unsigned; where necessary, signedness
|
||||
is determined by the rtl operation instead.
|
||||
|
||||
<p><a name="index-const0_005frtx-1973"></a><a name="index-const1_005frtx-1974"></a><a name="index-const2_005frtx-1975"></a><a name="index-constm1_005frtx-1976"></a>There is only one expression object for the integer value zero; it is
|
||||
the value of the variable <code>const0_rtx</code>. Likewise, the only
|
||||
expression for integer value one is found in <code>const1_rtx</code>, the only
|
||||
expression for integer value two is found in <code>const2_rtx</code>, and the
|
||||
only expression for integer value negative one is found in
|
||||
<code>constm1_rtx</code>. Any attempt to create an expression of code
|
||||
<code>const_int</code> and value zero, one, two or negative one will return
|
||||
<code>const0_rtx</code>, <code>const1_rtx</code>, <code>const2_rtx</code> or
|
||||
<code>constm1_rtx</code> as appropriate.
|
||||
|
||||
<p><a name="index-const_005ftrue_005frtx-1977"></a>Similarly, there is only one object for the integer whose value is
|
||||
<code>STORE_FLAG_VALUE</code>. It is found in <code>const_true_rtx</code>. If
|
||||
<code>STORE_FLAG_VALUE</code> is one, <code>const_true_rtx</code> and
|
||||
<code>const1_rtx</code> will point to the same object. If
|
||||
<code>STORE_FLAG_VALUE</code> is −1, <code>const_true_rtx</code> and
|
||||
<code>constm1_rtx</code> will point to the same object.
|
||||
|
||||
<p><a name="index-const_005fdouble-1978"></a><br><dt><code>(const_double:</code><var>m</var> <var>i0</var> <var>i1</var><code> ...)</code><dd>Represents either a floating-point constant of mode <var>m</var> or an
|
||||
integer constant too large to fit into <code>HOST_BITS_PER_WIDE_INT</code>
|
||||
bits but small enough to fit within twice that number of bits (GCC
|
||||
does not provide a mechanism to represent even larger constants). In
|
||||
the latter case, <var>m</var> will be <code>VOIDmode</code>. For integral values
|
||||
constants for modes with more bits than twice the number in
|
||||
<code>HOST_WIDE_INT</code> the implied high order bits of that constant are
|
||||
copies of the top bit of <code>CONST_DOUBLE_HIGH</code>. Note however that
|
||||
integral values are neither inherently signed nor inherently unsigned;
|
||||
where necessary, signedness is determined by the rtl operation
|
||||
instead.
|
||||
|
||||
<p><a name="index-CONST_005fDOUBLE_005fLOW-1979"></a>If <var>m</var> is <code>VOIDmode</code>, the bits of the value are stored in
|
||||
<var>i0</var> and <var>i1</var>. <var>i0</var> is customarily accessed with the macro
|
||||
<code>CONST_DOUBLE_LOW</code> and <var>i1</var> with <code>CONST_DOUBLE_HIGH</code>.
|
||||
|
||||
<p>If the constant is floating point (regardless of its precision), then
|
||||
the number of integers used to store the value depends on the size of
|
||||
<code>REAL_VALUE_TYPE</code> (see <a href="Floating-Point.html#Floating-Point">Floating Point</a>). The integers
|
||||
represent a floating point number, but not precisely in the target
|
||||
machine's or host machine's floating point format. To convert them to
|
||||
the precise bit pattern used by the target machine, use the macro
|
||||
<code>REAL_VALUE_TO_TARGET_DOUBLE</code> and friends (see <a href="Data-Output.html#Data-Output">Data Output</a>).
|
||||
|
||||
<p><a name="index-const_005ffixed-1980"></a><br><dt><code>(const_fixed:</code><var>m</var><code> ...)</code><dd>Represents a fixed-point constant of mode <var>m</var>.
|
||||
The operand is a data structure of type <code>struct fixed_value</code> and
|
||||
is accessed with the macro <code>CONST_FIXED_VALUE</code>. The high part of
|
||||
data is accessed with <code>CONST_FIXED_VALUE_HIGH</code>; the low part is
|
||||
accessed with <code>CONST_FIXED_VALUE_LOW</code>.
|
||||
|
||||
<p><a name="index-const_005fvector-1981"></a><br><dt><code>(const_vector:</code><var>m</var><code> [</code><var>x0</var> <var>x1</var><code> ...])</code><dd>Represents a vector constant. The square brackets stand for the vector
|
||||
containing the constant elements. <var>x0</var>, <var>x1</var> and so on are
|
||||
the <code>const_int</code>, <code>const_double</code> or <code>const_fixed</code> elements.
|
||||
|
||||
<p>The number of units in a <code>const_vector</code> is obtained with the macro
|
||||
<code>CONST_VECTOR_NUNITS</code> as in <code>CONST_VECTOR_NUNITS (</code><var>v</var><code>)</code>.
|
||||
|
||||
<p>Individual elements in a vector constant are accessed with the macro
|
||||
<code>CONST_VECTOR_ELT</code> as in <code>CONST_VECTOR_ELT (</code><var>v</var><code>, </code><var>n</var><code>)</code>
|
||||
where <var>v</var> is the vector constant and <var>n</var> is the element
|
||||
desired.
|
||||
|
||||
<p><a name="index-const_005fstring-1982"></a><br><dt><code>(const_string </code><var>str</var><code>)</code><dd>Represents a constant string with value <var>str</var>. Currently this is
|
||||
used only for insn attributes (see <a href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>) since constant
|
||||
strings in C are placed in memory.
|
||||
|
||||
<p><a name="index-symbol_005fref-1983"></a><br><dt><code>(symbol_ref:</code><var>mode</var> <var>symbol</var><code>)</code><dd>Represents the value of an assembler label for data. <var>symbol</var> is
|
||||
a string that describes the name of the assembler label. If it starts
|
||||
with a ‘<samp><span class="samp">*</span></samp>’, the label is the rest of <var>symbol</var> not including
|
||||
the ‘<samp><span class="samp">*</span></samp>’. Otherwise, the label is <var>symbol</var>, usually prefixed
|
||||
with ‘<samp><span class="samp">_</span></samp>’.
|
||||
|
||||
<p>The <code>symbol_ref</code> contains a mode, which is usually <code>Pmode</code>.
|
||||
Usually that is the only mode for which a symbol is directly valid.
|
||||
|
||||
<p><a name="index-label_005fref-1984"></a><br><dt><code>(label_ref:</code><var>mode</var> <var>label</var><code>)</code><dd>Represents the value of an assembler label for code. It contains one
|
||||
operand, an expression, which must be a <code>code_label</code> or a <code>note</code>
|
||||
of type <code>NOTE_INSN_DELETED_LABEL</code> that appears in the instruction
|
||||
sequence to identify the place where the label should go.
|
||||
|
||||
<p>The reason for using a distinct expression type for code label
|
||||
references is so that jump optimization can distinguish them.
|
||||
|
||||
<p>The <code>label_ref</code> contains a mode, which is usually <code>Pmode</code>.
|
||||
Usually that is the only mode for which a label is directly valid.
|
||||
|
||||
<p><a name="index-const-1985"></a><br><dt><code>(const:</code><var>m</var> <var>exp</var><code>)</code><dd>Represents a constant that is the result of an assembly-time
|
||||
arithmetic computation. The operand, <var>exp</var>, is an expression that
|
||||
contains only constants (<code>const_int</code>, <code>symbol_ref</code> and
|
||||
<code>label_ref</code> expressions) combined with <code>plus</code> and
|
||||
<code>minus</code>. However, not all combinations are valid, since the
|
||||
assembler cannot do arbitrary arithmetic on relocatable symbols.
|
||||
|
||||
<p><var>m</var> should be <code>Pmode</code>.
|
||||
|
||||
<p><a name="index-high-1986"></a><br><dt><code>(high:</code><var>m</var> <var>exp</var><code>)</code><dd>Represents the high-order bits of <var>exp</var>, usually a
|
||||
<code>symbol_ref</code>. The number of bits is machine-dependent and is
|
||||
normally the number of bits specified in an instruction that initializes
|
||||
the high order bits of a register. It is used with <code>lo_sum</code> to
|
||||
represent the typical two-instruction sequence used in RISC machines to
|
||||
reference a global memory location.
|
||||
|
||||
<p><var>m</var> should be <code>Pmode</code>.
|
||||
</dl>
|
||||
|
||||
<p><a name="index-CONST0_005fRTX-1987"></a><a name="index-CONST1_005fRTX-1988"></a><a name="index-CONST2_005fRTX-1989"></a>The macro <code>CONST0_RTX (</code><var>mode</var><code>)</code> refers to an expression with
|
||||
value 0 in mode <var>mode</var>. If mode <var>mode</var> is of mode class
|
||||
<code>MODE_INT</code>, it returns <code>const0_rtx</code>. If mode <var>mode</var> is of
|
||||
mode class <code>MODE_FLOAT</code>, it returns a <code>CONST_DOUBLE</code>
|
||||
expression in mode <var>mode</var>. Otherwise, it returns a
|
||||
<code>CONST_VECTOR</code> expression in mode <var>mode</var>. Similarly, the macro
|
||||
<code>CONST1_RTX (</code><var>mode</var><code>)</code> refers to an expression with value 1 in
|
||||
mode <var>mode</var> and similarly for <code>CONST2_RTX</code>. The
|
||||
<code>CONST1_RTX</code> and <code>CONST2_RTX</code> macros are undefined
|
||||
for vector modes.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Constraints - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Machine-Desc.html#Machine-Desc" title="Machine Desc">
|
||||
<link rel="prev" href="Predicates.html#Predicates" title="Predicates">
|
||||
<link rel="next" href="Standard-Names.html#Standard-Names" title="Standard Names">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Constraints"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Standard-Names.html#Standard-Names">Standard Names</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Predicates.html#Predicates">Predicates</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Machine-Desc.html#Machine-Desc">Machine Desc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">16.8 Operand Constraints</h3>
|
||||
|
||||
<p><a name="index-operand-constraints-3260"></a><a name="index-constraints-3261"></a>
|
||||
Each <code>match_operand</code> in an instruction pattern can specify
|
||||
constraints for the operands allowed. The constraints allow you to
|
||||
fine-tune matching within the set of operands allowed by the
|
||||
predicate.
|
||||
|
||||
<p>Constraints can say whether
|
||||
an operand may be in a register, and which kinds of register; whether the
|
||||
operand can be a memory reference, and which kinds of address; whether the
|
||||
operand may be an immediate constant, and which possible values it may
|
||||
have. Constraints can also require two operands to match.
|
||||
Side-effects aren't allowed in operands of inline <code>asm</code>, unless
|
||||
‘<samp><span class="samp"><</span></samp>’ or ‘<samp><span class="samp">></span></samp>’ constraints are used, because there is no guarantee
|
||||
that the side-effects will happen exactly once in an instruction that can update
|
||||
the addressing register.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Simple-Constraints.html#Simple-Constraints">Simple Constraints</a>: Basic use of constraints.
|
||||
<li><a accesskey="2" href="Multi_002dAlternative.html#Multi_002dAlternative">Multi-Alternative</a>: When an insn has two alternative constraint-patterns.
|
||||
<li><a accesskey="3" href="Class-Preferences.html#Class-Preferences">Class Preferences</a>: Constraints guide which hard register to put things in.
|
||||
<li><a accesskey="4" href="Modifiers.html#Modifiers">Modifiers</a>: More precise control over effects of constraints.
|
||||
<li><a accesskey="5" href="Machine-Constraints.html#Machine-Constraints">Machine Constraints</a>: Existing constraints for some particular machines.
|
||||
<li><a accesskey="6" href="Disable-Insn-Alternatives.html#Disable-Insn-Alternatives">Disable Insn Alternatives</a>: Disable insn alternatives using the <code>enabled</code> attribute.
|
||||
<li><a accesskey="7" href="Define-Constraints.html#Define-Constraints">Define Constraints</a>: How to define machine-specific constraints.
|
||||
<li><a accesskey="8" href="C-Constraint-Interface.html#C-Constraint-Interface">C Constraint Interface</a>: How to test constraints from C code.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Containers - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Tree-overview.html#Tree-overview" title="Tree overview">
|
||||
<link rel="prev" href="Identifiers.html#Identifiers" title="Identifiers">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Containers"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Identifiers.html#Identifiers">Identifiers</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Tree-overview.html#Tree-overview">Tree overview</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.2.3 Containers</h4>
|
||||
|
||||
<p><a name="index-container-2322"></a><a name="index-list-2323"></a><a name="index-vector-2324"></a><a name="index-TREE_005fLIST-2325"></a><a name="index-TREE_005fVEC-2326"></a><a name="index-TREE_005fPURPOSE-2327"></a><a name="index-TREE_005fVALUE-2328"></a><a name="index-TREE_005fVEC_005fLENGTH-2329"></a><a name="index-TREE_005fVEC_005fELT-2330"></a>
|
||||
Two common container data structures can be represented directly with
|
||||
tree nodes. A <code>TREE_LIST</code> is a singly linked list containing two
|
||||
trees per node. These are the <code>TREE_PURPOSE</code> and <code>TREE_VALUE</code>
|
||||
of each node. (Often, the <code>TREE_PURPOSE</code> contains some kind of
|
||||
tag, or additional information, while the <code>TREE_VALUE</code> contains the
|
||||
majority of the payload. In other cases, the <code>TREE_PURPOSE</code> is
|
||||
simply <code>NULL_TREE</code>, while in still others both the
|
||||
<code>TREE_PURPOSE</code> and <code>TREE_VALUE</code> are of equal stature.) Given
|
||||
one <code>TREE_LIST</code> node, the next node is found by following the
|
||||
<code>TREE_CHAIN</code>. If the <code>TREE_CHAIN</code> is <code>NULL_TREE</code>, then
|
||||
you have reached the end of the list.
|
||||
|
||||
<p>A <code>TREE_VEC</code> is a simple vector. The <code>TREE_VEC_LENGTH</code> is an
|
||||
integer (not a tree) giving the number of nodes in the vector. The
|
||||
nodes themselves are accessed using the <code>TREE_VEC_ELT</code> macro, which
|
||||
takes two arguments. The first is the <code>TREE_VEC</code> in question; the
|
||||
second is an integer indicating which element in the vector is desired.
|
||||
The elements are indexed from zero.
|
||||
|
||||
<!-- -->
|
||||
<!-- Types -->
|
||||
<!-- -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Contributing - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="prev" href="index.html#Top" title="Top">
|
||||
<link rel="next" href="Portability.html#Portability" title="Portability">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="settitle">GNU Compiler Collection (GCC) Internals</h1>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Contributing"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Portability.html#Portability">Portability</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="index.html#Top">Top</a>,
|
||||
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h2 class="chapter">1 Contributing to GCC Development</h2>
|
||||
|
||||
<p>If you would like to help pretest GCC releases to assure they work well,
|
||||
current development sources are available by SVN (see
|
||||
<a href="http://gcc.gnu.org/svn.html">http://gcc.gnu.org/svn.html</a>). Source and binary snapshots are
|
||||
also available for FTP; see <a href="http://gcc.gnu.org/snapshots.html">http://gcc.gnu.org/snapshots.html</a>.
|
||||
|
||||
<p>If you would like to work on improvements to GCC, please read the
|
||||
advice at these URLs:
|
||||
|
||||
<pre class="smallexample"> <a href="http://gcc.gnu.org/contribute.html">http://gcc.gnu.org/contribute.html</a>
|
||||
<a href="http://gcc.gnu.org/contributewhy.html">http://gcc.gnu.org/contributewhy.html</a>
|
||||
</pre>
|
||||
<p class="noindent">for information on how to make useful contributions and avoid
|
||||
duplication of effort. Suggested projects are listed at
|
||||
<a href="http://gcc.gnu.org/projects/">http://gcc.gnu.org/projects/</a>.
|
||||
|
||||
<!-- Copyright (C) 1988-2013 Free Software Foundation, Inc. -->
|
||||
<!-- This is part of the GCC manual. -->
|
||||
<!-- For copying conditions, see the file gcc.texi. -->
|
||||
</body></html>
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,89 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Control Flow - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="prev" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="next" href="Loop-Analysis-and-Representation.html#Loop-Analysis-and-Representation" title="Loop Analysis and Representation">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Control-Flow"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Loop-Analysis-and-Representation.html#Loop-Analysis-and-Representation">Loop Analysis and Representation</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="RTL.html#RTL">RTL</a>,
|
||||
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h2 class="chapter">15 Control Flow Graph</h2>
|
||||
|
||||
<p><a name="index-CFG_002c-Control-Flow-Graph-3120"></a><a name="index-basic_002dblock_002eh-3121"></a>
|
||||
A control flow graph (CFG) is a data structure built on top of the
|
||||
intermediate code representation (the RTL or <code>GIMPLE</code> instruction
|
||||
stream) abstracting the control flow behavior of a function that is
|
||||
being compiled. The CFG is a directed graph where the vertices
|
||||
represent basic blocks and edges represent possible transfer of
|
||||
control flow from one basic block to another. The data structures
|
||||
used to represent the control flow graph are defined in
|
||||
<samp><span class="file">basic-block.h</span></samp>.
|
||||
|
||||
<p>In GCC, the representation of control flow is maintained throughout
|
||||
the compilation process, from constructing the CFG early in
|
||||
<code>pass_build_cfg</code> to <code>pass_free_cfg</code> (see <samp><span class="file">passes.c</span></samp>).
|
||||
The CFG takes various different modes and may undergo extensive
|
||||
manipulations, but the graph is always valid between its construction
|
||||
and its release. This way, transfer of information such as data flow,
|
||||
a measured profile, or the loop tree, can be propagated through the
|
||||
passes pipeline, and even from <code>GIMPLE</code> to <code>RTL</code>.
|
||||
|
||||
<p>Often the CFG may be better viewed as integral part of instruction
|
||||
chain, than structure built on the top of it. Updating the compiler's
|
||||
intermediate representation for instructions can not be easily done
|
||||
without proper maintenance of the CFG simultaneously.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Basic-Blocks.html#Basic-Blocks">Basic Blocks</a>: The definition and representation of basic blocks.
|
||||
<li><a accesskey="2" href="Edges.html#Edges">Edges</a>: Types of edges and their representation.
|
||||
<li><a accesskey="3" href="Profile-information.html#Profile-information">Profile information</a>: Representation of frequencies and probabilities.
|
||||
<li><a accesskey="4" href="Maintaining-the-CFG.html#Maintaining-the-CFG">Maintaining the CFG</a>: Keeping the control flow graph and up to date.
|
||||
<li><a accesskey="5" href="Liveness-information.html#Liveness-information">Liveness information</a>: Using and maintaining liveness information.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Conversions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Vector-Operations.html#Vector-Operations" title="Vector Operations">
|
||||
<link rel="next" href="RTL-Declarations.html#RTL-Declarations" title="RTL Declarations">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Conversions"></a>
|
||||
Next: <a rel="next" accesskey="n" href="RTL-Declarations.html#RTL-Declarations">RTL Declarations</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Vector-Operations.html#Vector-Operations">Vector Operations</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.13 Conversions</h3>
|
||||
|
||||
<p><a name="index-conversions-2156"></a><a name="index-machine-mode-conversions-2157"></a>
|
||||
All conversions between machine modes must be represented by
|
||||
explicit conversion operations. For example, an expression
|
||||
which is the sum of a byte and a full word cannot be written as
|
||||
<code>(plus:SI (reg:QI 34) (reg:SI 80))</code> because the <code>plus</code>
|
||||
operation requires two operands of the same machine mode.
|
||||
Therefore, the byte-sized operand is enclosed in a conversion
|
||||
operation, as in
|
||||
|
||||
<pre class="smallexample"> (plus:SI (sign_extend:SI (reg:QI 34)) (reg:SI 80))
|
||||
</pre>
|
||||
<p>The conversion operation is not a mere placeholder, because there
|
||||
may be more than one way of converting from a given starting mode
|
||||
to the desired final mode. The conversion operation code says how
|
||||
to do it.
|
||||
|
||||
<p>For all conversion operations, <var>x</var> must not be <code>VOIDmode</code>
|
||||
because the mode in which to do the conversion would not be known.
|
||||
The conversion must either be done at compile-time or <var>x</var>
|
||||
must be placed into a register.
|
||||
|
||||
|
||||
<a name="index-sign_005fextend-2158"></a>
|
||||
<dl><dt><code>(sign_extend:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of sign-extending the value <var>x</var>
|
||||
to machine mode <var>m</var>. <var>m</var> must be a fixed-point mode
|
||||
and <var>x</var> a fixed-point value of a mode narrower than <var>m</var>.
|
||||
|
||||
<p><a name="index-zero_005fextend-2159"></a><br><dt><code>(zero_extend:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of zero-extending the value <var>x</var>
|
||||
to machine mode <var>m</var>. <var>m</var> must be a fixed-point mode
|
||||
and <var>x</var> a fixed-point value of a mode narrower than <var>m</var>.
|
||||
|
||||
<p><a name="index-float_005fextend-2160"></a><br><dt><code>(float_extend:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of extending the value <var>x</var>
|
||||
to machine mode <var>m</var>. <var>m</var> must be a floating point mode
|
||||
and <var>x</var> a floating point value of a mode narrower than <var>m</var>.
|
||||
|
||||
<p><a name="index-truncate-2161"></a><br><dt><code>(truncate:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of truncating the value <var>x</var>
|
||||
to machine mode <var>m</var>. <var>m</var> must be a fixed-point mode
|
||||
and <var>x</var> a fixed-point value of a mode wider than <var>m</var>.
|
||||
|
||||
<p><a name="index-ss_005ftruncate-2162"></a><br><dt><code>(ss_truncate:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of truncating the value <var>x</var>
|
||||
to machine mode <var>m</var>, using signed saturation in the case of
|
||||
overflow. Both <var>m</var> and the mode of <var>x</var> must be fixed-point
|
||||
modes.
|
||||
|
||||
<p><a name="index-us_005ftruncate-2163"></a><br><dt><code>(us_truncate:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of truncating the value <var>x</var>
|
||||
to machine mode <var>m</var>, using unsigned saturation in the case of
|
||||
overflow. Both <var>m</var> and the mode of <var>x</var> must be fixed-point
|
||||
modes.
|
||||
|
||||
<p><a name="index-float_005ftruncate-2164"></a><br><dt><code>(float_truncate:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of truncating the value <var>x</var>
|
||||
to machine mode <var>m</var>. <var>m</var> must be a floating point mode
|
||||
and <var>x</var> a floating point value of a mode wider than <var>m</var>.
|
||||
|
||||
<p><a name="index-float-2165"></a><br><dt><code>(float:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of converting fixed point value <var>x</var>,
|
||||
regarded as signed, to floating point mode <var>m</var>.
|
||||
|
||||
<p><a name="index-unsigned_005ffloat-2166"></a><br><dt><code>(unsigned_float:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of converting fixed point value <var>x</var>,
|
||||
regarded as unsigned, to floating point mode <var>m</var>.
|
||||
|
||||
<p><a name="index-fix-2167"></a><br><dt><code>(fix:</code><var>m</var> <var>x</var><code>)</code><dd>When <var>m</var> is a floating-point mode, represents the result of
|
||||
converting floating point value <var>x</var> (valid for mode <var>m</var>) to an
|
||||
integer, still represented in floating point mode <var>m</var>, by rounding
|
||||
towards zero.
|
||||
|
||||
<p>When <var>m</var> is a fixed-point mode, represents the result of
|
||||
converting floating point value <var>x</var> to mode <var>m</var>, regarded as
|
||||
signed. How rounding is done is not specified, so this operation may
|
||||
be used validly in compiling C code only for integer-valued operands.
|
||||
|
||||
<p><a name="index-unsigned_005ffix-2168"></a><br><dt><code>(unsigned_fix:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of converting floating point value <var>x</var> to
|
||||
fixed point mode <var>m</var>, regarded as unsigned. How rounding is done
|
||||
is not specified.
|
||||
|
||||
<p><a name="index-fract_005fconvert-2169"></a><br><dt><code>(fract_convert:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of converting fixed-point value <var>x</var> to
|
||||
fixed-point mode <var>m</var>, signed integer value <var>x</var> to
|
||||
fixed-point mode <var>m</var>, floating-point value <var>x</var> to
|
||||
fixed-point mode <var>m</var>, fixed-point value <var>x</var> to integer mode <var>m</var>
|
||||
regarded as signed, or fixed-point value <var>x</var> to floating-point mode <var>m</var>.
|
||||
When overflows or underflows happen, the results are undefined.
|
||||
|
||||
<p><a name="index-sat_005ffract-2170"></a><br><dt><code>(sat_fract:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of converting fixed-point value <var>x</var> to
|
||||
fixed-point mode <var>m</var>, signed integer value <var>x</var> to
|
||||
fixed-point mode <var>m</var>, or floating-point value <var>x</var> to
|
||||
fixed-point mode <var>m</var>.
|
||||
When overflows or underflows happen, the results are saturated to the
|
||||
maximum or the minimum.
|
||||
|
||||
<p><a name="index-unsigned_005ffract_005fconvert-2171"></a><br><dt><code>(unsigned_fract_convert:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of converting fixed-point value <var>x</var> to
|
||||
integer mode <var>m</var> regarded as unsigned, or unsigned integer value <var>x</var> to
|
||||
fixed-point mode <var>m</var>.
|
||||
When overflows or underflows happen, the results are undefined.
|
||||
|
||||
<p><a name="index-unsigned_005fsat_005ffract-2172"></a><br><dt><code>(unsigned_sat_fract:</code><var>m</var> <var>x</var><code>)</code><dd>Represents the result of converting unsigned integer value <var>x</var> to
|
||||
fixed-point mode <var>m</var>.
|
||||
When overflows or underflows happen, the results are saturated to the
|
||||
maximum or the minimum.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,758 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Copying - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="prev" href="GNU-Project.html#GNU-Project" title="GNU Project">
|
||||
<link rel="next" href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License" title="GNU Free Documentation License">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Copying"></a>
|
||||
Next: <a rel="next" accesskey="n" href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License">GNU Free Documentation License</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="GNU-Project.html#GNU-Project">GNU Project</a>,
|
||||
Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<!-- man begin DESCRIPTION -->
|
||||
<h2 class="unnumbered">GNU General Public License</h2>
|
||||
|
||||
<div align="center">Version 3, 29 June 2007</div>
|
||||
|
||||
<!-- This file is intended to be included in another file. -->
|
||||
<pre class="display"> Copyright © 2007 Free Software Foundation, Inc. <a href="http://fsf.org/">http://fsf.org/</a>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
</pre>
|
||||
<h3 class="heading">Preamble</h3>
|
||||
|
||||
<p>The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
<p>The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom
|
||||
to share and change all versions of a program–to make sure it remains
|
||||
free software for all its users. We, the Free Software Foundation,
|
||||
use the GNU General Public License for most of our software; it
|
||||
applies also to any other work released this way by its authors. You
|
||||
can apply it to your programs, too.
|
||||
|
||||
<p>When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
<p>To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you
|
||||
have certain responsibilities if you distribute copies of the
|
||||
software, or if you modify it: responsibilities to respect the freedom
|
||||
of others.
|
||||
|
||||
<p>For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too,
|
||||
receive or can get the source code. And you must show them these
|
||||
terms so they know their rights.
|
||||
|
||||
<p>Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
<p>For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
<p>Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the
|
||||
manufacturer can do so. This is fundamentally incompatible with the
|
||||
aim of protecting users' freedom to change the software. The
|
||||
systematic pattern of such abuse occurs in the area of products for
|
||||
individuals to use, which is precisely where it is most unacceptable.
|
||||
Therefore, we have designed this version of the GPL to prohibit the
|
||||
practice for those products. If such problems arise substantially in
|
||||
other domains, we stand ready to extend this provision to those
|
||||
domains in future versions of the GPL, as needed to protect the
|
||||
freedom of users.
|
||||
|
||||
<p>Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish
|
||||
to avoid the special danger that patents applied to a free program
|
||||
could make it effectively proprietary. To prevent this, the GPL
|
||||
assures that patents cannot be used to render the program non-free.
|
||||
|
||||
<p>The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
<h3 class="heading">TERMS AND CONDITIONS</h3>
|
||||
|
||||
<ol type=1 start=0>
|
||||
<li>Definitions.
|
||||
|
||||
<p>“This License” refers to version 3 of the GNU General Public License.
|
||||
|
||||
<p>“Copyright” also means copyright-like laws that apply to other kinds
|
||||
of works, such as semiconductor masks.
|
||||
|
||||
<p>“The Program” refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as “you”. “Licensees” and
|
||||
“recipients” may be individuals or organizations.
|
||||
|
||||
<p>To “modify” a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of
|
||||
an exact copy. The resulting work is called a “modified version” of
|
||||
the earlier work or a work “based on” the earlier work.
|
||||
|
||||
<p>A “covered work” means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
<p>To “propagate” a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
<p>To “convey” a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user
|
||||
through a computer network, with no transfer of a copy, is not
|
||||
conveying.
|
||||
|
||||
<p>An interactive user interface displays “Appropriate Legal Notices” to
|
||||
the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
<li>Source Code.
|
||||
|
||||
<p>The “source code” for a work means the preferred form of the work for
|
||||
making modifications to it. “Object code” means any non-source form
|
||||
of a work.
|
||||
|
||||
<p>A “Standard Interface” means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
<p>The “System Libraries” of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
“Major Component”, in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
<p>The “Corresponding Source” for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
<p>The Corresponding Source need not include anything that users can
|
||||
regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
<p>The Corresponding Source for a work in source code form is that same
|
||||
work.
|
||||
|
||||
<li>Basic Permissions.
|
||||
|
||||
<p>All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
<p>You may make, run and propagate covered works that you do not convey,
|
||||
without conditions so long as your license otherwise remains in force.
|
||||
You may convey covered works to others for the sole purpose of having
|
||||
them make modifications exclusively for you, or provide you with
|
||||
facilities for running those works, provided that you comply with the
|
||||
terms of this License in conveying all material for which you do not
|
||||
control copyright. Those thus making or running the covered works for
|
||||
you must do so exclusively on your behalf, under your direction and
|
||||
control, on terms that prohibit them from making any copies of your
|
||||
copyrighted material outside their relationship with you.
|
||||
|
||||
<p>Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
<li>Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
<p>No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
<p>When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such
|
||||
circumvention is effected by exercising rights under this License with
|
||||
respect to the covered work, and you disclaim any intention to limit
|
||||
operation or modification of the work as a means of enforcing, against
|
||||
the work's users, your or third parties' legal rights to forbid
|
||||
circumvention of technological measures.
|
||||
|
||||
<li>Conveying Verbatim Copies.
|
||||
|
||||
<p>You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
<p>You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
<li>Conveying Modified Source Versions.
|
||||
|
||||
<p>You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these
|
||||
conditions:
|
||||
|
||||
<ol type=a start=1>
|
||||
<li>The work must carry prominent notices stating that you modified it,
|
||||
and giving a relevant date.
|
||||
|
||||
<li>The work must carry prominent notices stating that it is released
|
||||
under this License and any conditions added under section 7. This
|
||||
requirement modifies the requirement in section 4 to “keep intact all
|
||||
notices”.
|
||||
|
||||
<li>You must license the entire work, as a whole, under this License to
|
||||
anyone who comes into possession of a copy. This License will
|
||||
therefore apply, along with any applicable section 7 additional terms,
|
||||
to the whole of the work, and all its parts, regardless of how they
|
||||
are packaged. This License gives no permission to license the work in
|
||||
any other way, but it does not invalidate such permission if you have
|
||||
separately received it.
|
||||
|
||||
<li>If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your work
|
||||
need not make them do so.
|
||||
</ol>
|
||||
|
||||
<p>A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
“aggregate” if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
<li>Conveying Non-Source Forms.
|
||||
|
||||
<p>You may convey a covered work in object code form under the terms of
|
||||
sections 4 and 5, provided that you also convey the machine-readable
|
||||
Corresponding Source under the terms of this License, in one of these
|
||||
ways:
|
||||
|
||||
<ol type=a start=1>
|
||||
<li>Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium customarily
|
||||
used for software interchange.
|
||||
|
||||
<li>Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a written
|
||||
offer, valid for at least three years and valid for as long as you
|
||||
offer spare parts or customer support for that product model, to give
|
||||
anyone who possesses the object code either (1) a copy of the
|
||||
Corresponding Source for all the software in the product that is
|
||||
covered by this License, on a durable physical medium customarily used
|
||||
for software interchange, for a price no more than your reasonable
|
||||
cost of physically performing this conveying of source, or (2) access
|
||||
to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
<li>Convey individual copies of the object code with a copy of the written
|
||||
offer to provide the Corresponding Source. This alternative is
|
||||
allowed only occasionally and noncommercially, and only if you
|
||||
received the object code with such an offer, in accord with subsection
|
||||
6b.
|
||||
|
||||
<li>Convey the object code by offering access from a designated place
|
||||
(gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to copy
|
||||
the object code is a network server, the Corresponding Source may be
|
||||
on a different server (operated by you or a third party) that supports
|
||||
equivalent copying facilities, provided you maintain clear directions
|
||||
next to the object code saying where to find the Corresponding Source.
|
||||
Regardless of what server hosts the Corresponding Source, you remain
|
||||
obligated to ensure that it is available for as long as needed to
|
||||
satisfy these requirements.
|
||||
|
||||
<li>Convey the object code using peer-to-peer transmission, provided you
|
||||
inform other peers where the object code and Corresponding Source of
|
||||
the work are being offered to the general public at no charge under
|
||||
subsection 6d.
|
||||
|
||||
</ol>
|
||||
|
||||
<p>A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
<p>A “User Product” is either (1) a “consumer product”, which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
“normally used” refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
<p>“Installation Information” for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
<p>If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
<p>The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or
|
||||
updates for a work that has been modified or installed by the
|
||||
recipient, or for the User Product in which it has been modified or
|
||||
installed. Access to a network may be denied when the modification
|
||||
itself materially and adversely affects the operation of the network
|
||||
or violates the rules and protocols for communication across the
|
||||
network.
|
||||
|
||||
<p>Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
<li>Additional Terms.
|
||||
|
||||
<p>“Additional permissions” are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
<p>When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
<p>Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders
|
||||
of that material) supplement the terms of this License with terms:
|
||||
|
||||
<ol type=a start=1>
|
||||
<li>Disclaiming warranty or limiting liability differently from the terms
|
||||
of sections 15 and 16 of this License; or
|
||||
|
||||
<li>Requiring preservation of specified reasonable legal notices or author
|
||||
attributions in that material or in the Appropriate Legal Notices
|
||||
displayed by works containing it; or
|
||||
|
||||
<li>Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
<li>Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
<li>Declining to grant rights under trademark law for use of some trade
|
||||
names, trademarks, or service marks; or
|
||||
|
||||
<li>Requiring indemnification of licensors and authors of that material by
|
||||
anyone who conveys the material (or modified versions of it) with
|
||||
contractual assumptions of liability to the recipient, for any
|
||||
liability that these contractual assumptions directly impose on those
|
||||
licensors and authors.
|
||||
</ol>
|
||||
|
||||
<p>All other non-permissive additional terms are considered “further
|
||||
restrictions” within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
<p>If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
<p>Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions; the
|
||||
above requirements apply either way.
|
||||
|
||||
<li>Termination.
|
||||
|
||||
<p>You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
<p>However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
<p>Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
<p>Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
<li>Acceptance Not Required for Having Copies.
|
||||
|
||||
<p>You are not required to accept this License in order to receive or run
|
||||
a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
<li>Automatic Licensing of Downstream Recipients.
|
||||
|
||||
<p>Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
<p>An “entity transaction” is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
<p>You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
<li>Patents.
|
||||
|
||||
<p>A “contributor” is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's “contributor version”.
|
||||
|
||||
<p>A contributor's “essential patent claims” are all patent claims owned
|
||||
or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, “control” includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
<p>In the following three paragraphs, a “patent license” is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To “grant” such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
<p>If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. “Knowingly relying” means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
<p>If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
<p>A patent license is “discriminatory” if it does not include within the
|
||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||
the non-exercise of one or more of the rights that are specifically
|
||||
granted under this License. You may not convey a covered work if you
|
||||
are a party to an arrangement with a third party that is in the
|
||||
business of distributing software, under which you make payment to the
|
||||
third party based on the extent of your activity of conveying the
|
||||
work, and under which the third party grants, to any of the parties
|
||||
who would receive the covered work from you, a discriminatory patent
|
||||
license (a) in connection with copies of the covered work conveyed by
|
||||
you (or copies made from those copies), or (b) primarily for and in
|
||||
connection with specific products or compilations that contain the
|
||||
covered work, unless you entered into that arrangement, or that patent
|
||||
license was granted, prior to 28 March 2007.
|
||||
|
||||
<p>Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
<li>No Surrender of Others' Freedom.
|
||||
|
||||
<p>If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey
|
||||
a covered work so as to satisfy simultaneously your obligations under
|
||||
this License and any other pertinent obligations, then as a
|
||||
consequence you may not convey it at all. For example, if you agree
|
||||
to terms that obligate you to collect a royalty for further conveying
|
||||
from those to whom you convey the Program, the only way you could
|
||||
satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
<li>Use with the GNU Affero General Public License.
|
||||
|
||||
<p>Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
<li>Revised Versions of this License.
|
||||
|
||||
<p>The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
<p>Each version is given a distinguishing version number. If the Program
|
||||
specifies that a certain numbered version of the GNU General Public
|
||||
License “or any later version” applies to it, you have the option of
|
||||
following the terms and conditions either of that numbered version or
|
||||
of any later version published by the Free Software Foundation. If
|
||||
the Program does not specify a version number of the GNU General
|
||||
Public License, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
|
||||
<p>If the Program specifies that a proxy can decide which future versions
|
||||
of the GNU General Public License can be used, that proxy's public
|
||||
statement of acceptance of a version permanently authorizes you to
|
||||
choose that version for the Program.
|
||||
|
||||
<p>Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
<li>Disclaimer of Warranty.
|
||||
|
||||
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
<li>Limitation of Liability.
|
||||
|
||||
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
<li>Interpretation of Sections 15 and 16.
|
||||
|
||||
<p>If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
</ol>
|
||||
|
||||
<h3 class="heading">END OF TERMS AND CONDITIONS</h3>
|
||||
|
||||
<h3 class="heading">How to Apply These Terms to Your New Programs</h3>
|
||||
|
||||
<p>If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these
|
||||
terms.
|
||||
|
||||
<p>To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
<pre class="smallexample"> <var>one line to give the program's name and a brief idea of what it does.</var>
|
||||
Copyright (C) <var>year</var> <var>name of author</var>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or (at
|
||||
your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
|
||||
</pre>
|
||||
<p>Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
<p>If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<pre class="smallexample"> <var>program</var> Copyright (C) <var>year</var> <var>name of author</var>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type ‘<samp><span class="samp">show w</span></samp>’.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type ‘<samp><span class="samp">show c</span></samp>’ for details.
|
||||
</pre>
|
||||
<p>The hypothetical commands ‘<samp><span class="samp">show w</span></samp>’ and ‘<samp><span class="samp">show c</span></samp>’ should show
|
||||
the appropriate parts of the General Public License. Of course, your
|
||||
program's commands might be different; for a GUI interface, you would
|
||||
use an “about box”.
|
||||
|
||||
<p>You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a “copyright disclaimer” for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
|
||||
|
||||
<p>The GNU General Public License does not permit incorporating your
|
||||
program into proprietary programs. If your program is a subroutine
|
||||
library, you may consider it more useful to permit linking proprietary
|
||||
applications with the library. If this is what you want to do, use
|
||||
the GNU Lesser General Public License instead of this License. But
|
||||
first, please read <a href="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</a>.
|
||||
<!-- man end -->
|
||||
|
||||
<!-- -->
|
||||
<!-- GFDL -->
|
||||
<!-- -->
|
||||
<!-- Special handling for inclusion in the install manual. -->
|
||||
<!-- man begin DESCRIPTION -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,433 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Costs - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="Condition-Code.html#Condition-Code" title="Condition Code">
|
||||
<link rel="next" href="Scheduling.html#Scheduling" title="Scheduling">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Costs"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Scheduling.html#Scheduling">Scheduling</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Condition-Code.html#Condition-Code">Condition Code</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.17 Describing Relative Costs of Operations</h3>
|
||||
|
||||
<p><a name="index-costs-of-instructions-4383"></a><a name="index-relative-costs-4384"></a><a name="index-speed-of-instructions-4385"></a>
|
||||
These macros let you describe the relative speed of various operations
|
||||
on the target machine.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>REGISTER_MOVE_COST</b> (<var>mode, from, to</var>)<var><a name="index-REGISTER_005fMOVE_005fCOST-4386"></a></var><br>
|
||||
<blockquote><p>A C expression for the cost of moving data of mode <var>mode</var> from a
|
||||
register in class <var>from</var> to one in class <var>to</var>. The classes are
|
||||
expressed using the enumeration values such as <code>GENERAL_REGS</code>. A
|
||||
value of 2 is the default; other values are interpreted relative to
|
||||
that.
|
||||
|
||||
<p>It is not required that the cost always equal 2 when <var>from</var> is the
|
||||
same as <var>to</var>; on some machines it is expensive to move between
|
||||
registers if they are not general registers.
|
||||
|
||||
<p>If reload sees an insn consisting of a single <code>set</code> between two
|
||||
hard registers, and if <code>REGISTER_MOVE_COST</code> applied to their
|
||||
classes returns a value of 2, reload does not check to ensure that the
|
||||
constraints of the insn are met. Setting a cost of other than 2 will
|
||||
allow reload to verify that the constraints are met. You should do this
|
||||
if the ‘<samp><span class="samp">mov</span><var>m</var></samp>’ pattern's constraints do not allow such copying.
|
||||
|
||||
<p>These macros are obsolete, new ports should use the target hook
|
||||
<code>TARGET_REGISTER_MOVE_COST</code> instead.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_REGISTER_MOVE_COST</b> (<var>enum machine_mode mode, reg_class_t from, reg_class_t to</var>)<var><a name="index-TARGET_005fREGISTER_005fMOVE_005fCOST-4387"></a></var><br>
|
||||
<blockquote><p>This target hook should return the cost of moving data of mode <var>mode</var>
|
||||
from a register in class <var>from</var> to one in class <var>to</var>. The classes
|
||||
are expressed using the enumeration values such as <code>GENERAL_REGS</code>.
|
||||
A value of 2 is the default; other values are interpreted relative to
|
||||
that.
|
||||
|
||||
<p>It is not required that the cost always equal 2 when <var>from</var> is the
|
||||
same as <var>to</var>; on some machines it is expensive to move between
|
||||
registers if they are not general registers.
|
||||
|
||||
<p>If reload sees an insn consisting of a single <code>set</code> between two
|
||||
hard registers, and if <code>TARGET_REGISTER_MOVE_COST</code> applied to their
|
||||
classes returns a value of 2, reload does not check to ensure that the
|
||||
constraints of the insn are met. Setting a cost of other than 2 will
|
||||
allow reload to verify that the constraints are met. You should do this
|
||||
if the ‘<samp><span class="samp">mov</span><var>m</var></samp>’ pattern's constraints do not allow such copying.
|
||||
|
||||
<p>The default version of this function returns 2.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MEMORY_MOVE_COST</b> (<var>mode, class, in</var>)<var><a name="index-MEMORY_005fMOVE_005fCOST-4388"></a></var><br>
|
||||
<blockquote><p>A C expression for the cost of moving data of mode <var>mode</var> between a
|
||||
register of class <var>class</var> and memory; <var>in</var> is zero if the value
|
||||
is to be written to memory, nonzero if it is to be read in. This cost
|
||||
is relative to those in <code>REGISTER_MOVE_COST</code>. If moving between
|
||||
registers and memory is more expensive than between two registers, you
|
||||
should define this macro to express the relative cost.
|
||||
|
||||
<p>If you do not define this macro, GCC uses a default cost of 4 plus
|
||||
the cost of copying via a secondary reload register, if one is
|
||||
needed. If your machine requires a secondary reload register to copy
|
||||
between memory and a register of <var>class</var> but the reload mechanism is
|
||||
more complex than copying via an intermediate, define this macro to
|
||||
reflect the actual cost of the move.
|
||||
|
||||
<p>GCC defines the function <code>memory_move_secondary_cost</code> if
|
||||
secondary reloads are needed. It computes the costs due to copying via
|
||||
a secondary register. If your machine copies from memory using a
|
||||
secondary register in the conventional way but the default base value of
|
||||
4 is not correct for your machine, define this macro to add some other
|
||||
value to the result of that function. The arguments to that function
|
||||
are the same as to this macro.
|
||||
|
||||
<p>These macros are obsolete, new ports should use the target hook
|
||||
<code>TARGET_MEMORY_MOVE_COST</code> instead.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_MEMORY_MOVE_COST</b> (<var>enum machine_mode mode, reg_class_t rclass, bool in</var>)<var><a name="index-TARGET_005fMEMORY_005fMOVE_005fCOST-4389"></a></var><br>
|
||||
<blockquote><p>This target hook should return the cost of moving data of mode <var>mode</var>
|
||||
between a register of class <var>rclass</var> and memory; <var>in</var> is <code>false</code>
|
||||
if the value is to be written to memory, <code>true</code> if it is to be read in.
|
||||
This cost is relative to those in <code>TARGET_REGISTER_MOVE_COST</code>.
|
||||
If moving between registers and memory is more expensive than between two
|
||||
registers, you should add this target hook to express the relative cost.
|
||||
|
||||
<p>If you do not add this target hook, GCC uses a default cost of 4 plus
|
||||
the cost of copying via a secondary reload register, if one is
|
||||
needed. If your machine requires a secondary reload register to copy
|
||||
between memory and a register of <var>rclass</var> but the reload mechanism is
|
||||
more complex than copying via an intermediate, use this target hook to
|
||||
reflect the actual cost of the move.
|
||||
|
||||
<p>GCC defines the function <code>memory_move_secondary_cost</code> if
|
||||
secondary reloads are needed. It computes the costs due to copying via
|
||||
a secondary register. If your machine copies from memory using a
|
||||
secondary register in the conventional way but the default base value of
|
||||
4 is not correct for your machine, use this target hook to add some other
|
||||
value to the result of that function. The arguments to that function
|
||||
are the same as to this target hook.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>BRANCH_COST</b> (<var>speed_p, predictable_p</var>)<var><a name="index-BRANCH_005fCOST-4390"></a></var><br>
|
||||
<blockquote><p>A C expression for the cost of a branch instruction. A value of 1 is
|
||||
the default; other values are interpreted relative to that. Parameter
|
||||
<var>speed_p</var> is true when the branch in question should be optimized
|
||||
for speed. When it is false, <code>BRANCH_COST</code> should return a value
|
||||
optimal for code size rather than performance. <var>predictable_p</var> is
|
||||
true for well-predicted branches. On many architectures the
|
||||
<code>BRANCH_COST</code> can be reduced then.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p>Here are additional macros which do not specify precise relative costs,
|
||||
but only that certain actions are more expensive than GCC would
|
||||
ordinarily expect.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>SLOW_BYTE_ACCESS</b><var><a name="index-SLOW_005fBYTE_005fACCESS-4391"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C expression which is nonzero if accessing less
|
||||
than a word of memory (i.e. a <code>char</code> or a <code>short</code>) is no
|
||||
faster than accessing a word of memory, i.e., if such access
|
||||
require more than one instruction or if there is no difference in cost
|
||||
between byte and (aligned) word loads.
|
||||
|
||||
<p>When this macro is not defined, the compiler will access a field by
|
||||
finding the smallest containing object; when it is defined, a fullword
|
||||
load will be used if alignment permits. Unless bytes accesses are
|
||||
faster than word accesses, using word accesses is preferable since it
|
||||
may eliminate subsequent memory access if subsequent accesses occur to
|
||||
other fields in the same word of the structure, but to different bytes.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>SLOW_UNALIGNED_ACCESS</b> (<var>mode, alignment</var>)<var><a name="index-SLOW_005fUNALIGNED_005fACCESS-4392"></a></var><br>
|
||||
<blockquote><p>Define this macro to be the value 1 if memory accesses described by the
|
||||
<var>mode</var> and <var>alignment</var> parameters have a cost many times greater
|
||||
than aligned accesses, for example if they are emulated in a trap
|
||||
handler.
|
||||
|
||||
<p>When this macro is nonzero, the compiler will act as if
|
||||
<code>STRICT_ALIGNMENT</code> were nonzero when generating code for block
|
||||
moves. This can cause significantly more instructions to be produced.
|
||||
Therefore, do not set this macro nonzero if unaligned accesses only add a
|
||||
cycle or two to the time for a memory access.
|
||||
|
||||
<p>If the value of this macro is always zero, it need not be defined. If
|
||||
this macro is defined, it should produce a nonzero value when
|
||||
<code>STRICT_ALIGNMENT</code> is nonzero.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MOVE_RATIO</b> (<var>speed</var>)<var><a name="index-MOVE_005fRATIO-4393"></a></var><br>
|
||||
<blockquote><p>The threshold of number of scalar memory-to-memory move insns, <em>below</em>
|
||||
which a sequence of insns should be generated instead of a
|
||||
string move insn or a library call. Increasing the value will always
|
||||
make code faster, but eventually incurs high cost in increased code size.
|
||||
|
||||
<p>Note that on machines where the corresponding move insn is a
|
||||
<code>define_expand</code> that emits a sequence of insns, this macro counts
|
||||
the number of such sequences.
|
||||
|
||||
<p>The parameter <var>speed</var> is true if the code is currently being
|
||||
optimized for speed rather than size.
|
||||
|
||||
<p>If you don't define this, a reasonable default is used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MOVE_BY_PIECES_P</b> (<var>size, alignment</var>)<var><a name="index-MOVE_005fBY_005fPIECES_005fP-4394"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether <code>move_by_pieces</code> will be used to
|
||||
copy a chunk of memory, or whether some other block move mechanism
|
||||
will be used. Defaults to 1 if <code>move_by_pieces_ninsns</code> returns less
|
||||
than <code>MOVE_RATIO</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MOVE_MAX_PIECES</b><var><a name="index-MOVE_005fMAX_005fPIECES-4395"></a></var><br>
|
||||
<blockquote><p>A C expression used by <code>move_by_pieces</code> to determine the largest unit
|
||||
a load or store used to copy memory is. Defaults to <code>MOVE_MAX</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CLEAR_RATIO</b> (<var>speed</var>)<var><a name="index-CLEAR_005fRATIO-4396"></a></var><br>
|
||||
<blockquote><p>The threshold of number of scalar move insns, <em>below</em> which a sequence
|
||||
of insns should be generated to clear memory instead of a string clear insn
|
||||
or a library call. Increasing the value will always make code faster, but
|
||||
eventually incurs high cost in increased code size.
|
||||
|
||||
<p>The parameter <var>speed</var> is true if the code is currently being
|
||||
optimized for speed rather than size.
|
||||
|
||||
<p>If you don't define this, a reasonable default is used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CLEAR_BY_PIECES_P</b> (<var>size, alignment</var>)<var><a name="index-CLEAR_005fBY_005fPIECES_005fP-4397"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether <code>clear_by_pieces</code> will be used
|
||||
to clear a chunk of memory, or whether some other block clear mechanism
|
||||
will be used. Defaults to 1 if <code>move_by_pieces_ninsns</code> returns less
|
||||
than <code>CLEAR_RATIO</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>SET_RATIO</b> (<var>speed</var>)<var><a name="index-SET_005fRATIO-4398"></a></var><br>
|
||||
<blockquote><p>The threshold of number of scalar move insns, <em>below</em> which a sequence
|
||||
of insns should be generated to set memory to a constant value, instead of
|
||||
a block set insn or a library call.
|
||||
Increasing the value will always make code faster, but
|
||||
eventually incurs high cost in increased code size.
|
||||
|
||||
<p>The parameter <var>speed</var> is true if the code is currently being
|
||||
optimized for speed rather than size.
|
||||
|
||||
<p>If you don't define this, it defaults to the value of <code>MOVE_RATIO</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>SET_BY_PIECES_P</b> (<var>size, alignment</var>)<var><a name="index-SET_005fBY_005fPIECES_005fP-4399"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether <code>store_by_pieces</code> will be
|
||||
used to set a chunk of memory to a constant value, or whether some
|
||||
other mechanism will be used. Used by <code>__builtin_memset</code> when
|
||||
storing values other than constant zero.
|
||||
Defaults to 1 if <code>move_by_pieces_ninsns</code> returns less
|
||||
than <code>SET_RATIO</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>STORE_BY_PIECES_P</b> (<var>size, alignment</var>)<var><a name="index-STORE_005fBY_005fPIECES_005fP-4400"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether <code>store_by_pieces</code> will be
|
||||
used to set a chunk of memory to a constant string value, or whether some
|
||||
other mechanism will be used. Used by <code>__builtin_strcpy</code> when
|
||||
called with a constant source string.
|
||||
Defaults to 1 if <code>move_by_pieces_ninsns</code> returns less
|
||||
than <code>MOVE_RATIO</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_LOAD_POST_INCREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fLOAD_005fPOST_005fINCREMENT-4401"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether a load postincrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_POST_INCREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_LOAD_POST_DECREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fLOAD_005fPOST_005fDECREMENT-4402"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether a load postdecrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_POST_DECREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_LOAD_PRE_INCREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fLOAD_005fPRE_005fINCREMENT-4403"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether a load preincrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_PRE_INCREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_LOAD_PRE_DECREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fLOAD_005fPRE_005fDECREMENT-4404"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether a load predecrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_PRE_DECREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_STORE_POST_INCREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fSTORE_005fPOST_005fINCREMENT-4405"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether a store postincrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_POST_INCREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_STORE_POST_DECREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fSTORE_005fPOST_005fDECREMENT-4406"></a></var><br>
|
||||
<blockquote><p>A C expression used to determine whether a store postdecrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_POST_DECREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_STORE_PRE_INCREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fSTORE_005fPRE_005fINCREMENT-4407"></a></var><br>
|
||||
<blockquote><p>This macro is used to determine whether a store preincrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_PRE_INCREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_STORE_PRE_DECREMENT</b> (<var>mode</var>)<var><a name="index-USE_005fSTORE_005fPRE_005fDECREMENT-4408"></a></var><br>
|
||||
<blockquote><p>This macro is used to determine whether a store predecrement is a good
|
||||
thing to use for a given mode. Defaults to the value of
|
||||
<code>HAVE_PRE_DECREMENT</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>NO_FUNCTION_CSE</b><var><a name="index-NO_005fFUNCTION_005fCSE-4409"></a></var><br>
|
||||
<blockquote><p>Define this macro if it is as good or better to call a constant
|
||||
function address than to call an address kept in a register.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LOGICAL_OP_NON_SHORT_CIRCUIT</b><var><a name="index-LOGICAL_005fOP_005fNON_005fSHORT_005fCIRCUIT-4410"></a></var><br>
|
||||
<blockquote><p>Define this macro if a non-short-circuit operation produced by
|
||||
‘<samp><span class="samp">fold_range_test ()</span></samp>’ is optimal. This macro defaults to true if
|
||||
<code>BRANCH_COST</code> is greater than or equal to the value 2.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_RTX_COSTS</b> (<var>rtx x, int code, int outer_code, int opno, int *total, bool speed</var>)<var><a name="index-TARGET_005fRTX_005fCOSTS-4411"></a></var><br>
|
||||
<blockquote><p>This target hook describes the relative costs of RTL expressions.
|
||||
|
||||
<p>The cost may depend on the precise form of the expression, which is
|
||||
available for examination in <var>x</var>, and the fact that <var>x</var> appears
|
||||
as operand <var>opno</var> of an expression with rtx code <var>outer_code</var>.
|
||||
That is, the hook can assume that there is some rtx <var>y</var> such
|
||||
that ‘<samp><span class="samp">GET_CODE (</span><var>y</var><span class="samp">) == </span><var>outer_code</var></samp>’ and such that
|
||||
either (a) ‘<samp><span class="samp">XEXP (</span><var>y</var><span class="samp">, </span><var>opno</var><span class="samp">) == </span><var>x</var></samp>’ or
|
||||
(b) ‘<samp><span class="samp">XVEC (</span><var>y</var><span class="samp">, </span><var>opno</var><span class="samp">)</span></samp>’ contains <var>x</var>.
|
||||
|
||||
<p><var>code</var> is <var>x</var>'s expression code—redundant, since it can be
|
||||
obtained with <code>GET_CODE (</code><var>x</var><code>)</code>.
|
||||
|
||||
<p>In implementing this hook, you can use the construct
|
||||
<code>COSTS_N_INSNS (</code><var>n</var><code>)</code> to specify a cost equal to <var>n</var> fast
|
||||
instructions.
|
||||
|
||||
<p>On entry to the hook, <code>*</code><var>total</var> contains a default estimate
|
||||
for the cost of the expression. The hook should modify this value as
|
||||
necessary. Traditionally, the default costs are <code>COSTS_N_INSNS (5)</code>
|
||||
for multiplications, <code>COSTS_N_INSNS (7)</code> for division and modulus
|
||||
operations, and <code>COSTS_N_INSNS (1)</code> for all other operations.
|
||||
|
||||
<p>When optimizing for code size, i.e. when <code>speed</code> is
|
||||
false, this target hook should be used to estimate the relative
|
||||
size cost of an expression, again relative to <code>COSTS_N_INSNS</code>.
|
||||
|
||||
<p>The hook returns true when all subexpressions of <var>x</var> have been
|
||||
processed, and false when <code>rtx_cost</code> should recurse.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_ADDRESS_COST</b> (<var>rtx address, enum machine_mode mode, addr_space_t as, bool speed</var>)<var><a name="index-TARGET_005fADDRESS_005fCOST-4412"></a></var><br>
|
||||
<blockquote><p>This hook computes the cost of an addressing mode that contains
|
||||
<var>address</var>. If not defined, the cost is computed from
|
||||
the <var>address</var> expression and the <code>TARGET_RTX_COST</code> hook.
|
||||
|
||||
<p>For most CISC machines, the default cost is a good approximation of the
|
||||
true cost of the addressing mode. However, on RISC machines, all
|
||||
instructions normally have the same length and execution time. Hence
|
||||
all addresses will have equal costs.
|
||||
|
||||
<p>In cases where more than one form of an address is known, the form with
|
||||
the lowest cost will be used. If multiple forms have the same, lowest,
|
||||
cost, the one that is the most complex will be used.
|
||||
|
||||
<p>For example, suppose an address that is equal to the sum of a register
|
||||
and a constant is used twice in the same basic block. When this macro
|
||||
is not defined, the address will be computed in a register and memory
|
||||
references will be indirect through that register. On machines where
|
||||
the cost of the addressing mode containing the sum is no higher than
|
||||
that of a simple indirect reference, this will produce an additional
|
||||
instruction and possibly require an additional register. Proper
|
||||
specification of this macro eliminates this overhead for such machines.
|
||||
|
||||
<p>This hook is never called with an invalid address.
|
||||
|
||||
<p>On machines where an address involving more than one register is as
|
||||
cheap as an address computation involving only one register, defining
|
||||
<code>TARGET_ADDRESS_COST</code> to reflect this can cause two registers to
|
||||
be live over a region of code where only one would have been if
|
||||
<code>TARGET_ADDRESS_COST</code> were not defined in that manner. This effect
|
||||
should be considered in the definition of this macro. Equivalent costs
|
||||
should probably only be given to addresses with different numbers of
|
||||
registers on machines with lots of registers.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Current structure hierarchy - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Internal-structure.html#Internal-structure" title="Internal structure">
|
||||
<link rel="next" href="Adding-new-DECL-node-types.html#Adding-new-DECL-node-types" title="Adding new DECL node types">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Current-structure-hierarchy"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Adding-new-DECL-node-types.html#Adding-new-DECL-node-types">Adding new DECL node types</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Internal-structure.html#Internal-structure">Internal structure</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h5 class="subsubsection">11.4.2.1 Current structure hierarchy</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>struct tree_decl_minimal</code><dd>This is the minimal structure to inherit from in order for common
|
||||
<code>DECL</code> macros to work. The fields it contains are a unique ID,
|
||||
source location, context, and name.
|
||||
|
||||
<br><dt><code>struct tree_decl_common</code><dd>This structure inherits from <code>struct tree_decl_minimal</code>. It
|
||||
contains fields that most <code>DECL</code> nodes need, such as a field to
|
||||
store alignment, machine mode, size, and attributes.
|
||||
|
||||
<br><dt><code>struct tree_field_decl</code><dd>This structure inherits from <code>struct tree_decl_common</code>. It is
|
||||
used to represent <code>FIELD_DECL</code>.
|
||||
|
||||
<br><dt><code>struct tree_label_decl</code><dd>This structure inherits from <code>struct tree_decl_common</code>. It is
|
||||
used to represent <code>LABEL_DECL</code>.
|
||||
|
||||
<br><dt><code>struct tree_translation_unit_decl</code><dd>This structure inherits from <code>struct tree_decl_common</code>. It is
|
||||
used to represent <code>TRANSLATION_UNIT_DECL</code>.
|
||||
|
||||
<br><dt><code>struct tree_decl_with_rtl</code><dd>This structure inherits from <code>struct tree_decl_common</code>. It
|
||||
contains a field to store the low-level RTL associated with a
|
||||
<code>DECL</code> node.
|
||||
|
||||
<br><dt><code>struct tree_result_decl</code><dd>This structure inherits from <code>struct tree_decl_with_rtl</code>. It is
|
||||
used to represent <code>RESULT_DECL</code>.
|
||||
|
||||
<br><dt><code>struct tree_const_decl</code><dd>This structure inherits from <code>struct tree_decl_with_rtl</code>. It is
|
||||
used to represent <code>CONST_DECL</code>.
|
||||
|
||||
<br><dt><code>struct tree_parm_decl</code><dd>This structure inherits from <code>struct tree_decl_with_rtl</code>. It is
|
||||
used to represent <code>PARM_DECL</code>.
|
||||
|
||||
<br><dt><code>struct tree_decl_with_vis</code><dd>This structure inherits from <code>struct tree_decl_with_rtl</code>. It
|
||||
contains fields necessary to store visibility information, as well as
|
||||
a section name and assembler name.
|
||||
|
||||
<br><dt><code>struct tree_var_decl</code><dd>This structure inherits from <code>struct tree_decl_with_vis</code>. It is
|
||||
used to represent <code>VAR_DECL</code>.
|
||||
|
||||
<br><dt><code>struct tree_function_decl</code><dd>This structure inherits from <code>struct tree_decl_with_vis</code>. It is
|
||||
used to represent <code>FUNCTION_DECL</code>.
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>DBX Hooks - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Debugging-Info.html#Debugging-Info" title="Debugging Info">
|
||||
<link rel="prev" href="DBX-Options.html#DBX-Options" title="DBX Options">
|
||||
<link rel="next" href="File-Names-and-DBX.html#File-Names-and-DBX" title="File Names and DBX">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="DBX-Hooks"></a>
|
||||
Next: <a rel="next" accesskey="n" href="File-Names-and-DBX.html#File-Names-and-DBX">File Names and DBX</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="DBX-Options.html#DBX-Options">DBX Options</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Debugging-Info.html#Debugging-Info">Debugging Info</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.22.3 Open-Ended Hooks for DBX Format</h4>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>These are hooks for DBX format.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_OUTPUT_SOURCE_LINE</b> (<var>stream, line, counter</var>)<var><a name="index-DBX_005fOUTPUT_005fSOURCE_005fLINE-4712"></a></var><br>
|
||||
<blockquote><p>A C statement to output DBX debugging information before code for line
|
||||
number <var>line</var> of the current source file to the stdio stream
|
||||
<var>stream</var>. <var>counter</var> is the number of time the macro was
|
||||
invoked, including the current invocation; it is intended to generate
|
||||
unique labels in the assembly output.
|
||||
|
||||
<p>This macro should not be defined if the default output is correct, or
|
||||
if it can be made correct by defining <code>DBX_LINES_FUNCTION_RELATIVE</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>NO_DBX_FUNCTION_END</b><var><a name="index-NO_005fDBX_005fFUNCTION_005fEND-4713"></a></var><br>
|
||||
<blockquote><p>Some stabs encapsulation formats (in particular ECOFF), cannot handle the
|
||||
<code>.stabs "",N_FUN,,0,0,Lscope-function-1</code> gdb dbx extension construct.
|
||||
On those machines, define this macro to turn this feature off without
|
||||
disturbing the rest of the gdb extensions.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>NO_DBX_BNSYM_ENSYM</b><var><a name="index-NO_005fDBX_005fBNSYM_005fENSYM-4714"></a></var><br>
|
||||
<blockquote><p>Some assemblers cannot handle the <code>.stabd BNSYM/ENSYM,0,0</code> gdb dbx
|
||||
extension construct. On those machines, define this macro to turn this
|
||||
feature off without disturbing the rest of the gdb extensions.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>DBX Options - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Debugging-Info.html#Debugging-Info" title="Debugging Info">
|
||||
<link rel="prev" href="All-Debuggers.html#All-Debuggers" title="All Debuggers">
|
||||
<link rel="next" href="DBX-Hooks.html#DBX-Hooks" title="DBX Hooks">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="DBX-Options"></a>
|
||||
Next: <a rel="next" accesskey="n" href="DBX-Hooks.html#DBX-Hooks">DBX Hooks</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="All-Debuggers.html#All-Debuggers">All Debuggers</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Debugging-Info.html#Debugging-Info">Debugging Info</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.22.2 Specific Options for DBX Output</h4>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>These are specific options for DBX output.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_DEBUGGING_INFO</b><var><a name="index-DBX_005fDEBUGGING_005fINFO-4693"></a></var><br>
|
||||
<blockquote><p>Define this macro if GCC should produce debugging output for DBX
|
||||
in response to the <samp><span class="option">-g</span></samp> option.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>XCOFF_DEBUGGING_INFO</b><var><a name="index-XCOFF_005fDEBUGGING_005fINFO-4694"></a></var><br>
|
||||
<blockquote><p>Define this macro if GCC should produce XCOFF format debugging output
|
||||
in response to the <samp><span class="option">-g</span></samp> option. This is a variant of DBX format.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DEFAULT_GDB_EXTENSIONS</b><var><a name="index-DEFAULT_005fGDB_005fEXTENSIONS-4695"></a></var><br>
|
||||
<blockquote><p>Define this macro to control whether GCC should by default generate
|
||||
GDB's extended version of DBX debugging information (assuming DBX-format
|
||||
debugging information is enabled at all). If you don't define the
|
||||
macro, the default is 1: always generate the extended information
|
||||
if there is any occasion to.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DEBUG_SYMS_TEXT</b><var><a name="index-DEBUG_005fSYMS_005fTEXT-4696"></a></var><br>
|
||||
<blockquote><p>Define this macro if all <code>.stabs</code> commands should be output while
|
||||
in the text section.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_STABS_OP</b><var><a name="index-ASM_005fSTABS_005fOP-4697"></a></var><br>
|
||||
<blockquote><p>A C string constant, including spacing, naming the assembler pseudo op to
|
||||
use instead of <code>"\t.stabs\t"</code> to define an ordinary debugging symbol.
|
||||
If you don't define this macro, <code>"\t.stabs\t"</code> is used. This macro
|
||||
applies only to DBX debugging information format.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_STABD_OP</b><var><a name="index-ASM_005fSTABD_005fOP-4698"></a></var><br>
|
||||
<blockquote><p>A C string constant, including spacing, naming the assembler pseudo op to
|
||||
use instead of <code>"\t.stabd\t"</code> to define a debugging symbol whose
|
||||
value is the current location. If you don't define this macro,
|
||||
<code>"\t.stabd\t"</code> is used. This macro applies only to DBX debugging
|
||||
information format.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_STABN_OP</b><var><a name="index-ASM_005fSTABN_005fOP-4699"></a></var><br>
|
||||
<blockquote><p>A C string constant, including spacing, naming the assembler pseudo op to
|
||||
use instead of <code>"\t.stabn\t"</code> to define a debugging symbol with no
|
||||
name. If you don't define this macro, <code>"\t.stabn\t"</code> is used. This
|
||||
macro applies only to DBX debugging information format.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_NO_XREFS</b><var><a name="index-DBX_005fNO_005fXREFS-4700"></a></var><br>
|
||||
<blockquote><p>Define this macro if DBX on your system does not support the construct
|
||||
‘<samp><span class="samp">xs</span><var>tagname</var></samp>’. On some systems, this construct is used to
|
||||
describe a forward reference to a structure named <var>tagname</var>.
|
||||
On other systems, this construct is not supported at all.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_CONTIN_LENGTH</b><var><a name="index-DBX_005fCONTIN_005fLENGTH-4701"></a></var><br>
|
||||
<blockquote><p>A symbol name in DBX-format debugging information is normally
|
||||
continued (split into two separate <code>.stabs</code> directives) when it
|
||||
exceeds a certain length (by default, 80 characters). On some
|
||||
operating systems, DBX requires this splitting; on others, splitting
|
||||
must not be done. You can inhibit splitting by defining this macro
|
||||
with the value zero. You can override the default splitting-length by
|
||||
defining this macro as an expression for the length you desire.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_CONTIN_CHAR</b><var><a name="index-DBX_005fCONTIN_005fCHAR-4702"></a></var><br>
|
||||
<blockquote><p>Normally continuation is indicated by adding a ‘<samp><span class="samp">\</span></samp>’ character to
|
||||
the end of a <code>.stabs</code> string when a continuation follows. To use
|
||||
a different character instead, define this macro as a character
|
||||
constant for the character you want to use. Do not define this macro
|
||||
if backslash is correct for your system.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_STATIC_STAB_DATA_SECTION</b><var><a name="index-DBX_005fSTATIC_005fSTAB_005fDATA_005fSECTION-4703"></a></var><br>
|
||||
<blockquote><p>Define this macro if it is necessary to go to the data section before
|
||||
outputting the ‘<samp><span class="samp">.stabs</span></samp>’ pseudo-op for a non-global static
|
||||
variable.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_TYPE_DECL_STABS_CODE</b><var><a name="index-DBX_005fTYPE_005fDECL_005fSTABS_005fCODE-4704"></a></var><br>
|
||||
<blockquote><p>The value to use in the “code” field of the <code>.stabs</code> directive
|
||||
for a typedef. The default is <code>N_LSYM</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_STATIC_CONST_VAR_CODE</b><var><a name="index-DBX_005fSTATIC_005fCONST_005fVAR_005fCODE-4705"></a></var><br>
|
||||
<blockquote><p>The value to use in the “code” field of the <code>.stabs</code> directive
|
||||
for a static variable located in the text section. DBX format does not
|
||||
provide any “right” way to do this. The default is <code>N_FUN</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_REGPARM_STABS_CODE</b><var><a name="index-DBX_005fREGPARM_005fSTABS_005fCODE-4706"></a></var><br>
|
||||
<blockquote><p>The value to use in the “code” field of the <code>.stabs</code> directive
|
||||
for a parameter passed in registers. DBX format does not provide any
|
||||
“right” way to do this. The default is <code>N_RSYM</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_REGPARM_STABS_LETTER</b><var><a name="index-DBX_005fREGPARM_005fSTABS_005fLETTER-4707"></a></var><br>
|
||||
<blockquote><p>The letter to use in DBX symbol data to identify a symbol as a parameter
|
||||
passed in registers. DBX format does not customarily provide any way to
|
||||
do this. The default is <code>'P'</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_FUNCTION_FIRST</b><var><a name="index-DBX_005fFUNCTION_005fFIRST-4708"></a></var><br>
|
||||
<blockquote><p>Define this macro if the DBX information for a function and its
|
||||
arguments should precede the assembler code for the function. Normally,
|
||||
in DBX format, the debugging information entirely follows the assembler
|
||||
code.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_BLOCKS_FUNCTION_RELATIVE</b><var><a name="index-DBX_005fBLOCKS_005fFUNCTION_005fRELATIVE-4709"></a></var><br>
|
||||
<blockquote><p>Define this macro, with value 1, if the value of a symbol describing
|
||||
the scope of a block (<code>N_LBRAC</code> or <code>N_RBRAC</code>) should be
|
||||
relative to the start of the enclosing function. Normally, GCC uses
|
||||
an absolute address.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_LINES_FUNCTION_RELATIVE</b><var><a name="index-DBX_005fLINES_005fFUNCTION_005fRELATIVE-4710"></a></var><br>
|
||||
<blockquote><p>Define this macro, with value 1, if the value of a symbol indicating
|
||||
the current line number (<code>N_SLINE</code>) should be relative to the
|
||||
start of the enclosing function. Normally, GCC uses an absolute address.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DBX_USE_BINCL</b><var><a name="index-DBX_005fUSE_005fBINCL-4711"></a></var><br>
|
||||
<blockquote><p>Define this macro if GCC should generate <code>N_BINCL</code> and
|
||||
<code>N_EINCL</code> stabs for included header files, as on Sun systems. This
|
||||
macro also directs GCC to output a type number as a pair of a file
|
||||
number and a type number within the file. Normally, GCC does not
|
||||
generate <code>N_BINCL</code> or <code>N_EINCL</code> stabs, and it outputs a single
|
||||
number for a type number.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Data Output - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Assembler-Format.html#Assembler-Format" title="Assembler Format">
|
||||
<link rel="prev" href="File-Framework.html#File-Framework" title="File Framework">
|
||||
<link rel="next" href="Uninitialized-Data.html#Uninitialized-Data" title="Uninitialized Data">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Data-Output"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Uninitialized-Data.html#Uninitialized-Data">Uninitialized Data</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="File-Framework.html#File-Framework">File Framework</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Assembler-Format.html#Assembler-Format">Assembler Format</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.21.2 Output of Data</h4>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_ASM_BYTE_OP</b><var><a name="index-TARGET_005fASM_005fBYTE_005fOP-4523"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_ALIGNED_HI_OP</b><var><a name="index-TARGET_005fASM_005fALIGNED_005fHI_005fOP-4524"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_ALIGNED_SI_OP</b><var><a name="index-TARGET_005fASM_005fALIGNED_005fSI_005fOP-4525"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_ALIGNED_DI_OP</b><var><a name="index-TARGET_005fASM_005fALIGNED_005fDI_005fOP-4526"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_ALIGNED_TI_OP</b><var><a name="index-TARGET_005fASM_005fALIGNED_005fTI_005fOP-4527"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_UNALIGNED_HI_OP</b><var><a name="index-TARGET_005fASM_005fUNALIGNED_005fHI_005fOP-4528"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_UNALIGNED_SI_OP</b><var><a name="index-TARGET_005fASM_005fUNALIGNED_005fSI_005fOP-4529"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_UNALIGNED_DI_OP</b><var><a name="index-TARGET_005fASM_005fUNALIGNED_005fDI_005fOP-4530"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_UNALIGNED_TI_OP</b><var><a name="index-TARGET_005fASM_005fUNALIGNED_005fTI_005fOP-4531"></a></var><br>
|
||||
<blockquote><p>These hooks specify assembly directives for creating certain kinds
|
||||
of integer object. The <code>TARGET_ASM_BYTE_OP</code> directive creates a
|
||||
byte-sized object, the <code>TARGET_ASM_ALIGNED_HI_OP</code> one creates an
|
||||
aligned two-byte object, and so on. Any of the hooks may be
|
||||
<code>NULL</code>, indicating that no suitable directive is available.
|
||||
|
||||
<p>The compiler will print these strings at the start of a new line,
|
||||
followed immediately by the object's initial value. In most cases,
|
||||
the string should contain a tab, a pseudo-op, and then another tab.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_ASM_INTEGER</b> (<var>rtx x, unsigned int size, int aligned_p</var>)<var><a name="index-TARGET_005fASM_005fINTEGER-4532"></a></var><br>
|
||||
<blockquote><p>The <code>assemble_integer</code> function uses this hook to output an
|
||||
integer object. <var>x</var> is the object's value, <var>size</var> is its size
|
||||
in bytes and <var>aligned_p</var> indicates whether it is aligned. The
|
||||
function should return <code>true</code> if it was able to output the
|
||||
object. If it returns false, <code>assemble_integer</code> will try to
|
||||
split the object into smaller parts.
|
||||
|
||||
<p>The default implementation of this hook will use the
|
||||
<code>TARGET_ASM_BYTE_OP</code> family of strings, returning <code>false</code>
|
||||
when the relevant string is <code>NULL</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA</b> (<var>FILE *file, rtx x</var>)<var><a name="index-TARGET_005fASM_005fOUTPUT_005fADDR_005fCONST_005fEXTRA-4533"></a></var><br>
|
||||
<blockquote><p>A target hook to recognize <var>rtx</var> patterns that <code>output_addr_const</code>
|
||||
can't deal with, and output assembly code to <var>file</var> corresponding to
|
||||
the pattern <var>x</var>. This may be used to allow machine-dependent
|
||||
<code>UNSPEC</code>s to appear within constants.
|
||||
|
||||
<p>If target hook fails to recognize a pattern, it must return <code>false</code>,
|
||||
so that a standard error message is printed. If it prints an error message
|
||||
itself, by calling, for example, <code>output_operand_lossage</code>, it may just
|
||||
return <code>true</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_ASCII</b> (<var>stream, ptr, len</var>)<var><a name="index-ASM_005fOUTPUT_005fASCII-4534"></a></var><br>
|
||||
<blockquote><p>A C statement to output to the stdio stream <var>stream</var> an assembler
|
||||
instruction to assemble a string constant containing the <var>len</var>
|
||||
bytes at <var>ptr</var>. <var>ptr</var> will be a C expression of type
|
||||
<code>char *</code> and <var>len</var> a C expression of type <code>int</code>.
|
||||
|
||||
<p>If the assembler has a <code>.ascii</code> pseudo-op as found in the
|
||||
Berkeley Unix assembler, do not define the macro
|
||||
<code>ASM_OUTPUT_ASCII</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_FDESC</b> (<var>stream, decl, n</var>)<var><a name="index-ASM_005fOUTPUT_005fFDESC-4535"></a></var><br>
|
||||
<blockquote><p>A C statement to output word <var>n</var> of a function descriptor for
|
||||
<var>decl</var>. This must be defined if <code>TARGET_VTABLE_USES_DESCRIPTORS</code>
|
||||
is defined, and is otherwise unused.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CONSTANT_POOL_BEFORE_FUNCTION</b><var><a name="index-CONSTANT_005fPOOL_005fBEFORE_005fFUNCTION-4536"></a></var><br>
|
||||
<blockquote><p>You may define this macro as a C expression. You should define the
|
||||
expression to have a nonzero value if GCC should output the constant
|
||||
pool for a function before the code for the function, or a zero value if
|
||||
GCC should output the constant pool after the function. If you do
|
||||
not define this macro, the usual case, GCC will output the constant
|
||||
pool before the function.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_POOL_PROLOGUE</b> (<var>file, funname, fundecl, size</var>)<var><a name="index-ASM_005fOUTPUT_005fPOOL_005fPROLOGUE-4537"></a></var><br>
|
||||
<blockquote><p>A C statement to output assembler commands to define the start of the
|
||||
constant pool for a function. <var>funname</var> is a string giving
|
||||
the name of the function. Should the return type of the function
|
||||
be required, it can be obtained via <var>fundecl</var>. <var>size</var>
|
||||
is the size, in bytes, of the constant pool that will be written
|
||||
immediately after this call.
|
||||
|
||||
<p>If no constant-pool prefix is required, the usual case, this macro need
|
||||
not be defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_SPECIAL_POOL_ENTRY</b> (<var>file, x, mode, align, labelno, jumpto</var>)<var><a name="index-ASM_005fOUTPUT_005fSPECIAL_005fPOOL_005fENTRY-4538"></a></var><br>
|
||||
<blockquote><p>A C statement (with or without semicolon) to output a constant in the
|
||||
constant pool, if it needs special treatment. (This macro need not do
|
||||
anything for RTL expressions that can be output normally.)
|
||||
|
||||
<p>The argument <var>file</var> is the standard I/O stream to output the
|
||||
assembler code on. <var>x</var> is the RTL expression for the constant to
|
||||
output, and <var>mode</var> is the machine mode (in case <var>x</var> is a
|
||||
‘<samp><span class="samp">const_int</span></samp>’). <var>align</var> is the required alignment for the value
|
||||
<var>x</var>; you should output an assembler directive to force this much
|
||||
alignment.
|
||||
|
||||
<p>The argument <var>labelno</var> is a number to use in an internal label for
|
||||
the address of this pool entry. The definition of this macro is
|
||||
responsible for outputting the label definition at the proper place.
|
||||
Here is how to do this:
|
||||
|
||||
<pre class="smallexample"> <code>(*targetm.asm_out.internal_label)</code> (<var>file</var>, "LC", <var>labelno</var>);
|
||||
</pre>
|
||||
<p>When you output a pool entry specially, you should end with a
|
||||
<code>goto</code> to the label <var>jumpto</var>. This will prevent the same pool
|
||||
entry from being output a second time in the usual manner.
|
||||
|
||||
<p>You need not define this macro if it would do nothing.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_POOL_EPILOGUE</b> (<var>file funname fundecl size</var>)<var><a name="index-ASM_005fOUTPUT_005fPOOL_005fEPILOGUE-4539"></a></var><br>
|
||||
<blockquote><p>A C statement to output assembler commands to at the end of the constant
|
||||
pool for a function. <var>funname</var> is a string giving the name of the
|
||||
function. Should the return type of the function be required, you can
|
||||
obtain it via <var>fundecl</var>. <var>size</var> is the size, in bytes, of the
|
||||
constant pool that GCC wrote immediately before this call.
|
||||
|
||||
<p>If no constant-pool epilogue is required, the usual case, you need not
|
||||
define this macro.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>IS_ASM_LOGICAL_LINE_SEPARATOR</b> (<var>C, STR</var>)<var><a name="index-IS_005fASM_005fLOGICAL_005fLINE_005fSEPARATOR-4540"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C expression which is nonzero if <var>C</var> is
|
||||
used as a logical line separator by the assembler. <var>STR</var> points
|
||||
to the position in the string where <var>C</var> was found; this can be used if
|
||||
a line separator uses multiple characters.
|
||||
|
||||
<p>If you do not define this macro, the default is that only
|
||||
the character ‘<samp><span class="samp">;</span></samp>’ is treated as a logical line separator.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_ASM_OPEN_PAREN</b><var><a name="index-TARGET_005fASM_005fOPEN_005fPAREN-4541"></a></var><br>
|
||||
— Target Hook: const char * <b>TARGET_ASM_CLOSE_PAREN</b><var><a name="index-TARGET_005fASM_005fCLOSE_005fPAREN-4542"></a></var><br>
|
||||
<blockquote><p>These target hooks are C string constants, describing the syntax in the
|
||||
assembler for grouping arithmetic expressions. If not overridden, they
|
||||
default to normal parentheses, which is correct for most assemblers.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p>These macros are provided by <samp><span class="file">real.h</span></samp> for writing the definitions
|
||||
of <code>ASM_OUTPUT_DOUBLE</code> and the like:
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>REAL_VALUE_TO_TARGET_SINGLE</b> (<var>x, l</var>)<var><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fSINGLE-4543"></a></var><br>
|
||||
— Macro: <b>REAL_VALUE_TO_TARGET_DOUBLE</b> (<var>x, l</var>)<var><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDOUBLE-4544"></a></var><br>
|
||||
— Macro: <b>REAL_VALUE_TO_TARGET_LONG_DOUBLE</b> (<var>x, l</var>)<var><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fLONG_005fDOUBLE-4545"></a></var><br>
|
||||
— Macro: <b>REAL_VALUE_TO_TARGET_DECIMAL32</b> (<var>x, l</var>)<var><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDECIMAL32-4546"></a></var><br>
|
||||
— Macro: <b>REAL_VALUE_TO_TARGET_DECIMAL64</b> (<var>x, l</var>)<var><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDECIMAL64-4547"></a></var><br>
|
||||
— Macro: <b>REAL_VALUE_TO_TARGET_DECIMAL128</b> (<var>x, l</var>)<var><a name="index-REAL_005fVALUE_005fTO_005fTARGET_005fDECIMAL128-4548"></a></var><br>
|
||||
<blockquote><p>These translate <var>x</var>, of type <code>REAL_VALUE_TYPE</code>, to the
|
||||
target's floating point representation, and store its bit pattern in
|
||||
the variable <var>l</var>. For <code>REAL_VALUE_TO_TARGET_SINGLE</code> and
|
||||
<code>REAL_VALUE_TO_TARGET_DECIMAL32</code>, this variable should be a
|
||||
simple <code>long int</code>. For the others, it should be an array of
|
||||
<code>long int</code>. The number of elements in this array is determined
|
||||
by the size of the desired target floating point data type: 32 bits of
|
||||
it go in each <code>long int</code> array element. Each array element holds
|
||||
32 bits of the result, even if <code>long int</code> is wider than 32 bits
|
||||
on the host machine.
|
||||
|
||||
<p>The array element values are designed so that you can print them out
|
||||
using <code>fprintf</code> in the order they should appear in the target
|
||||
machine's memory.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Debug Information - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="RTL.html#RTL" title="RTL">
|
||||
<link rel="prev" href="Assembler.html#Assembler" title="Assembler">
|
||||
<link rel="next" href="Insns.html#Insns" title="Insns">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Debug-Information"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Insns.html#Insns">Insns</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Assembler.html#Assembler">Assembler</a>,
|
||||
Up: <a rel="up" accesskey="u" href="RTL.html#RTL">RTL</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">10.18 Variable Location Debug Information in RTL</h3>
|
||||
|
||||
<p><a name="index-Variable-Location-Debug-Information-in-RTL-2210"></a>
|
||||
Variable tracking relies on <code>MEM_EXPR</code> and <code>REG_EXPR</code>
|
||||
annotations to determine what user variables memory and register
|
||||
references refer to.
|
||||
|
||||
<p>Variable tracking at assignments uses these notes only when they refer
|
||||
to variables that live at fixed locations (e.g., addressable
|
||||
variables, global non-automatic variables). For variables whose
|
||||
location may vary, it relies on the following types of notes.
|
||||
|
||||
|
||||
<a name="index-var_005flocation-2211"></a>
|
||||
<dl><dt><code>(var_location:</code><var>mode</var> <var>var</var> <var>exp</var> <var>stat</var><code>)</code><dd>Binds variable <code>var</code>, a tree, to value <var>exp</var>, an RTL
|
||||
expression. It appears only in <code>NOTE_INSN_VAR_LOCATION</code> and
|
||||
<code>DEBUG_INSN</code>s, with slightly different meanings. <var>mode</var>, if
|
||||
present, represents the mode of <var>exp</var>, which is useful if it is a
|
||||
modeless expression. <var>stat</var> is only meaningful in notes,
|
||||
indicating whether the variable is known to be initialized or
|
||||
uninitialized.
|
||||
|
||||
<p><a name="index-debug_005fexpr-2212"></a><br><dt><code>(debug_expr:</code><var>mode</var> <var>decl</var><code>)</code><dd>Stands for the value bound to the <code>DEBUG_EXPR_DECL</code> <var>decl</var>,
|
||||
that points back to it, within value expressions in
|
||||
<code>VAR_LOCATION</code> nodes.
|
||||
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Debugging Info - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="Assembler-Format.html#Assembler-Format" title="Assembler Format">
|
||||
<link rel="next" href="Floating-Point.html#Floating-Point" title="Floating Point">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Debugging-Info"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Floating-Point.html#Floating-Point">Floating Point</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Assembler-Format.html#Assembler-Format">Assembler Format</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.22 Controlling Debugging Information Format</h3>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>This describes how to specify debugging information.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="All-Debuggers.html#All-Debuggers">All Debuggers</a>: Macros that affect all debugging formats uniformly.
|
||||
<li><a accesskey="2" href="DBX-Options.html#DBX-Options">DBX Options</a>: Macros enabling specific options in DBX format.
|
||||
<li><a accesskey="3" href="DBX-Hooks.html#DBX-Hooks">DBX Hooks</a>: Hook macros for varying DBX format.
|
||||
<li><a accesskey="4" href="File-Names-and-DBX.html#File-Names-and-DBX">File Names and DBX</a>: Macros controlling output of file names in DBX format.
|
||||
<li><a accesskey="5" href="SDB-and-DWARF.html#SDB-and-DWARF">SDB and DWARF</a>: Macros for SDB (COFF) and DWARF formats.
|
||||
<li><a accesskey="6" href="VMS-Debug.html#VMS-Debug">VMS Debug</a>: Macros for VMS debug format.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,379 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Decimal float library routines - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Libgcc.html#Libgcc" title="Libgcc">
|
||||
<link rel="prev" href="Soft-float-library-routines.html#Soft-float-library-routines" title="Soft float library routines">
|
||||
<link rel="next" href="Fixed_002dpoint-fractional-library-routines.html#Fixed_002dpoint-fractional-library-routines" title="Fixed-point fractional library routines">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Decimal-float-library-routines"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Fixed_002dpoint-fractional-library-routines.html#Fixed_002dpoint-fractional-library-routines">Fixed-point fractional library routines</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Soft-float-library-routines.html#Soft-float-library-routines">Soft float library routines</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Libgcc.html#Libgcc">Libgcc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">4.3 Routines for decimal floating point emulation</h3>
|
||||
|
||||
<p><a name="index-decimal-float-library-193"></a><a name="index-IEEE-754_002d2008-194"></a>
|
||||
The software decimal floating point library implements IEEE 754-2008
|
||||
decimal floating point arithmetic and is only activated on selected
|
||||
targets.
|
||||
|
||||
<p>The software decimal floating point library supports either DPD
|
||||
(Densely Packed Decimal) or BID (Binary Integer Decimal) encoding
|
||||
as selected at configure time.
|
||||
|
||||
<h4 class="subsection">4.3.1 Arithmetic functions</h4>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_addsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005faddsd3-195"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_addsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005faddsd3-196"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_adddd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fadddd3-197"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_adddd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fadddd3-198"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_addtd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005faddtd3-199"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_addtd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005faddtd3-200"></a></var><br>
|
||||
<blockquote><p>These functions return the sum of <var>a</var> and <var>b</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_subsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005fsubsd3-201"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_subsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005fsubsd3-202"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_subdd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fsubdd3-203"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_subdd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fsubdd3-204"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_subtd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005fsubtd3-205"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_subtd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005fsubtd3-206"></a></var><br>
|
||||
<blockquote><p>These functions return the difference between <var>b</var> and <var>a</var>;
|
||||
that is, <var>a</var> - <var>b</var><!-- /@w -->.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_mulsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005fmulsd3-207"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_mulsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005fmulsd3-208"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_muldd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fmuldd3-209"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_muldd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fmuldd3-210"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_multd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005fmultd3-211"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_multd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005fmultd3-212"></a></var><br>
|
||||
<blockquote><p>These functions return the product of <var>a</var> and <var>b</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_divsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005fdivsd3-213"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_divsd3</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005fdivsd3-214"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_divdd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fdivdd3-215"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_divdd3</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fdivdd3-216"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_divtd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005fdivtd3-217"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_divtd3</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005fdivtd3-218"></a></var><br>
|
||||
<blockquote><p>These functions return the quotient of <var>a</var> and <var>b</var>; that is,
|
||||
<var>a</var> / <var>b</var><!-- /@w -->.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_negsd2</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005fnegsd2-219"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_negsd2</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005fnegsd2-220"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_negdd2</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005fnegdd2-221"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_negdd2</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005fnegdd2-222"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_negtd2</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005fnegtd2-223"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_negtd2</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005fnegtd2-224"></a></var><br>
|
||||
<blockquote><p>These functions return the negation of <var>a</var>. They simply flip the
|
||||
sign bit, so they can produce negative zero and negative NaN.
|
||||
</p></blockquote></div>
|
||||
|
||||
<h4 class="subsection">4.3.2 Conversion functions</h4>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal64 <b>__dpd_extendsddd2</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsddd2-225"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_extendsddd2</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsddd2-226"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_extendsdtd2</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsdtd2-227"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_extendsdtd2</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsdtd2-228"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_extendddtd2</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendddtd2-229"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_extendddtd2</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendddtd2-230"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__dpd_truncddsd2</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftruncddsd2-231"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_truncddsd2</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005ftruncddsd2-232"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__dpd_trunctdsd2</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctdsd2-233"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_trunctdsd2</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctdsd2-234"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_trunctddd2</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctddd2-235"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_trunctddd2</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctddd2-236"></a></var><br>
|
||||
<blockquote><p>These functions convert the value <var>a</var> from one decimal floating type
|
||||
to another.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal64 <b>__dpd_extendsfdd</b> (<var>float a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsfdd-237"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_extendsfdd</b> (<var>float a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsfdd-238"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_extendsftd</b> (<var>float a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsftd-239"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_extendsftd</b> (<var>float a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsftd-240"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_extenddftd</b> (<var>double a</var>)<var><a name="index-g_t_005f_005fdpd_005fextenddftd-241"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_extenddftd</b> (<var>double a</var>)<var><a name="index-g_t_005f_005fbid_005fextenddftd-242"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_extendxftd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendxftd-243"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_extendxftd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fbid_005fextendxftd-244"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__dpd_truncdfsd</b> (<var>double a</var>)<var><a name="index-g_t_005f_005fdpd_005ftruncdfsd-245"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_truncdfsd</b> (<var>double a</var>)<var><a name="index-g_t_005f_005fbid_005ftruncdfsd-246"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__dpd_truncxfsd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fdpd_005ftruncxfsd-247"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_truncxfsd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fbid_005ftruncxfsd-248"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__dpd_trunctfsd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctfsd-249"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_trunctfsd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctfsd-250"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_truncxfdd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fdpd_005ftruncxfdd-251"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_truncxfdd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fbid_005ftruncxfdd-252"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_trunctfdd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctfdd-253"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_trunctfdd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctfdd-254"></a></var><br>
|
||||
<blockquote><p>These functions convert the value of <var>a</var> from a binary floating type
|
||||
to a decimal floating type of a different size.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: float <b>__dpd_truncddsf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftruncddsf-255"></a></var><br>
|
||||
— Runtime Function: float <b>__bid_truncddsf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005ftruncddsf-256"></a></var><br>
|
||||
— Runtime Function: float <b>__dpd_trunctdsf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctdsf-257"></a></var><br>
|
||||
— Runtime Function: float <b>__bid_trunctdsf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctdsf-258"></a></var><br>
|
||||
— Runtime Function: double <b>__dpd_extendsddf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsddf-259"></a></var><br>
|
||||
— Runtime Function: double <b>__bid_extendsddf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsddf-260"></a></var><br>
|
||||
— Runtime Function: double <b>__dpd_trunctddf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctddf-261"></a></var><br>
|
||||
— Runtime Function: double <b>__bid_trunctddf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctddf-262"></a></var><br>
|
||||
— Runtime Function: long double <b>__dpd_extendsdxf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsdxf-263"></a></var><br>
|
||||
— Runtime Function: long double <b>__bid_extendsdxf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsdxf-264"></a></var><br>
|
||||
— Runtime Function: long double <b>__dpd_extendddxf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendddxf-265"></a></var><br>
|
||||
— Runtime Function: long double <b>__bid_extendddxf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendddxf-266"></a></var><br>
|
||||
— Runtime Function: long double <b>__dpd_trunctdxf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctdxf-267"></a></var><br>
|
||||
— Runtime Function: long double <b>__bid_trunctdxf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctdxf-268"></a></var><br>
|
||||
— Runtime Function: long double <b>__dpd_extendsdtf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsdtf-269"></a></var><br>
|
||||
— Runtime Function: long double <b>__bid_extendsdtf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsdtf-270"></a></var><br>
|
||||
— Runtime Function: long double <b>__dpd_extendddtf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendddtf-271"></a></var><br>
|
||||
— Runtime Function: long double <b>__bid_extendddtf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005fextendddtf-272"></a></var><br>
|
||||
<blockquote><p>These functions convert the value of <var>a</var> from a decimal floating type
|
||||
to a binary floating type of a different size.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_extendsfsd</b> (<var>float a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendsfsd-273"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_extendsfsd</b> (<var>float a</var>)<var><a name="index-g_t_005f_005fbid_005fextendsfsd-274"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_extenddfdd</b> (<var>double a</var>)<var><a name="index-g_t_005f_005fdpd_005fextenddfdd-275"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_extenddfdd</b> (<var>double a</var>)<var><a name="index-g_t_005f_005fbid_005fextenddfdd-276"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_extendtftd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fdpd_005fextendtftd-277"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_extendtftd</b> (<var>long double a</var>)<var><a name="index-g_t_005f_005fbid_005fextendtftd-278"></a></var><br>
|
||||
— Runtime Function: float <b>__dpd_truncsdsf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftruncsdsf-279"></a></var><br>
|
||||
— Runtime Function: float <b>__bid_truncsdsf</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005ftruncsdsf-280"></a></var><br>
|
||||
— Runtime Function: double <b>__dpd_truncdddf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftruncdddf-281"></a></var><br>
|
||||
— Runtime Function: double <b>__bid_truncdddf</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005ftruncdddf-282"></a></var><br>
|
||||
— Runtime Function: long double <b>__dpd_trunctdtf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ftrunctdtf-283"></a></var><br>
|
||||
— Runtime Function: long double <b>__bid_trunctdtf</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ftrunctdtf-284"></a></var><br>
|
||||
<blockquote><p>These functions convert the value of <var>a</var> between decimal and
|
||||
binary floating types of the same size.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_fixsdsi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixsdsi-285"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_fixsdsi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixsdsi-286"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_fixddsi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixddsi-287"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_fixddsi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixddsi-288"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_fixtdsi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixtdsi-289"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_fixtdsi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixtdsi-290"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>a</var> to a signed integer.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: long <b>__dpd_fixsddi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixsddi-291"></a></var><br>
|
||||
— Runtime Function: long <b>__bid_fixsddi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixsddi-292"></a></var><br>
|
||||
— Runtime Function: long <b>__dpd_fixdddi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixdddi-293"></a></var><br>
|
||||
— Runtime Function: long <b>__bid_fixdddi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixdddi-294"></a></var><br>
|
||||
— Runtime Function: long <b>__dpd_fixtddi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixtddi-295"></a></var><br>
|
||||
— Runtime Function: long <b>__bid_fixtddi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixtddi-296"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>a</var> to a signed long.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: unsigned int <b>__dpd_fixunssdsi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixunssdsi-297"></a></var><br>
|
||||
— Runtime Function: unsigned int <b>__bid_fixunssdsi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixunssdsi-298"></a></var><br>
|
||||
— Runtime Function: unsigned int <b>__dpd_fixunsddsi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixunsddsi-299"></a></var><br>
|
||||
— Runtime Function: unsigned int <b>__bid_fixunsddsi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixunsddsi-300"></a></var><br>
|
||||
— Runtime Function: unsigned int <b>__dpd_fixunstdsi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixunstdsi-301"></a></var><br>
|
||||
— Runtime Function: unsigned int <b>__bid_fixunstdsi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixunstdsi-302"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>a</var> to an unsigned integer. Negative values all become zero.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: unsigned long <b>__dpd_fixunssddi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixunssddi-303"></a></var><br>
|
||||
— Runtime Function: unsigned long <b>__bid_fixunssddi</b> (<var>_Decimal32 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixunssddi-304"></a></var><br>
|
||||
— Runtime Function: unsigned long <b>__dpd_fixunsdddi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixunsdddi-305"></a></var><br>
|
||||
— Runtime Function: unsigned long <b>__bid_fixunsdddi</b> (<var>_Decimal64 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixunsdddi-306"></a></var><br>
|
||||
— Runtime Function: unsigned long <b>__dpd_fixunstddi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fdpd_005ffixunstddi-307"></a></var><br>
|
||||
— Runtime Function: unsigned long <b>__bid_fixunstddi</b> (<var>_Decimal128 a</var>)<var><a name="index-g_t_005f_005fbid_005ffixunstddi-308"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>a</var> to an unsigned long. Negative values
|
||||
all become zero.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_floatsisd</b> (<var>int i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatsisd-309"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_floatsisd</b> (<var>int i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatsisd-310"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_floatsidd</b> (<var>int i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatsidd-311"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_floatsidd</b> (<var>int i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatsidd-312"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_floatsitd</b> (<var>int i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatsitd-313"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_floatsitd</b> (<var>int i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatsitd-314"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>i</var>, a signed integer, to decimal floating point.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_floatdisd</b> (<var>long i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatdisd-315"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_floatdisd</b> (<var>long i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatdisd-316"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_floatdidd</b> (<var>long i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatdidd-317"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_floatdidd</b> (<var>long i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatdidd-318"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_floatditd</b> (<var>long i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatditd-319"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_floatditd</b> (<var>long i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatditd-320"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>i</var>, a signed long, to decimal floating point.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_floatunssisd</b> (<var>unsigned int i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatunssisd-321"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_floatunssisd</b> (<var>unsigned int i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatunssisd-322"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_floatunssidd</b> (<var>unsigned int i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatunssidd-323"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_floatunssidd</b> (<var>unsigned int i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatunssidd-324"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_floatunssitd</b> (<var>unsigned int i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatunssitd-325"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_floatunssitd</b> (<var>unsigned int i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatunssitd-326"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>i</var>, an unsigned integer, to decimal floating point.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: _Decimal32 <b>__dpd_floatunsdisd</b> (<var>unsigned long i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatunsdisd-327"></a></var><br>
|
||||
— Runtime Function: _Decimal32 <b>__bid_floatunsdisd</b> (<var>unsigned long i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatunsdisd-328"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__dpd_floatunsdidd</b> (<var>unsigned long i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatunsdidd-329"></a></var><br>
|
||||
— Runtime Function: _Decimal64 <b>__bid_floatunsdidd</b> (<var>unsigned long i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatunsdidd-330"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__dpd_floatunsditd</b> (<var>unsigned long i</var>)<var><a name="index-g_t_005f_005fdpd_005ffloatunsditd-331"></a></var><br>
|
||||
— Runtime Function: _Decimal128 <b>__bid_floatunsditd</b> (<var>unsigned long i</var>)<var><a name="index-g_t_005f_005fbid_005ffloatunsditd-332"></a></var><br>
|
||||
<blockquote><p>These functions convert <var>i</var>, an unsigned long, to decimal floating point.
|
||||
</p></blockquote></div>
|
||||
|
||||
<h4 class="subsection">4.3.3 Comparison functions</h4>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_unordsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005funordsd2-333"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_unordsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005funordsd2-334"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_unorddd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005funorddd2-335"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_unorddd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005funorddd2-336"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_unordtd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005funordtd2-337"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_unordtd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005funordtd2-338"></a></var><br>
|
||||
<blockquote><p>These functions return a nonzero value if either argument is NaN, otherwise 0.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p>There is also a complete group of higher level functions which
|
||||
correspond directly to comparison operators. They implement the ISO C
|
||||
semantics for floating-point comparisons, taking NaN into account.
|
||||
Pay careful attention to the return values defined for each set.
|
||||
Under the hood, all of these routines are implemented as
|
||||
|
||||
<pre class="smallexample"> if (__bid_unord<var>X</var>d2 (a, b))
|
||||
return <var>E</var>;
|
||||
return __bid_cmp<var>X</var>d2 (a, b);
|
||||
</pre>
|
||||
<p class="noindent">where <var>E</var> is a constant chosen to give the proper behavior for
|
||||
NaN. Thus, the meaning of the return value is different for each set.
|
||||
Do not rely on this implementation; only the semantics documented
|
||||
below are guaranteed.
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_eqsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005feqsd2-339"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_eqsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005feqsd2-340"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_eqdd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005feqdd2-341"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_eqdd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005feqdd2-342"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_eqtd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005feqtd2-343"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_eqtd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005feqtd2-344"></a></var><br>
|
||||
<blockquote><p>These functions return zero if neither argument is NaN, and <var>a</var> and
|
||||
<var>b</var> are equal.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_nesd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005fnesd2-345"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_nesd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005fnesd2-346"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_nedd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fnedd2-347"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_nedd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fnedd2-348"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_netd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005fnetd2-349"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_netd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005fnetd2-350"></a></var><br>
|
||||
<blockquote><p>These functions return a nonzero value if either argument is NaN, or
|
||||
if <var>a</var> and <var>b</var> are unequal.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_gesd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005fgesd2-351"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_gesd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005fgesd2-352"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_gedd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fgedd2-353"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_gedd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fgedd2-354"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_getd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005fgetd2-355"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_getd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005fgetd2-356"></a></var><br>
|
||||
<blockquote><p>These functions return a value greater than or equal to zero if
|
||||
neither argument is NaN, and <var>a</var> is greater than or equal to
|
||||
<var>b</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_ltsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005fltsd2-357"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_ltsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005fltsd2-358"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_ltdd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fltdd2-359"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_ltdd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fltdd2-360"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_lttd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005flttd2-361"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_lttd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005flttd2-362"></a></var><br>
|
||||
<blockquote><p>These functions return a value less than zero if neither argument is
|
||||
NaN, and <var>a</var> is strictly less than <var>b</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_lesd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005flesd2-363"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_lesd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005flesd2-364"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_ledd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fledd2-365"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_ledd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fledd2-366"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_letd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005fletd2-367"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_letd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005fletd2-368"></a></var><br>
|
||||
<blockquote><p>These functions return a value less than or equal to zero if neither
|
||||
argument is NaN, and <var>a</var> is less than or equal to <var>b</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Runtime Function: int <b>__dpd_gtsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fdpd_005fgtsd2-369"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_gtsd2</b> (<var>_Decimal32 a, _Decimal32 b</var>)<var><a name="index-g_t_005f_005fbid_005fgtsd2-370"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_gtdd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fdpd_005fgtdd2-371"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_gtdd2</b> (<var>_Decimal64 a, _Decimal64 b</var>)<var><a name="index-g_t_005f_005fbid_005fgtdd2-372"></a></var><br>
|
||||
— Runtime Function: int <b>__dpd_gttd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fdpd_005fgttd2-373"></a></var><br>
|
||||
— Runtime Function: int <b>__bid_gttd2</b> (<var>_Decimal128 a, _Decimal128 b</var>)<var><a name="index-g_t_005f_005fbid_005fgttd2-374"></a></var><br>
|
||||
<blockquote><p>These functions return a value greater than zero if neither argument
|
||||
is NaN, and <var>a</var> is strictly greater than <var>b</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Declarations - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="GENERIC.html#GENERIC" title="GENERIC">
|
||||
<link rel="prev" href="Types.html#Types" title="Types">
|
||||
<link rel="next" href="Attributes.html#Attributes" title="Attributes">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Declarations"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Attributes.html#Attributes">Attributes</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Types.html#Types">Types</a>,
|
||||
Up: <a rel="up" accesskey="u" href="GENERIC.html#GENERIC">GENERIC</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">11.4 Declarations</h3>
|
||||
|
||||
<p><a name="index-declaration-2382"></a><a name="index-variable-2383"></a><a name="index-type-declaration-2384"></a><a name="index-LABEL_005fDECL-2385"></a><a name="index-CONST_005fDECL-2386"></a><a name="index-TYPE_005fDECL-2387"></a><a name="index-VAR_005fDECL-2388"></a><a name="index-PARM_005fDECL-2389"></a><a name="index-DEBUG_005fEXPR_005fDECL-2390"></a><a name="index-FIELD_005fDECL-2391"></a><a name="index-NAMESPACE_005fDECL-2392"></a><a name="index-RESULT_005fDECL-2393"></a><a name="index-TEMPLATE_005fDECL-2394"></a><a name="index-THUNK_005fDECL-2395"></a><a name="index-THUNK_005fDELTA-2396"></a><a name="index-DECL_005fINITIAL-2397"></a><a name="index-DECL_005fSIZE-2398"></a><a name="index-DECL_005fALIGN-2399"></a><a name="index-DECL_005fEXTERNAL-2400"></a>
|
||||
This section covers the various kinds of declarations that appear in the
|
||||
internal representation, except for declarations of functions
|
||||
(represented by <code>FUNCTION_DECL</code> nodes), which are described in
|
||||
<a href="Functions.html#Functions">Functions</a>.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Working-with-declarations.html#Working-with-declarations">Working with declarations</a>: Macros and functions that work on
|
||||
declarations.
|
||||
<li><a accesskey="2" href="Internal-structure.html#Internal-structure">Internal structure</a>: How declaration nodes are represented.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Deficiencies - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="GENERIC.html#GENERIC" title="GENERIC">
|
||||
<link rel="next" href="Tree-overview.html#Tree-overview" title="Tree overview">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Deficiencies"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Tree-overview.html#Tree-overview">Tree overview</a>,
|
||||
Up: <a rel="up" accesskey="u" href="GENERIC.html#GENERIC">GENERIC</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">11.1 Deficiencies</h3>
|
||||
|
||||
<p>There are many places in which this document is incomplet and incorrekt.
|
||||
It is, as of yet, only <em>preliminary</em> documentation.
|
||||
|
||||
<!-- -->
|
||||
<!-- Overview -->
|
||||
<!-- -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,204 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Define Constraints - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Constraints.html#Constraints" title="Constraints">
|
||||
<link rel="prev" href="Disable-Insn-Alternatives.html#Disable-Insn-Alternatives" title="Disable Insn Alternatives">
|
||||
<link rel="next" href="C-Constraint-Interface.html#C-Constraint-Interface" title="C Constraint Interface">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Define-Constraints"></a>
|
||||
Next: <a rel="next" accesskey="n" href="C-Constraint-Interface.html#C-Constraint-Interface">C Constraint Interface</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Disable-Insn-Alternatives.html#Disable-Insn-Alternatives">Disable Insn Alternatives</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Constraints.html#Constraints">Constraints</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.8.7 Defining Machine-Specific Constraints</h4>
|
||||
|
||||
<p><a name="index-defining-constraints-3317"></a><a name="index-constraints_002c-defining-3318"></a>
|
||||
Machine-specific constraints fall into two categories: register and
|
||||
non-register constraints. Within the latter category, constraints
|
||||
which allow subsets of all possible memory or address operands should
|
||||
be specially marked, to give <code>reload</code> more information.
|
||||
|
||||
<p>Machine-specific constraints can be given names of arbitrary length,
|
||||
but they must be entirely composed of letters, digits, underscores
|
||||
(‘<samp><span class="samp">_</span></samp>’), and angle brackets (‘<samp><span class="samp">< ></span></samp>’). Like C identifiers, they
|
||||
must begin with a letter or underscore.
|
||||
|
||||
<p>In order to avoid ambiguity in operand constraint strings, no
|
||||
constraint can have a name that begins with any other constraint's
|
||||
name. For example, if <code>x</code> is defined as a constraint name,
|
||||
<code>xy</code> may not be, and vice versa. As a consequence of this rule,
|
||||
no constraint may begin with one of the generic constraint letters:
|
||||
‘<samp><span class="samp">E F V X g i m n o p r s</span></samp>’.
|
||||
|
||||
<p>Register constraints correspond directly to register classes.
|
||||
See <a href="Register-Classes.html#Register-Classes">Register Classes</a>. There is thus not much flexibility in their
|
||||
definitions.
|
||||
|
||||
<div class="defun">
|
||||
— MD Expression: <b>define_register_constraint</b><var> name regclass docstring<a name="index-define_005fregister_005fconstraint-3319"></a></var><br>
|
||||
<blockquote><p>All three arguments are string constants.
|
||||
<var>name</var> is the name of the constraint, as it will appear in
|
||||
<code>match_operand</code> expressions. If <var>name</var> is a multi-letter
|
||||
constraint its length shall be the same for all constraints starting
|
||||
with the same letter. <var>regclass</var> can be either the
|
||||
name of the corresponding register class (see <a href="Register-Classes.html#Register-Classes">Register Classes</a>),
|
||||
or a C expression which evaluates to the appropriate register class.
|
||||
If it is an expression, it must have no side effects, and it cannot
|
||||
look at the operand. The usual use of expressions is to map some
|
||||
register constraints to <code>NO_REGS</code> when the register class
|
||||
is not available on a given subarchitecture.
|
||||
|
||||
<p><var>docstring</var> is a sentence documenting the meaning of the
|
||||
constraint. Docstrings are explained further below.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p>Non-register constraints are more like predicates: the constraint
|
||||
definition gives a Boolean expression which indicates whether the
|
||||
constraint matches.
|
||||
|
||||
<div class="defun">
|
||||
— MD Expression: <b>define_constraint</b><var> name docstring exp<a name="index-define_005fconstraint-3320"></a></var><br>
|
||||
<blockquote><p>The <var>name</var> and <var>docstring</var> arguments are the same as for
|
||||
<code>define_register_constraint</code>, but note that the docstring comes
|
||||
immediately after the name for these expressions. <var>exp</var> is an RTL
|
||||
expression, obeying the same rules as the RTL expressions in predicate
|
||||
definitions. See <a href="Defining-Predicates.html#Defining-Predicates">Defining Predicates</a>, for details. If it
|
||||
evaluates true, the constraint matches; if it evaluates false, it
|
||||
doesn't. Constraint expressions should indicate which RTL codes they
|
||||
might match, just like predicate expressions.
|
||||
|
||||
<p><code>match_test</code> C expressions have access to the
|
||||
following variables:
|
||||
|
||||
<dl>
|
||||
<dt><var>op</var><dd>The RTL object defining the operand.
|
||||
<br><dt><var>mode</var><dd>The machine mode of <var>op</var>.
|
||||
<br><dt><var>ival</var><dd>‘<samp><span class="samp">INTVAL (</span><var>op</var><span class="samp">)</span></samp>’, if <var>op</var> is a <code>const_int</code>.
|
||||
<br><dt><var>hval</var><dd>‘<samp><span class="samp">CONST_DOUBLE_HIGH (</span><var>op</var><span class="samp">)</span></samp>’, if <var>op</var> is an integer
|
||||
<code>const_double</code>.
|
||||
<br><dt><var>lval</var><dd>‘<samp><span class="samp">CONST_DOUBLE_LOW (</span><var>op</var><span class="samp">)</span></samp>’, if <var>op</var> is an integer
|
||||
<code>const_double</code>.
|
||||
<br><dt><var>rval</var><dd>‘<samp><span class="samp">CONST_DOUBLE_REAL_VALUE (</span><var>op</var><span class="samp">)</span></samp>’, if <var>op</var> is a floating-point
|
||||
<code>const_double</code>.
|
||||
</dl>
|
||||
|
||||
<p>The <var>*val</var> variables should only be used once another piece of the
|
||||
expression has verified that <var>op</var> is the appropriate kind of RTL
|
||||
object.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p>Most non-register constraints should be defined with
|
||||
<code>define_constraint</code>. The remaining two definition expressions
|
||||
are only appropriate for constraints that should be handled specially
|
||||
by <code>reload</code> if they fail to match.
|
||||
|
||||
<div class="defun">
|
||||
— MD Expression: <b>define_memory_constraint</b><var> name docstring exp<a name="index-define_005fmemory_005fconstraint-3321"></a></var><br>
|
||||
<blockquote><p>Use this expression for constraints that match a subset of all memory
|
||||
operands: that is, <code>reload</code> can make them match by converting the
|
||||
operand to the form ‘<samp><span class="samp">(mem (reg </span><var>X</var><span class="samp">))<!-- /@w --></span></samp>’, where <var>X</var> is a
|
||||
base register (from the register class specified by
|
||||
<code>BASE_REG_CLASS</code>, see <a href="Register-Classes.html#Register-Classes">Register Classes</a>).
|
||||
|
||||
<p>For example, on the S/390, some instructions do not accept arbitrary
|
||||
memory references, but only those that do not make use of an index
|
||||
register. The constraint letter ‘<samp><span class="samp">Q</span></samp>’ is defined to represent a
|
||||
memory address of this type. If ‘<samp><span class="samp">Q</span></samp>’ is defined with
|
||||
<code>define_memory_constraint</code>, a ‘<samp><span class="samp">Q</span></samp>’ constraint can handle any
|
||||
memory operand, because <code>reload</code> knows it can simply copy the
|
||||
memory address into a base register if required. This is analogous to
|
||||
the way an ‘<samp><span class="samp">o</span></samp>’ constraint can handle any memory operand.
|
||||
|
||||
<p>The syntax and semantics are otherwise identical to
|
||||
<code>define_constraint</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— MD Expression: <b>define_address_constraint</b><var> name docstring exp<a name="index-define_005faddress_005fconstraint-3322"></a></var><br>
|
||||
<blockquote><p>Use this expression for constraints that match a subset of all address
|
||||
operands: that is, <code>reload</code> can make the constraint match by
|
||||
converting the operand to the form ‘<samp><span class="samp">(reg </span><var>X</var><span class="samp">)<!-- /@w --></span></samp>’, again
|
||||
with <var>X</var> a base register.
|
||||
|
||||
<p>Constraints defined with <code>define_address_constraint</code> can only be
|
||||
used with the <code>address_operand</code> predicate, or machine-specific
|
||||
predicates that work the same way. They are treated analogously to
|
||||
the generic ‘<samp><span class="samp">p</span></samp>’ constraint.
|
||||
|
||||
<p>The syntax and semantics are otherwise identical to
|
||||
<code>define_constraint</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p>For historical reasons, names beginning with the letters ‘<samp><span class="samp">G H</span></samp>’
|
||||
are reserved for constraints that match only <code>const_double</code>s, and
|
||||
names beginning with the letters ‘<samp><span class="samp">I J K L M N O P</span></samp>’ are reserved
|
||||
for constraints that match only <code>const_int</code>s. This may change in
|
||||
the future. For the time being, constraints with these names must be
|
||||
written in a stylized form, so that <code>genpreds</code> can tell you did
|
||||
it correctly:
|
||||
|
||||
<pre class="smallexample"> (define_constraint "[<var>GHIJKLMNOP</var>]..."
|
||||
"<var>doc</var>..."
|
||||
(and (match_code "const_int") ; <code>const_double</code><span class="roman"> for G/H</span>
|
||||
<var>condition</var>...)) ; <span class="roman">usually a </span><code>match_test</code>
|
||||
</pre>
|
||||
<!-- the semicolons line up in the formatted manual -->
|
||||
<p>It is fine to use names beginning with other letters for constraints
|
||||
that match <code>const_double</code>s or <code>const_int</code>s.
|
||||
|
||||
<p>Each docstring in a constraint definition should be one or more complete
|
||||
sentences, marked up in Texinfo format. <em>They are currently unused.</em>
|
||||
In the future they will be copied into the GCC manual, in <a href="Machine-Constraints.html#Machine-Constraints">Machine Constraints</a>, replacing the hand-maintained tables currently found in
|
||||
that section. Also, in the future the compiler may use this to give
|
||||
more helpful diagnostics when poor choice of <code>asm</code> constraints
|
||||
causes a reload failure.
|
||||
|
||||
<p>If you put the pseudo-Texinfo directive ‘<samp><span class="samp">@internal</span></samp>’ at the
|
||||
beginning of a docstring, then (in the future) it will appear only in
|
||||
the internals manual's version of the machine-specific constraint tables.
|
||||
Use this for constraints that should not appear in <code>asm</code> statements.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Define Subst Example - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Define-Subst.html#Define-Subst" title="Define Subst">
|
||||
<link rel="next" href="Define-Subst-Pattern-Matching.html#Define-Subst-Pattern-Matching" title="Define Subst Pattern Matching">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Define-Subst-Example"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Define-Subst-Pattern-Matching.html#Define-Subst-Pattern-Matching">Define Subst Pattern Matching</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Define-Subst.html#Define-Subst">Define Subst</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.21.1 <code>define_subst</code> Example</h4>
|
||||
|
||||
<p><a name="index-define_005fsubst-3763"></a>
|
||||
To illustrate how <code>define_subst</code> works, let us examine a simple
|
||||
template transformation.
|
||||
|
||||
<p>Suppose there are two kinds of instructions: one that touches flags and
|
||||
the other that does not. The instructions of the second type could be
|
||||
generated with the following <code>define_subst</code>:
|
||||
|
||||
<pre class="smallexample"> (define_subst "add_clobber_subst"
|
||||
[(set (match_operand:SI 0 "" "")
|
||||
(match_operand:SI 1 "" ""))]
|
||||
""
|
||||
[(set (match_dup 0)
|
||||
(match_dup 1))
|
||||
(clobber (reg:CC FLAGS_REG))]
|
||||
</pre>
|
||||
<p>This <code>define_subst</code> can be applied to any RTL pattern containing
|
||||
<code>set</code> of mode SI and generates a copy with clobber when it is
|
||||
applied.
|
||||
|
||||
<p>Assume there is an RTL template for a <code>max</code> instruction to be used
|
||||
in <code>define_subst</code> mentioned above:
|
||||
|
||||
<pre class="smallexample"> (define_insn "maxsi"
|
||||
[(set (match_operand:SI 0 "register_operand" "=r")
|
||||
(max:SI
|
||||
(match_operand:SI 1 "register_operand" "r")
|
||||
(match_operand:SI 2 "register_operand" "r")))]
|
||||
""
|
||||
"max\t{%2, %1, %0|%0, %1, %2}"
|
||||
[...])
|
||||
</pre>
|
||||
<p>To mark the RTL template for <code>define_subst</code> application,
|
||||
subst-attributes are used. They should be declared in advance:
|
||||
|
||||
<pre class="smallexample"> (define_subst_attr "add_clobber_name" "add_clobber_subst" "_noclobber" "_clobber")
|
||||
</pre>
|
||||
<p>Here ‘<samp><span class="samp">add_clobber_name</span></samp>’ is the attribute name,
|
||||
‘<samp><span class="samp">add_clobber_subst</span></samp>’ is the name of the corresponding
|
||||
<code>define_subst</code>, the third argument (‘<samp><span class="samp">_noclobber</span></samp>’) is the
|
||||
attribute value that would be substituted into the unchanged version of
|
||||
the source RTL template, and the last argument (‘<samp><span class="samp">_clobber</span></samp>’) is the
|
||||
value that would be substituted into the second, transformed,
|
||||
version of the RTL template.
|
||||
|
||||
<p>Once the subst-attribute has been defined, it should be used in RTL
|
||||
templates which need to be processed by the <code>define_subst</code>. So,
|
||||
the original RTL template should be changed:
|
||||
|
||||
<pre class="smallexample"> (define_insn "maxsi<add_clobber_name>"
|
||||
[(set (match_operand:SI 0 "register_operand" "=r")
|
||||
(max:SI
|
||||
(match_operand:SI 1 "register_operand" "r")
|
||||
(match_operand:SI 2 "register_operand" "r")))]
|
||||
""
|
||||
"max\t{%2, %1, %0|%0, %1, %2}"
|
||||
[...])
|
||||
</pre>
|
||||
<p>The result of the <code>define_subst</code> usage would look like the following:
|
||||
|
||||
<pre class="smallexample"> (define_insn "maxsi_noclobber"
|
||||
[(set (match_operand:SI 0 "register_operand" "=r")
|
||||
(max:SI
|
||||
(match_operand:SI 1 "register_operand" "r")
|
||||
(match_operand:SI 2 "register_operand" "r")))]
|
||||
""
|
||||
"max\t{%2, %1, %0|%0, %1, %2}"
|
||||
[...])
|
||||
(define_insn "maxsi_clobber"
|
||||
[(set (match_operand:SI 0 "register_operand" "=r")
|
||||
(max:SI
|
||||
(match_operand:SI 1 "register_operand" "r")
|
||||
(match_operand:SI 2 "register_operand" "r")))
|
||||
(clobber (reg:CC FLAGS_REG))]
|
||||
""
|
||||
"max\t{%2, %1, %0|%0, %1, %2}"
|
||||
[...])
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Define Subst Output Template - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Define-Subst.html#Define-Subst" title="Define Subst">
|
||||
<link rel="prev" href="Define-Subst-Pattern-Matching.html#Define-Subst-Pattern-Matching" title="Define Subst Pattern Matching">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Define-Subst-Output-Template"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Define-Subst-Pattern-Matching.html#Define-Subst-Pattern-Matching">Define Subst Pattern Matching</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Define-Subst.html#Define-Subst">Define Subst</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.21.3 Generation of output template in <code>define_subst</code></h4>
|
||||
|
||||
<p><a name="index-define_005fsubst-3765"></a>
|
||||
If all necessary checks for <code>define_subst</code> application pass, a new
|
||||
RTL-pattern, based on the output-template, is created to replace the old
|
||||
template. Like in input-patterns, meanings of some RTL expressions are
|
||||
changed when they are used in output-patterns of a <code>define_subst</code>.
|
||||
Thus, <code>match_dup</code> is used for copying the whole expression from the
|
||||
original pattern, which matched corresponding <code>match_operand</code> from
|
||||
the input pattern.
|
||||
|
||||
<p><code>match_dup N</code> is used in the output template to be replaced with
|
||||
the expression from the original pattern, which matched
|
||||
<code>match_operand N</code> from the input pattern. As a consequence,
|
||||
<code>match_dup</code> cannot be used to point to <code>match_operand</code>s from
|
||||
the output pattern, it should always refer to a <code>match_operand</code>
|
||||
from the input pattern.
|
||||
|
||||
<p>In the output template one can refer to the expressions from the
|
||||
original pattern and create new ones. For instance, some operands could
|
||||
be added by means of standard <code>match_operand</code>.
|
||||
|
||||
<p>After replacing <code>match_dup</code> with some RTL-subtree from the original
|
||||
pattern, it could happen that several <code>match_operand</code>s in the
|
||||
output pattern have the same indexes. It is unknown, how many and what
|
||||
indexes would be used in the expression which would replace
|
||||
<code>match_dup</code>, so such conflicts in indexes are inevitable. To
|
||||
overcome this issue, <code>match_operands</code> and <code>match_operators</code>,
|
||||
which were introduced into the output pattern, are renumerated when all
|
||||
<code>match_dup</code>s are replaced.
|
||||
|
||||
<p>Number of alternatives in <code>match_operand</code>s introduced into the
|
||||
output template <code>M</code> could differ from the number of alternatives in
|
||||
the original pattern <code>N</code>, so in the resultant pattern there would
|
||||
be <code>N*M</code> alternatives. Thus, constraints from the original pattern
|
||||
would be duplicated <code>N</code> times, constraints from the output pattern
|
||||
would be duplicated <code>M</code> times, producing all possible combinations.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Define Subst Pattern Matching - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Define-Subst.html#Define-Subst" title="Define Subst">
|
||||
<link rel="prev" href="Define-Subst-Example.html#Define-Subst-Example" title="Define Subst Example">
|
||||
<link rel="next" href="Define-Subst-Output-Template.html#Define-Subst-Output-Template" title="Define Subst Output Template">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Define-Subst-Pattern-Matching"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Define-Subst-Output-Template.html#Define-Subst-Output-Template">Define Subst Output Template</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Define-Subst-Example.html#Define-Subst-Example">Define Subst Example</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Define-Subst.html#Define-Subst">Define Subst</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.21.2 Pattern Matching in <code>define_subst</code></h4>
|
||||
|
||||
<p><a name="index-define_005fsubst-3764"></a>
|
||||
All expressions, allowed in <code>define_insn</code> or <code>define_expand</code>,
|
||||
are allowed in the input-template of <code>define_subst</code>, except
|
||||
<code>match_par_dup</code>, <code>match_scratch</code>, <code>match_parallel</code>. The
|
||||
meanings of expressions in the input-template were changed:
|
||||
|
||||
<p><code>match_operand</code> matches any expression (possibly, a subtree in
|
||||
RTL-template), if modes of the <code>match_operand</code> and this expression
|
||||
are the same, or mode of the <code>match_operand</code> is <code>VOIDmode</code>, or
|
||||
this expression is <code>match_dup</code>, <code>match_op_dup</code>. If the
|
||||
expression is <code>match_operand</code> too, and predicate of
|
||||
<code>match_operand</code> from the input pattern is not empty, then the
|
||||
predicates are compared. That can be used for more accurate filtering
|
||||
of accepted RTL-templates.
|
||||
|
||||
<p><code>match_operator</code> matches common operators (like <code>plus</code>,
|
||||
<code>minus</code>), <code>unspec</code>, <code>unspec_volatile</code> operators and
|
||||
<code>match_operator</code>s from the original pattern if the modes match and
|
||||
<code>match_operator</code> from the input pattern has the same number of
|
||||
operands as the operator from the original pattern.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Define Subst - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Machine-Desc.html#Machine-Desc" title="Machine Desc">
|
||||
<link rel="prev" href="Conditional-Execution.html#Conditional-Execution" title="Conditional Execution">
|
||||
<link rel="next" href="Constant-Definitions.html#Constant-Definitions" title="Constant Definitions">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Define-Subst"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Constant-Definitions.html#Constant-Definitions">Constant Definitions</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Conditional-Execution.html#Conditional-Execution">Conditional Execution</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Machine-Desc.html#Machine-Desc">Machine Desc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">16.21 RTL Templates Transformations</h3>
|
||||
|
||||
<p><a name="index-define_005fsubst-3761"></a>
|
||||
For some hardware architectures there are common cases when the RTL
|
||||
templates for the instructions can be derived from the other RTL
|
||||
templates using simple transformations. E.g., <samp><span class="file">i386.md</span></samp> contains
|
||||
an RTL template for the ordinary <code>sub</code> instruction—
|
||||
<code>*subsi_1</code>, and for the <code>sub</code> instruction with subsequent
|
||||
zero-extension—<code>*subsi_1_zext</code>. Such cases can be easily
|
||||
implemented by a single meta-template capable of generating a modified
|
||||
case based on the initial one:
|
||||
|
||||
<p><a name="index-define_005fsubst-3762"></a>
|
||||
<pre class="smallexample"> (define_subst "<var>name</var>"
|
||||
[<var>input-template</var>]
|
||||
"<var>condition</var>"
|
||||
[<var>output-template</var>])
|
||||
</pre>
|
||||
<p><var>input-template</var> is a pattern describing the source RTL template,
|
||||
which will be transformed.
|
||||
|
||||
<p><var>condition</var> is a C expression that is conjunct with the condition
|
||||
from the input-template to generate a condition to be used in the
|
||||
output-template.
|
||||
|
||||
<p><var>output-template</var> is a pattern that will be used in the resulting
|
||||
template.
|
||||
|
||||
<p><code>define_subst</code> mechanism is tightly coupled with the notion of the
|
||||
subst attribute (see <a href="Subst-Iterators.html#Subst-Iterators">Subst Iterators</a>). The use of
|
||||
<code>define_subst</code> is triggered by a reference to a subst attribute in
|
||||
the transforming RTL template. This reference initiates duplication of
|
||||
the source RTL template and substitution of the attributes with their
|
||||
values. The source RTL template is left unchanged, while the copy is
|
||||
transformed by <code>define_subst</code>. This transformation can fail in the
|
||||
case when the source RTL template is not matched against the
|
||||
input-template of the <code>define_subst</code>. In such case the copy is
|
||||
deleted.
|
||||
|
||||
<p><code>define_subst</code> can be used only in <code>define_insn</code> and
|
||||
<code>define_expand</code>, it cannot be used in other expressions (e.g. in
|
||||
<code>define_insn_and_split</code>).
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Define-Subst-Example.html#Define-Subst-Example">Define Subst Example</a>: Example of <code>define_subst</code> work.
|
||||
<li><a accesskey="2" href="Define-Subst-Pattern-Matching.html#Define-Subst-Pattern-Matching">Define Subst Pattern Matching</a>: Process of template comparison.
|
||||
<li><a accesskey="3" href="Define-Subst-Output-Template.html#Define-Subst-Output-Template">Define Subst Output Template</a>: Generation of output template.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Defining Attributes - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Insn-Attributes.html#Insn-Attributes" title="Insn Attributes">
|
||||
<link rel="next" href="Expressions.html#Expressions" title="Expressions">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Defining-Attributes"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Expressions.html#Expressions">Expressions</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.19.1 Defining Attributes and their Values</h4>
|
||||
|
||||
<p><a name="index-defining-attributes-and-their-values-3660"></a><a name="index-attributes_002c-defining-3661"></a>
|
||||
<a name="index-define_005fattr-3662"></a>The <code>define_attr</code> expression is used to define each attribute required
|
||||
by the target machine. It looks like:
|
||||
|
||||
<pre class="smallexample"> (define_attr <var>name</var> <var>list-of-values</var> <var>default</var>)
|
||||
</pre>
|
||||
<p><var>name</var> is a string specifying the name of the attribute being defined.
|
||||
Some attributes are used in a special way by the rest of the compiler. The
|
||||
<code>enabled</code> attribute can be used to conditionally enable or disable
|
||||
insn alternatives (see <a href="Disable-Insn-Alternatives.html#Disable-Insn-Alternatives">Disable Insn Alternatives</a>). The <code>predicable</code>
|
||||
attribute, together with a suitable <code>define_cond_exec</code>
|
||||
(see <a href="Conditional-Execution.html#Conditional-Execution">Conditional Execution</a>), can be used to automatically generate
|
||||
conditional variants of instruction patterns. The compiler internally uses
|
||||
the names <code>ce_enabled</code> and <code>nonce_enabled</code>, so they should not be
|
||||
used elsewhere as alternative names.
|
||||
|
||||
<p><var>list-of-values</var> is either a string that specifies a comma-separated
|
||||
list of values that can be assigned to the attribute, or a null string to
|
||||
indicate that the attribute takes numeric values.
|
||||
|
||||
<p><var>default</var> is an attribute expression that gives the value of this
|
||||
attribute for insns that match patterns whose definition does not include
|
||||
an explicit value for this attribute. See <a href="Attr-Example.html#Attr-Example">Attr Example</a>, for more
|
||||
information on the handling of defaults. See <a href="Constant-Attributes.html#Constant-Attributes">Constant Attributes</a>,
|
||||
for information on attributes that do not depend on any particular insn.
|
||||
|
||||
<p><a name="index-insn_002dattr_002eh-3663"></a>For each defined attribute, a number of definitions are written to the
|
||||
<samp><span class="file">insn-attr.h</span></samp> file. For cases where an explicit set of values is
|
||||
specified for an attribute, the following are defined:
|
||||
|
||||
<ul>
|
||||
<li>A ‘<samp><span class="samp">#define</span></samp>’ is written for the symbol ‘<samp><span class="samp">HAVE_ATTR_</span><var>name</var></samp>’.
|
||||
|
||||
<li>An enumerated class is defined for ‘<samp><span class="samp">attr_</span><var>name</var></samp>’ with
|
||||
elements of the form ‘<samp><var>upper-name</var><span class="samp">_</span><var>upper-value</var></samp>’ where
|
||||
the attribute name and value are first converted to uppercase.
|
||||
|
||||
<li>A function ‘<samp><span class="samp">get_attr_</span><var>name</var></samp>’ is defined that is passed an insn and
|
||||
returns the attribute value for that insn.
|
||||
</ul>
|
||||
|
||||
<p>For example, if the following is present in the <samp><span class="file">md</span></samp> file:
|
||||
|
||||
<pre class="smallexample"> (define_attr "type" "branch,fp,load,store,arith" ...)
|
||||
</pre>
|
||||
<p class="noindent">the following lines will be written to the file <samp><span class="file">insn-attr.h</span></samp>.
|
||||
|
||||
<pre class="smallexample"> #define HAVE_ATTR_type 1
|
||||
enum attr_type {TYPE_BRANCH, TYPE_FP, TYPE_LOAD,
|
||||
TYPE_STORE, TYPE_ARITH};
|
||||
extern enum attr_type get_attr_type ();
|
||||
</pre>
|
||||
<p>If the attribute takes numeric values, no <code>enum</code> type will be
|
||||
defined and the function to obtain the attribute's value will return
|
||||
<code>int</code>.
|
||||
|
||||
<p>There are attributes which are tied to a specific meaning. These
|
||||
attributes are not free to use for other purposes:
|
||||
|
||||
<dl>
|
||||
<dt><code>length</code><dd>The <code>length</code> attribute is used to calculate the length of emitted
|
||||
code chunks. This is especially important when verifying branch
|
||||
distances. See <a href="Insn-Lengths.html#Insn-Lengths">Insn Lengths</a>.
|
||||
|
||||
<br><dt><code>enabled</code><dd>The <code>enabled</code> attribute can be defined to prevent certain
|
||||
alternatives of an insn definition from being used during code
|
||||
generation. See <a href="Disable-Insn-Alternatives.html#Disable-Insn-Alternatives">Disable Insn Alternatives</a>.
|
||||
</dl>
|
||||
|
||||
<p>For each of these special attributes, the corresponding
|
||||
‘<samp><span class="samp">HAVE_ATTR_</span><var>name</var></samp>’ ‘<samp><span class="samp">#define</span></samp>’ is also written when the
|
||||
attribute is not defined; in that case, it is defined as ‘<samp><span class="samp">0</span></samp>’.
|
||||
|
||||
<p><a name="index-define_005fenum_005fattr-3664"></a><a name="define_005fenum_005fattr"></a>Another way of defining an attribute is to use:
|
||||
|
||||
<pre class="smallexample"> (define_enum_attr "<var>attr</var>" "<var>enum</var>" <var>default</var>)
|
||||
</pre>
|
||||
<p>This works in just the same way as <code>define_attr</code>, except that
|
||||
the list of values is taken from a separate enumeration called
|
||||
<var>enum</var> (see <a href="define_005fenum.html#define_005fenum">define_enum</a>). This form allows you to use
|
||||
the same list of values for several attributes without having to
|
||||
repeat the list each time. For example:
|
||||
|
||||
<pre class="smallexample"> (define_enum "processor" [
|
||||
model_a
|
||||
model_b
|
||||
...
|
||||
])
|
||||
(define_enum_attr "arch" "processor"
|
||||
(const (symbol_ref "target_arch")))
|
||||
(define_enum_attr "tune" "processor"
|
||||
(const (symbol_ref "target_tune")))
|
||||
</pre>
|
||||
<p>defines the same attributes as:
|
||||
|
||||
<pre class="smallexample"> (define_attr "arch" "model_a,model_b,..."
|
||||
(const (symbol_ref "target_arch")))
|
||||
(define_attr "tune" "model_a,model_b,..."
|
||||
(const (symbol_ref "target_tune")))
|
||||
</pre>
|
||||
<p>but without duplicating the processor list. The second example defines two
|
||||
separate C enums (<code>attr_arch</code> and <code>attr_tune</code>) whereas the first
|
||||
defines a single C enum (<code>processor</code>).
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Defining Mode Iterators - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Mode-Iterators.html#Mode-Iterators" title="Mode Iterators">
|
||||
<link rel="next" href="Substitutions.html#Substitutions" title="Substitutions">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Defining-Mode-Iterators"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Substitutions.html#Substitutions">Substitutions</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Mode-Iterators.html#Mode-Iterators">Mode Iterators</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h5 class="subsubsection">16.23.1.1 Defining Mode Iterators</h5>
|
||||
|
||||
<p><a name="index-define_005fmode_005fiterator-3776"></a>
|
||||
The syntax for defining a mode iterator is:
|
||||
|
||||
<pre class="smallexample"> (define_mode_iterator <var>name</var> [(<var>mode1</var> "<var>cond1</var>") ... (<var>moden</var> "<var>condn</var>")])
|
||||
</pre>
|
||||
<p>This allows subsequent <samp><span class="file">.md</span></samp> file constructs to use the mode suffix
|
||||
<code>:</code><var>name</var>. Every construct that does so will be expanded
|
||||
<var>n</var> times, once with every use of <code>:</code><var>name</var> replaced by
|
||||
<code>:</code><var>mode1</var>, once with every use replaced by <code>:</code><var>mode2</var>,
|
||||
and so on. In the expansion for a particular <var>modei</var>, every
|
||||
C condition will also require that <var>condi</var> be true.
|
||||
|
||||
<p>For example:
|
||||
|
||||
<pre class="smallexample"> (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
|
||||
</pre>
|
||||
<p>defines a new mode suffix <code>:P</code>. Every construct that uses
|
||||
<code>:P</code> will be expanded twice, once with every <code>:P</code> replaced
|
||||
by <code>:SI</code> and once with every <code>:P</code> replaced by <code>:DI</code>.
|
||||
The <code>:SI</code> version will only apply if <code>Pmode == SImode</code> and
|
||||
the <code>:DI</code> version will only apply if <code>Pmode == DImode</code>.
|
||||
|
||||
<p>As with other <samp><span class="file">.md</span></samp> conditions, an empty string is treated
|
||||
as “always true”. <code>(</code><var>mode</var><code> "")</code> can also be abbreviated
|
||||
to <var>mode</var>. For example:
|
||||
|
||||
<pre class="smallexample"> (define_mode_iterator GPR [SI (DI "TARGET_64BIT")])
|
||||
</pre>
|
||||
<p>means that the <code>:DI</code> expansion only applies if <code>TARGET_64BIT</code>
|
||||
but that the <code>:SI</code> expansion has no such constraint.
|
||||
|
||||
<p>Iterators are applied in the order they are defined. This can be
|
||||
significant if two iterators are used in a construct that requires
|
||||
substitutions. See <a href="Substitutions.html#Substitutions">Substitutions</a>.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Defining Predicates - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Predicates.html#Predicates" title="Predicates">
|
||||
<link rel="prev" href="Machine_002dIndependent-Predicates.html#Machine_002dIndependent-Predicates" title="Machine-Independent Predicates">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Defining-Predicates"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Machine_002dIndependent-Predicates.html#Machine_002dIndependent-Predicates">Machine-Independent Predicates</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Predicates.html#Predicates">Predicates</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.7.2 Defining Machine-Specific Predicates</h4>
|
||||
|
||||
<p><a name="index-defining-predicates-3257"></a><a name="index-define_005fpredicate-3258"></a><a name="index-define_005fspecial_005fpredicate-3259"></a>
|
||||
Many machines have requirements for their operands that cannot be
|
||||
expressed precisely using the generic predicates. You can define
|
||||
additional predicates using <code>define_predicate</code> and
|
||||
<code>define_special_predicate</code> expressions. These expressions have
|
||||
three operands:
|
||||
|
||||
<ul>
|
||||
<li>The name of the predicate, as it will be referred to in
|
||||
<code>match_operand</code> or <code>match_operator</code> expressions.
|
||||
|
||||
<li>An RTL expression which evaluates to true if the predicate allows the
|
||||
operand <var>op</var>, false if it does not. This expression can only use
|
||||
the following RTL codes:
|
||||
|
||||
<dl>
|
||||
<dt><code>MATCH_OPERAND</code><dd>When written inside a predicate expression, a <code>MATCH_OPERAND</code>
|
||||
expression evaluates to true if the predicate it names would allow
|
||||
<var>op</var>. The operand number and constraint are ignored. Due to
|
||||
limitations in <samp><span class="command">genrecog</span></samp>, you can only refer to generic
|
||||
predicates and predicates that have already been defined.
|
||||
|
||||
<br><dt><code>MATCH_CODE</code><dd>This expression evaluates to true if <var>op</var> or a specified
|
||||
subexpression of <var>op</var> has one of a given list of RTX codes.
|
||||
|
||||
<p>The first operand of this expression is a string constant containing a
|
||||
comma-separated list of RTX code names (in lower case). These are the
|
||||
codes for which the <code>MATCH_CODE</code> will be true.
|
||||
|
||||
<p>The second operand is a string constant which indicates what
|
||||
subexpression of <var>op</var> to examine. If it is absent or the empty
|
||||
string, <var>op</var> itself is examined. Otherwise, the string constant
|
||||
must be a sequence of digits and/or lowercase letters. Each character
|
||||
indicates a subexpression to extract from the current expression; for
|
||||
the first character this is <var>op</var>, for the second and subsequent
|
||||
characters it is the result of the previous character. A digit
|
||||
<var>n</var> extracts ‘<samp><span class="samp">XEXP (</span><var>e</var><span class="samp">, </span><var>n</var><span class="samp">)<!-- /@w --></span></samp>’; a letter <var>l</var>
|
||||
extracts ‘<samp><span class="samp">XVECEXP (</span><var>e</var><span class="samp">, 0, </span><var>n</var><span class="samp">)<!-- /@w --></span></samp>’ where <var>n</var> is the
|
||||
alphabetic ordinal of <var>l</var> (0 for `a', 1 for 'b', and so on). The
|
||||
<code>MATCH_CODE</code> then examines the RTX code of the subexpression
|
||||
extracted by the complete string. It is not possible to extract
|
||||
components of an <code>rtvec</code> that is not at position 0 within its RTX
|
||||
object.
|
||||
|
||||
<br><dt><code>MATCH_TEST</code><dd>This expression has one operand, a string constant containing a C
|
||||
expression. The predicate's arguments, <var>op</var> and <var>mode</var>, are
|
||||
available with those names in the C expression. The <code>MATCH_TEST</code>
|
||||
evaluates to true if the C expression evaluates to a nonzero value.
|
||||
<code>MATCH_TEST</code> expressions must not have side effects.
|
||||
|
||||
<br><dt><code>AND</code><dt><code>IOR</code><dt><code>NOT</code><dt><code>IF_THEN_ELSE</code><dd>The basic ‘<samp><span class="samp">MATCH_</span></samp>’ expressions can be combined using these
|
||||
logical operators, which have the semantics of the C operators
|
||||
‘<samp><span class="samp">&&</span></samp>’, ‘<samp><span class="samp">||</span></samp>’, ‘<samp><span class="samp">!</span></samp>’, and ‘<samp><span class="samp">? :<!-- /@w --></span></samp>’ respectively. As
|
||||
in Common Lisp, you may give an <code>AND</code> or <code>IOR</code> expression an
|
||||
arbitrary number of arguments; this has exactly the same effect as
|
||||
writing a chain of two-argument <code>AND</code> or <code>IOR</code> expressions.
|
||||
</dl>
|
||||
|
||||
<li>An optional block of C code, which should execute
|
||||
‘<samp><span class="samp">return true<!-- /@w --></span></samp>’ if the predicate is found to match and
|
||||
‘<samp><span class="samp">return false<!-- /@w --></span></samp>’ if it does not. It must not have any side
|
||||
effects. The predicate arguments, <var>op</var> and <var>mode</var>, are
|
||||
available with those names.
|
||||
|
||||
<p>If a code block is present in a predicate definition, then the RTL
|
||||
expression must evaluate to true <em>and</em> the code block must
|
||||
execute ‘<samp><span class="samp">return true<!-- /@w --></span></samp>’ for the predicate to allow the operand.
|
||||
The RTL expression is evaluated first; do not re-check anything in the
|
||||
code block that was checked in the RTL expression.
|
||||
</ul>
|
||||
|
||||
<p>The program <samp><span class="command">genrecog</span></samp> scans <code>define_predicate</code> and
|
||||
<code>define_special_predicate</code> expressions to determine which RTX
|
||||
codes are possibly allowed. You should always make this explicit in
|
||||
the RTL predicate expression, using <code>MATCH_OPERAND</code> and
|
||||
<code>MATCH_CODE</code>.
|
||||
|
||||
<p>Here is an example of a simple predicate definition, from the IA64
|
||||
machine description:
|
||||
|
||||
<pre class="smallexample"> ;; <span class="roman">True if </span><var>op</var><span class="roman"> is a </span><code>SYMBOL_REF</code><span class="roman"> which refers to the sdata section.</span>
|
||||
(define_predicate "small_addr_symbolic_operand"
|
||||
(and (match_code "symbol_ref")
|
||||
(match_test "SYMBOL_REF_SMALL_ADDR_P (op)")))
|
||||
</pre>
|
||||
<p class="noindent">And here is another, showing the use of the C block.
|
||||
|
||||
<pre class="smallexample"> ;; <span class="roman">True if </span><var>op</var><span class="roman"> is a register operand that is (or could be) a GR reg.</span>
|
||||
(define_predicate "gr_register_operand"
|
||||
(match_operand 0 "register_operand")
|
||||
{
|
||||
unsigned int regno;
|
||||
if (GET_CODE (op) == SUBREG)
|
||||
op = SUBREG_REG (op);
|
||||
|
||||
regno = REGNO (op);
|
||||
return (regno >= FIRST_PSEUDO_REGISTER || GENERAL_REGNO_P (regno));
|
||||
})
|
||||
</pre>
|
||||
<p>Predicates written with <code>define_predicate</code> automatically include
|
||||
a test that <var>mode</var> is <code>VOIDmode</code>, or <var>op</var> has the same
|
||||
mode as <var>mode</var>, or <var>op</var> is a <code>CONST_INT</code> or
|
||||
<code>CONST_DOUBLE</code>. They do <em>not</em> check specifically for
|
||||
integer <code>CONST_DOUBLE</code>, nor do they test that the value of either
|
||||
kind of constant fits in the requested mode. This is because
|
||||
target-specific predicates that take constants usually have to do more
|
||||
stringent value checks anyway. If you need the exact same treatment
|
||||
of <code>CONST_INT</code> or <code>CONST_DOUBLE</code> that the generic predicates
|
||||
provide, use a <code>MATCH_OPERAND</code> subexpression to call
|
||||
<code>const_int_operand</code>, <code>const_double_operand</code>, or
|
||||
<code>immediate_operand</code>.
|
||||
|
||||
<p>Predicates written with <code>define_special_predicate</code> do not get any
|
||||
automatic mode checks, and are treated as having special mode handling
|
||||
by <samp><span class="command">genrecog</span></samp>.
|
||||
|
||||
<p>The program <samp><span class="command">genpreds</span></samp> is responsible for generating code to
|
||||
test predicates. It also writes a header file containing function
|
||||
declarations for all machine-specific predicates. It is not necessary
|
||||
to declare these predicates in <samp><var>cpu</var><span class="file">-protos.h</span></samp>.
|
||||
|
||||
<!-- Most of this node appears by itself (in a different place) even -->
|
||||
<!-- when the INTERNALS flag is clear. Passages that require the internals -->
|
||||
<!-- manual's context are conditionalized to appear only in the internals manual. -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Delay Slots - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Insn-Attributes.html#Insn-Attributes" title="Insn Attributes">
|
||||
<link rel="prev" href="Constant-Attributes.html#Constant-Attributes" title="Constant Attributes">
|
||||
<link rel="next" href="Processor-pipeline-description.html#Processor-pipeline-description" title="Processor pipeline description">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Delay-Slots"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Processor-pipeline-description.html#Processor-pipeline-description">Processor pipeline description</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Constant-Attributes.html#Constant-Attributes">Constant Attributes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.19.7 Delay Slot Scheduling</h4>
|
||||
|
||||
<p><a name="index-delay-slots_002c-defining-3716"></a>
|
||||
The insn attribute mechanism can be used to specify the requirements for
|
||||
delay slots, if any, on a target machine. An instruction is said to
|
||||
require a <dfn>delay slot</dfn> if some instructions that are physically
|
||||
after the instruction are executed as if they were located before it.
|
||||
Classic examples are branch and call instructions, which often execute
|
||||
the following instruction before the branch or call is performed.
|
||||
|
||||
<p>On some machines, conditional branch instructions can optionally
|
||||
<dfn>annul</dfn> instructions in the delay slot. This means that the
|
||||
instruction will not be executed for certain branch outcomes. Both
|
||||
instructions that annul if the branch is true and instructions that
|
||||
annul if the branch is false are supported.
|
||||
|
||||
<p>Delay slot scheduling differs from instruction scheduling in that
|
||||
determining whether an instruction needs a delay slot is dependent only
|
||||
on the type of instruction being generated, not on data flow between the
|
||||
instructions. See the next section for a discussion of data-dependent
|
||||
instruction scheduling.
|
||||
|
||||
<p><a name="index-define_005fdelay-3717"></a>The requirement of an insn needing one or more delay slots is indicated
|
||||
via the <code>define_delay</code> expression. It has the following form:
|
||||
|
||||
<pre class="smallexample"> (define_delay <var>test</var>
|
||||
[<var>delay-1</var> <var>annul-true-1</var> <var>annul-false-1</var>
|
||||
<var>delay-2</var> <var>annul-true-2</var> <var>annul-false-2</var>
|
||||
...])
|
||||
</pre>
|
||||
<p><var>test</var> is an attribute test that indicates whether this
|
||||
<code>define_delay</code> applies to a particular insn. If so, the number of
|
||||
required delay slots is determined by the length of the vector specified
|
||||
as the second argument. An insn placed in delay slot <var>n</var> must
|
||||
satisfy attribute test <var>delay-n</var>. <var>annul-true-n</var> is an
|
||||
attribute test that specifies which insns may be annulled if the branch
|
||||
is true. Similarly, <var>annul-false-n</var> specifies which insns in the
|
||||
delay slot may be annulled if the branch is false. If annulling is not
|
||||
supported for that delay slot, <code>(nil)</code> should be coded.
|
||||
|
||||
<p>For example, in the common case where branch and call insns require
|
||||
a single delay slot, which may contain any insn other than a branch or
|
||||
call, the following would be placed in the <samp><span class="file">md</span></samp> file:
|
||||
|
||||
<pre class="smallexample"> (define_delay (eq_attr "type" "branch,call")
|
||||
[(eq_attr "type" "!branch,call") (nil) (nil)])
|
||||
</pre>
|
||||
<p>Multiple <code>define_delay</code> expressions may be specified. In this
|
||||
case, each such expression specifies different delay slot requirements
|
||||
and there must be no insn for which tests in two <code>define_delay</code>
|
||||
expressions are both true.
|
||||
|
||||
<p>For example, if we have a machine that requires one delay slot for branches
|
||||
but two for calls, no delay slot can contain a branch or call insn,
|
||||
and any valid insn in the delay slot for the branch can be annulled if the
|
||||
branch is true, we might represent this as follows:
|
||||
|
||||
<pre class="smallexample"> (define_delay (eq_attr "type" "branch")
|
||||
[(eq_attr "type" "!branch,call")
|
||||
(eq_attr "type" "!branch,call")
|
||||
(nil)])
|
||||
|
||||
(define_delay (eq_attr "type" "call")
|
||||
[(eq_attr "type" "!branch,call") (nil) (nil)
|
||||
(eq_attr "type" "!branch,call") (nil) (nil)])
|
||||
</pre>
|
||||
<!-- the above is *still* too long. -mew 4feb93 -->
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Dependency analysis - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Loop-Analysis-and-Representation.html#Loop-Analysis-and-Representation" title="Loop Analysis and Representation">
|
||||
<link rel="prev" href="Number-of-iterations.html#Number-of-iterations" title="Number of iterations">
|
||||
<link rel="next" href="Lambda.html#Lambda" title="Lambda">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Dependency-analysis"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Lambda.html#Lambda">Lambda</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Number-of-iterations.html#Number-of-iterations">Number of iterations</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Loop-Analysis-and-Representation.html#Loop-Analysis-and-Representation">Loop Analysis and Representation</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">14.8 Data Dependency Analysis</h3>
|
||||
|
||||
<p><a name="index-Data-Dependency-Analysis-3117"></a>
|
||||
The code for the data dependence analysis can be found in
|
||||
<samp><span class="file">tree-data-ref.c</span></samp> and its interface and data structures are
|
||||
described in <samp><span class="file">tree-data-ref.h</span></samp>. The function that computes the
|
||||
data dependences for all the array and pointer references for a given
|
||||
loop is <code>compute_data_dependences_for_loop</code>. This function is
|
||||
currently used by the linear loop transform and the vectorization
|
||||
passes. Before calling this function, one has to allocate two vectors:
|
||||
a first vector will contain the set of data references that are
|
||||
contained in the analyzed loop body, and the second vector will contain
|
||||
the dependence relations between the data references. Thus if the
|
||||
vector of data references is of size <code>n</code>, the vector containing the
|
||||
dependence relations will contain <code>n*n</code> elements. However if the
|
||||
analyzed loop contains side effects, such as calls that potentially can
|
||||
interfere with the data references in the current analyzed loop, the
|
||||
analysis stops while scanning the loop body for data references, and
|
||||
inserts a single <code>chrec_dont_know</code> in the dependence relation
|
||||
array.
|
||||
|
||||
<p>The data references are discovered in a particular order during the
|
||||
scanning of the loop body: the loop body is analyzed in execution order,
|
||||
and the data references of each statement are pushed at the end of the
|
||||
data reference array. Two data references syntactically occur in the
|
||||
program in the same order as in the array of data references. This
|
||||
syntactic order is important in some classical data dependence tests,
|
||||
and mapping this order to the elements of this array avoids costly
|
||||
queries to the loop body representation.
|
||||
|
||||
<p>Three types of data references are currently handled: ARRAY_REF,
|
||||
INDIRECT_REF and COMPONENT_REF. The data structure for the data reference
|
||||
is <code>data_reference</code>, where <code>data_reference_p</code> is a name of a
|
||||
pointer to the data reference structure. The structure contains the
|
||||
following elements:
|
||||
|
||||
<ul>
|
||||
<li><code>base_object_info</code>: Provides information about the base object
|
||||
of the data reference and its access functions. These access functions
|
||||
represent the evolution of the data reference in the loop relative to
|
||||
its base, in keeping with the classical meaning of the data reference
|
||||
access function for the support of arrays. For example, for a reference
|
||||
<code>a.b[i][j]</code>, the base object is <code>a.b</code> and the access functions,
|
||||
one for each array subscript, are:
|
||||
<code>{i_init, + i_step}_1, {j_init, +, j_step}_2</code>.
|
||||
|
||||
<li><code>first_location_in_loop</code>: Provides information about the first
|
||||
location accessed by the data reference in the loop and about the access
|
||||
function used to represent evolution relative to this location. This data
|
||||
is used to support pointers, and is not used for arrays (for which we
|
||||
have base objects). Pointer accesses are represented as a one-dimensional
|
||||
access that starts from the first location accessed in the loop. For
|
||||
example:
|
||||
|
||||
<pre class="smallexample"> for1 i
|
||||
for2 j
|
||||
*((int *)p + i + j) = a[i][j];
|
||||
</pre>
|
||||
<p>The access function of the pointer access is <code>{0, + 4B}_for2</code>
|
||||
relative to <code>p + i</code>. The access functions of the array are
|
||||
<code>{i_init, + i_step}_for1</code> and <code>{j_init, +, j_step}_for2</code>
|
||||
relative to <code>a</code>.
|
||||
|
||||
<p>Usually, the object the pointer refers to is either unknown, or we can't
|
||||
prove that the access is confined to the boundaries of a certain object.
|
||||
|
||||
<p>Two data references can be compared only if at least one of these two
|
||||
representations has all its fields filled for both data references.
|
||||
|
||||
<p>The current strategy for data dependence tests is as follows:
|
||||
If both <code>a</code> and <code>b</code> are represented as arrays, compare
|
||||
<code>a.base_object</code> and <code>b.base_object</code>;
|
||||
if they are equal, apply dependence tests (use access functions based on
|
||||
base_objects).
|
||||
Else if both <code>a</code> and <code>b</code> are represented as pointers, compare
|
||||
<code>a.first_location</code> and <code>b.first_location</code>;
|
||||
if they are equal, apply dependence tests (use access functions based on
|
||||
first location).
|
||||
However, if <code>a</code> and <code>b</code> are represented differently, only try
|
||||
to prove that the bases are definitely different.
|
||||
|
||||
<li>Aliasing information.
|
||||
<li>Alignment information.
|
||||
</ul>
|
||||
|
||||
<p>The structure describing the relation between two data references is
|
||||
<code>data_dependence_relation</code> and the shorter name for a pointer to
|
||||
such a structure is <code>ddr_p</code>. This structure contains:
|
||||
|
||||
<ul>
|
||||
<li>a pointer to each data reference,
|
||||
<li>a tree node <code>are_dependent</code> that is set to <code>chrec_known</code>
|
||||
if the analysis has proved that there is no dependence between these two
|
||||
data references, <code>chrec_dont_know</code> if the analysis was not able to
|
||||
determine any useful result and potentially there could exist a
|
||||
dependence between these data references, and <code>are_dependent</code> is
|
||||
set to <code>NULL_TREE</code> if there exist a dependence relation between the
|
||||
data references, and the description of this dependence relation is
|
||||
given in the <code>subscripts</code>, <code>dir_vects</code>, and <code>dist_vects</code>
|
||||
arrays,
|
||||
<li>a boolean that determines whether the dependence relation can be
|
||||
represented by a classical distance vector,
|
||||
<li>an array <code>subscripts</code> that contains a description of each
|
||||
subscript of the data references. Given two array accesses a
|
||||
subscript is the tuple composed of the access functions for a given
|
||||
dimension. For example, given <code>A[f1][f2][f3]</code> and
|
||||
<code>B[g1][g2][g3]</code>, there are three subscripts: <code>(f1, g1), (f2,
|
||||
g2), (f3, g3)</code>.
|
||||
<li>two arrays <code>dir_vects</code> and <code>dist_vects</code> that contain
|
||||
classical representations of the data dependences under the form of
|
||||
direction and distance dependence vectors,
|
||||
<li>an array of loops <code>loop_nest</code> that contains the loops to
|
||||
which the distance and direction vectors refer to.
|
||||
</ul>
|
||||
|
||||
<p>Several functions for pretty printing the information extracted by the
|
||||
data dependence analysis are available: <code>dump_ddrs</code> prints with a
|
||||
maximum verbosity the details of a data dependence relations array,
|
||||
<code>dump_dist_dir_vectors</code> prints only the classical distance and
|
||||
direction vectors for a data dependence relations array, and
|
||||
<code>dump_data_references</code> prints the details of the data references
|
||||
contained in a data reference array.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Dependent Patterns - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Machine-Desc.html#Machine-Desc" title="Machine Desc">
|
||||
<link rel="prev" href="Pattern-Ordering.html#Pattern-Ordering" title="Pattern Ordering">
|
||||
<link rel="next" href="Jump-Patterns.html#Jump-Patterns" title="Jump Patterns">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Dependent-Patterns"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Jump-Patterns.html#Jump-Patterns">Jump Patterns</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Pattern-Ordering.html#Pattern-Ordering">Pattern Ordering</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Machine-Desc.html#Machine-Desc">Machine Desc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">16.11 Interdependence of Patterns</h3>
|
||||
|
||||
<p><a name="index-Dependent-Patterns-3612"></a><a name="index-Interdependence-of-Patterns-3613"></a>
|
||||
In some cases machines support instructions identical except for the
|
||||
machine mode of one or more operands. For example, there may be
|
||||
“sign-extend halfword” and “sign-extend byte” instructions whose
|
||||
patterns are
|
||||
|
||||
<pre class="smallexample"> (set (match_operand:SI 0 ...)
|
||||
(extend:SI (match_operand:HI 1 ...)))
|
||||
|
||||
(set (match_operand:SI 0 ...)
|
||||
(extend:SI (match_operand:QI 1 ...)))
|
||||
</pre>
|
||||
<p class="noindent">Constant integers do not specify a machine mode, so an instruction to
|
||||
extend a constant value could match either pattern. The pattern it
|
||||
actually will match is the one that appears first in the file. For correct
|
||||
results, this must be the one for the widest possible mode (<code>HImode</code>,
|
||||
here). If the pattern matches the <code>QImode</code> instruction, the results
|
||||
will be incorrect if the constant value does not actually fit that mode.
|
||||
|
||||
<p>Such instructions to extend constants are rarely generated because they are
|
||||
optimized away, but they do occasionally happen in nonoptimized
|
||||
compilations.
|
||||
|
||||
<p>If a constraint in a pattern allows a constant, the reload pass may
|
||||
replace a register with a constant permitted by the constraint in some
|
||||
cases. Similarly for memory references. Because of this substitution,
|
||||
you should not provide separate patterns for increment and decrement
|
||||
instructions. Instead, they should be generated from the same pattern
|
||||
that supports register-register add insns by examining the operands and
|
||||
generating the appropriate machine instruction.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,279 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Directives - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Test-Directives.html#Test-Directives" title="Test Directives">
|
||||
<link rel="next" href="Selectors.html#Selectors" title="Selectors">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Directives"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Selectors.html#Selectors">Selectors</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Test-Directives.html#Test-Directives">Test Directives</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">7.2.1 Syntax and Descriptions of test directives</h4>
|
||||
|
||||
<p>Test directives appear within comments in a test source file and begin
|
||||
with <code>dg-</code>. Some of these are defined within DejaGnu and others
|
||||
are local to the GCC testsuite.
|
||||
|
||||
<p>The order in which test directives appear in a test can be important:
|
||||
directives local to GCC sometimes override information used by the
|
||||
DejaGnu directives, which know nothing about the GCC directives, so the
|
||||
DejaGnu directives must precede GCC directives.
|
||||
|
||||
<p>Several test directives include selectors (see <a href="Selectors.html#Selectors">Selectors</a>)
|
||||
which are usually preceded by the keyword <code>target</code> or <code>xfail</code>.
|
||||
|
||||
<h5 class="subsubsection">7.2.1.1 Specify how to build the test</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-do </code><var>do-what-keyword</var><code> [{ target/xfail </code><var>selector</var><code> }] }</code><dd><var>do-what-keyword</var> specifies how the test is compiled and whether
|
||||
it is executed. It is one of:
|
||||
|
||||
<dl>
|
||||
<dt><code>preprocess</code><dd>Compile with <samp><span class="option">-E</span></samp> to run only the preprocessor.
|
||||
<br><dt><code>compile</code><dd>Compile with <samp><span class="option">-S</span></samp> to produce an assembly code file.
|
||||
<br><dt><code>assemble</code><dd>Compile with <samp><span class="option">-c</span></samp> to produce a relocatable object file.
|
||||
<br><dt><code>link</code><dd>Compile, assemble, and link to produce an executable file.
|
||||
<br><dt><code>run</code><dd>Produce and run an executable file, which is expected to return
|
||||
an exit code of 0.
|
||||
</dl>
|
||||
|
||||
<p>The default is <code>compile</code>. That can be overridden for a set of
|
||||
tests by redefining <code>dg-do-what-default</code> within the <code>.exp</code>
|
||||
file for those tests.
|
||||
|
||||
<p>If the directive includes the optional ‘<samp><span class="samp">{ target </span><var>selector</var><span class="samp"> }</span></samp>’
|
||||
then the test is skipped unless the target system matches the
|
||||
<var>selector</var>.
|
||||
|
||||
<p>If <var>do-what-keyword</var> is <code>run</code> and the directive includes
|
||||
the optional ‘<samp><span class="samp">{ xfail </span><var>selector</var><span class="samp"> }</span></samp>’ and the selector is met
|
||||
then the test is expected to fail. The <code>xfail</code> clause is ignored
|
||||
for other values of <var>do-what-keyword</var>; those tests can use
|
||||
directive <code>dg-xfail-if</code>.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.2 Specify additional compiler options</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-options </code><var>options</var><code> [{ target </code><var>selector</var><code> }] }</code><dd>This DejaGnu directive provides a list of compiler options, to be used
|
||||
if the target system matches <var>selector</var>, that replace the default
|
||||
options used for this set of tests.
|
||||
|
||||
<br><dt><code>{ dg-add-options </code><var>feature</var><code> ... }</code><dd>Add any compiler options that are needed to access certain features.
|
||||
This directive does nothing on targets that enable the features by
|
||||
default, or that don't provide them at all. It must come after
|
||||
all <code>dg-options</code> directives.
|
||||
For supported values of <var>feature</var> see <a href="Add-Options.html#Add-Options">Add Options</a>.
|
||||
|
||||
<br><dt><code>{ dg-additional-options </code><var>options</var><code> [{ target </code><var>selector</var><code> }] }</code><dd>This directive provides a list of compiler options, to be used
|
||||
if the target system matches <var>selector</var>, that are added to the default
|
||||
options used for this set of tests.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.3 Modify the test timeout value</h5>
|
||||
|
||||
<p>The normal timeout limit, in seconds, is found by searching the
|
||||
following in order:
|
||||
|
||||
<ul>
|
||||
<li>the value defined by an earlier <code>dg-timeout</code> directive in
|
||||
the test
|
||||
|
||||
<li>variable <var>tool_timeout</var> defined by the set of tests
|
||||
|
||||
<li><var>gcc</var>,<var>timeout</var> set in the target board
|
||||
|
||||
<li>300
|
||||
</ul>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-timeout </code><var>n</var><code> [{target </code><var>selector</var><code> }] }</code><dd>Set the time limit for the compilation and for the execution of the test
|
||||
to the specified number of seconds.
|
||||
|
||||
<br><dt><code>{ dg-timeout-factor </code><var>x</var><code> [{ target </code><var>selector</var><code> }] }</code><dd>Multiply the normal time limit for compilation and execution of the test
|
||||
by the specified floating-point factor.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.4 Skip a test for some targets</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-skip-if </code><var>comment</var><code> { </code><var>selector</var><code> } [{ </code><var>include-opts</var><code> } [{ </code><var>exclude-opts</var><code> }]] }</code><dd>Arguments <var>include-opts</var> and <var>exclude-opts</var> are lists in which
|
||||
each element is a string of zero or more GCC options.
|
||||
Skip the test if all of the following conditions are met:
|
||||
<ul>
|
||||
<li>the test system is included in <var>selector</var>
|
||||
|
||||
<li>for at least one of the option strings in <var>include-opts</var>,
|
||||
every option from that string is in the set of options with which
|
||||
the test would be compiled; use ‘<samp><span class="samp">"*"</span></samp>’ for an <var>include-opts</var> list
|
||||
that matches any options; that is the default if <var>include-opts</var> is
|
||||
not specified
|
||||
|
||||
<li>for each of the option strings in <var>exclude-opts</var>, at least one
|
||||
option from that string is not in the set of options with which the test
|
||||
would be compiled; use ‘<samp><span class="samp">""</span></samp>’ for an empty <var>exclude-opts</var> list;
|
||||
that is the default if <var>exclude-opts</var> is not specified
|
||||
</ul>
|
||||
|
||||
<p>For example, to skip a test if option <code>-Os</code> is present:
|
||||
|
||||
<pre class="smallexample"> /* { dg-skip-if "" { *-*-* } { "-Os" } { "" } } */
|
||||
</pre>
|
||||
<p>To skip a test if both options <code>-O2</code> and <code>-g</code> are present:
|
||||
|
||||
<pre class="smallexample"> /* { dg-skip-if "" { *-*-* } { "-O2 -g" } { "" } } */
|
||||
</pre>
|
||||
<p>To skip a test if either <code>-O2</code> or <code>-O3</code> is present:
|
||||
|
||||
<pre class="smallexample"> /* { dg-skip-if "" { *-*-* } { "-O2" "-O3" } { "" } } */
|
||||
</pre>
|
||||
<p>To skip a test unless option <code>-Os</code> is present:
|
||||
|
||||
<pre class="smallexample"> /* { dg-skip-if "" { *-*-* } { "*" } { "-Os" } } */
|
||||
</pre>
|
||||
<p>To skip a test if either <code>-O2</code> or <code>-O3</code> is used with <code>-g</code>
|
||||
but not if <code>-fpic</code> is also present:
|
||||
|
||||
<pre class="smallexample"> /* { dg-skip-if "" { *-*-* } { "-O2 -g" "-O3 -g" } { "-fpic" } } */
|
||||
</pre>
|
||||
<br><dt><code>{ dg-require-effective-target </code><var>keyword</var><code> [{ </code><var>selector</var><code> }] }</code><dd>Skip the test if the test target, including current multilib flags,
|
||||
is not covered by the effective-target keyword.
|
||||
If the directive includes the optional ‘<samp><span class="samp">{ </span><var>selector</var><span class="samp"> }</span></samp>’
|
||||
then the effective-target test is only performed if the target system
|
||||
matches the <var>selector</var>.
|
||||
This directive must appear after any <code>dg-do</code> directive in the test
|
||||
and before any <code>dg-additional-sources</code> directive.
|
||||
See <a href="Effective_002dTarget-Keywords.html#Effective_002dTarget-Keywords">Effective-Target Keywords</a>.
|
||||
|
||||
<br><dt><code>{ dg-require-</code><var>support</var><code> args }</code><dd>Skip the test if the target does not provide the required support.
|
||||
These directives must appear after any <code>dg-do</code> directive in the test
|
||||
and before any <code>dg-additional-sources</code> directive.
|
||||
They require at least one argument, which can be an empty string if the
|
||||
specific procedure does not examine the argument.
|
||||
See <a href="Require-Support.html#Require-Support">Require Support</a>, for a complete list of these directives.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.5 Expect a test to fail for some targets</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-xfail-if </code><var>comment</var><code> { </code><var>selector</var><code> } [{ </code><var>include-opts</var><code> } [{ </code><var>exclude-opts</var><code> }]] }</code><dd>Expect the test to fail if the conditions (which are the same as for
|
||||
<code>dg-skip-if</code>) are met. This does not affect the execute step.
|
||||
|
||||
<br><dt><code>{ dg-xfail-run-if </code><var>comment</var><code> { </code><var>selector</var><code> } [{ </code><var>include-opts</var><code> } [{ </code><var>exclude-opts</var><code> }]] }</code><dd>Expect the execute step of a test to fail if the conditions (which are
|
||||
the same as for <code>dg-skip-if</code>) are met.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.6 Expect the test executable to fail</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-shouldfail </code><var>comment</var><code> [{ </code><var>selector</var><code> } [{ </code><var>include-opts</var><code> } [{ </code><var>exclude-opts</var><code> }]]] }</code><dd>Expect the test executable to return a nonzero exit status if the
|
||||
conditions (which are the same as for <code>dg-skip-if</code>) are met.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.7 Verify compiler messages</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-error </code><var>regexp</var><code> [</code><var>comment</var><code> [{ target/xfail </code><var>selector</var><code> } [</code><var>line</var><code>] }]] }</code><dd>This DejaGnu directive appears on a source line that is expected to get
|
||||
an error message, or else specifies the source line associated with the
|
||||
message. If there is no message for that line or if the text of that
|
||||
message is not matched by <var>regexp</var> then the check fails and
|
||||
<var>comment</var> is included in the <code>FAIL</code> message. The check does
|
||||
not look for the string ‘<samp><span class="samp">error</span></samp>’ unless it is part of <var>regexp</var>.
|
||||
|
||||
<br><dt><code>{ dg-warning </code><var>regexp</var><code> [</code><var>comment</var><code> [{ target/xfail </code><var>selector</var><code> } [</code><var>line</var><code>] }]] }</code><dd>This DejaGnu directive appears on a source line that is expected to get
|
||||
a warning message, or else specifies the source line associated with the
|
||||
message. If there is no message for that line or if the text of that
|
||||
message is not matched by <var>regexp</var> then the check fails and
|
||||
<var>comment</var> is included in the <code>FAIL</code> message. The check does
|
||||
not look for the string ‘<samp><span class="samp">warning</span></samp>’ unless it is part of <var>regexp</var>.
|
||||
|
||||
<br><dt><code>{ dg-message </code><var>regexp</var><code> [</code><var>comment</var><code> [{ target/xfail </code><var>selector</var><code> } [</code><var>line</var><code>] }]] }</code><dd>The line is expected to get a message other than an error or warning.
|
||||
If there is no message for that line or if the text of that message is
|
||||
not matched by <var>regexp</var> then the check fails and <var>comment</var> is
|
||||
included in the <code>FAIL</code> message.
|
||||
|
||||
<br><dt><code>{ dg-bogus </code><var>regexp</var><code> [</code><var>comment</var><code> [{ target/xfail </code><var>selector</var><code> } [</code><var>line</var><code>] }]] }</code><dd>This DejaGnu directive appears on a source line that should not get a
|
||||
message matching <var>regexp</var>, or else specifies the source line
|
||||
associated with the bogus message. It is usually used with ‘<samp><span class="samp">xfail</span></samp>’
|
||||
to indicate that the message is a known problem for a particular set of
|
||||
targets.
|
||||
|
||||
<br><dt><code>{ dg-excess-errors </code><var>comment</var><code> [{ target/xfail </code><var>selector</var><code> }] }</code><dd>This DejaGnu directive indicates that the test is expected to fail due
|
||||
to compiler messages that are not handled by ‘<samp><span class="samp">dg-error</span></samp>’,
|
||||
‘<samp><span class="samp">dg-warning</span></samp>’ or ‘<samp><span class="samp">dg-bogus</span></samp>’. For this directive ‘<samp><span class="samp">xfail</span></samp>’
|
||||
has the same effect as ‘<samp><span class="samp">target</span></samp>’.
|
||||
|
||||
<br><dt><code>{ dg-prune-output </code><var>regexp</var><code> }</code><dd>Prune messages matching <var>regexp</var> from the test output.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.8 Verify output of the test executable</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-output </code><var>regexp</var><code> [{ target/xfail </code><var>selector</var><code> }] }</code><dd>This DejaGnu directive compares <var>regexp</var> to the combined output
|
||||
that the test executable writes to <samp><span class="file">stdout</span></samp> and <samp><span class="file">stderr</span></samp>.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.9 Specify additional files for a test</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-additional-files "</code><var>filelist</var><code>" }</code><dd>Specify additional files, other than source files, that must be copied
|
||||
to the system where the compiler runs.
|
||||
|
||||
<br><dt><code>{ dg-additional-sources "</code><var>filelist</var><code>" }</code><dd>Specify additional source files to appear in the compile line
|
||||
following the main test file.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.1.10 Add checks at the end of a test</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>{ dg-final { </code><var>local-directive</var><code> } }</code><dd>This DejaGnu directive is placed within a comment anywhere in the
|
||||
source file and is processed after the test has been compiled and run.
|
||||
Multiple ‘<samp><span class="samp">dg-final</span></samp>’ commands are processed in the order in which
|
||||
they appear in the source file. See <a href="Final-Actions.html#Final-Actions">Final Actions</a>, for a list
|
||||
of directives that can be used within <code>dg-final</code>.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Disable Insn Alternatives - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Constraints.html#Constraints" title="Constraints">
|
||||
<link rel="prev" href="Machine-Constraints.html#Machine-Constraints" title="Machine Constraints">
|
||||
<link rel="next" href="Define-Constraints.html#Define-Constraints" title="Define Constraints">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Disable-Insn-Alternatives"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Define-Constraints.html#Define-Constraints">Define Constraints</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Machine-Constraints.html#Machine-Constraints">Machine Constraints</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Constraints.html#Constraints">Constraints</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.8.6 Disable insn alternatives using the <code>enabled</code> attribute</h4>
|
||||
|
||||
<p><a name="index-enabled-3316"></a>
|
||||
The <code>enabled</code> insn attribute may be used to disable certain insn
|
||||
alternatives for machine-specific reasons. This is useful when adding
|
||||
new instructions to an existing pattern which are only available for
|
||||
certain cpu architecture levels as specified with the <code>-march=</code>
|
||||
option.
|
||||
|
||||
<p>If an insn alternative is disabled, then it will never be used. The
|
||||
compiler treats the constraints for the disabled alternative as
|
||||
unsatisfiable.
|
||||
|
||||
<p>In order to make use of the <code>enabled</code> attribute a back end has to add
|
||||
in the machine description files:
|
||||
|
||||
<ol type=1 start=1>
|
||||
<li>A definition of the <code>enabled</code> insn attribute. The attribute is
|
||||
defined as usual using the <code>define_attr</code> command. This
|
||||
definition should be based on other insn attributes and/or target flags.
|
||||
The <code>enabled</code> attribute is a numeric attribute and should evaluate to
|
||||
<code>(const_int 1)</code> for an enabled alternative and to
|
||||
<code>(const_int 0)</code> otherwise.
|
||||
<li>A definition of another insn attribute used to describe for what
|
||||
reason an insn alternative might be available or
|
||||
not. E.g. <code>cpu_facility</code> as in the example below.
|
||||
<li>An assignment for the second attribute to each insn definition
|
||||
combining instructions which are not all available under the same
|
||||
circumstances. (Note: It obviously only makes sense for definitions
|
||||
with more than one alternative. Otherwise the insn pattern should be
|
||||
disabled or enabled using the insn condition.)
|
||||
</ol>
|
||||
|
||||
<p>E.g. the following two patterns could easily be merged using the <code>enabled</code>
|
||||
attribute:
|
||||
|
||||
<pre class="smallexample">
|
||||
(define_insn "*movdi_old"
|
||||
[(set (match_operand:DI 0 "register_operand" "=d")
|
||||
(match_operand:DI 1 "register_operand" " d"))]
|
||||
"!TARGET_NEW"
|
||||
"lgr %0,%1")
|
||||
|
||||
(define_insn "*movdi_new"
|
||||
[(set (match_operand:DI 0 "register_operand" "=d,f,d")
|
||||
(match_operand:DI 1 "register_operand" " d,d,f"))]
|
||||
"TARGET_NEW"
|
||||
"@
|
||||
lgr %0,%1
|
||||
ldgr %0,%1
|
||||
lgdr %0,%1")
|
||||
|
||||
</pre>
|
||||
<p>to:
|
||||
|
||||
<pre class="smallexample">
|
||||
(define_insn "*movdi_combined"
|
||||
[(set (match_operand:DI 0 "register_operand" "=d,f,d")
|
||||
(match_operand:DI 1 "register_operand" " d,d,f"))]
|
||||
""
|
||||
"@
|
||||
lgr %0,%1
|
||||
ldgr %0,%1
|
||||
lgdr %0,%1"
|
||||
[(set_attr "cpu_facility" "*,new,new")])
|
||||
|
||||
</pre>
|
||||
<p>with the <code>enabled</code> attribute defined like this:
|
||||
|
||||
<pre class="smallexample">
|
||||
(define_attr "cpu_facility" "standard,new" (const_string "standard"))
|
||||
|
||||
(define_attr "enabled" ""
|
||||
(cond [(eq_attr "cpu_facility" "standard") (const_int 1)
|
||||
(and (eq_attr "cpu_facility" "new")
|
||||
(ne (symbol_ref "TARGET_NEW") (const_int 0)))
|
||||
(const_int 1)]
|
||||
(const_int 0)))
|
||||
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,164 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Dispatch Tables - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Assembler-Format.html#Assembler-Format" title="Assembler Format">
|
||||
<link rel="prev" href="Instruction-Output.html#Instruction-Output" title="Instruction Output">
|
||||
<link rel="next" href="Exception-Region-Output.html#Exception-Region-Output" title="Exception Region Output">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Dispatch-Tables"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Exception-Region-Output.html#Exception-Region-Output">Exception Region Output</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Instruction-Output.html#Instruction-Output">Instruction Output</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Assembler-Format.html#Assembler-Format">Assembler Format</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.21.8 Output of Dispatch Tables</h4>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>This concerns dispatch tables.
|
||||
|
||||
<p><a name="index-dispatch-table-4651"></a>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_ADDR_DIFF_ELT</b> (<var>stream, body, value, rel</var>)<var><a name="index-ASM_005fOUTPUT_005fADDR_005fDIFF_005fELT-4652"></a></var><br>
|
||||
<blockquote><p>A C statement to output to the stdio stream <var>stream</var> an assembler
|
||||
pseudo-instruction to generate a difference between two labels.
|
||||
<var>value</var> and <var>rel</var> are the numbers of two internal labels. The
|
||||
definitions of these labels are output using
|
||||
<code>(*targetm.asm_out.internal_label)</code>, and they must be printed in the same
|
||||
way here. For example,
|
||||
|
||||
<pre class="smallexample"> fprintf (<var>stream</var>, "\t.word L%d-L%d\n",
|
||||
<var>value</var>, <var>rel</var>)
|
||||
</pre>
|
||||
<p>You must provide this macro on machines where the addresses in a
|
||||
dispatch table are relative to the table's own address. If defined, GCC
|
||||
will also use this macro on all machines when producing PIC.
|
||||
<var>body</var> is the body of the <code>ADDR_DIFF_VEC</code>; it is provided so that the
|
||||
mode and flags can be read.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_ADDR_VEC_ELT</b> (<var>stream, value</var>)<var><a name="index-ASM_005fOUTPUT_005fADDR_005fVEC_005fELT-4653"></a></var><br>
|
||||
<blockquote><p>This macro should be provided on machines where the addresses
|
||||
in a dispatch table are absolute.
|
||||
|
||||
<p>The definition should be a C statement to output to the stdio stream
|
||||
<var>stream</var> an assembler pseudo-instruction to generate a reference to
|
||||
a label. <var>value</var> is the number of an internal label whose
|
||||
definition is output using <code>(*targetm.asm_out.internal_label)</code>.
|
||||
For example,
|
||||
|
||||
<pre class="smallexample"> fprintf (<var>stream</var>, "\t.word L%d\n", <var>value</var>)
|
||||
</pre>
|
||||
</blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_CASE_LABEL</b> (<var>stream, prefix, num, table</var>)<var><a name="index-ASM_005fOUTPUT_005fCASE_005fLABEL-4654"></a></var><br>
|
||||
<blockquote><p>Define this if the label before a jump-table needs to be output
|
||||
specially. The first three arguments are the same as for
|
||||
<code>(*targetm.asm_out.internal_label)</code>; the fourth argument is the
|
||||
jump-table which follows (a <code>jump_insn</code> containing an
|
||||
<code>addr_vec</code> or <code>addr_diff_vec</code>).
|
||||
|
||||
<p>This feature is used on system V to output a <code>swbeg</code> statement
|
||||
for the table.
|
||||
|
||||
<p>If this macro is not defined, these labels are output with
|
||||
<code>(*targetm.asm_out.internal_label)</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_CASE_END</b> (<var>stream, num, table</var>)<var><a name="index-ASM_005fOUTPUT_005fCASE_005fEND-4655"></a></var><br>
|
||||
<blockquote><p>Define this if something special must be output at the end of a
|
||||
jump-table. The definition should be a C statement to be executed
|
||||
after the assembler code for the table is written. It should write
|
||||
the appropriate code to stdio stream <var>stream</var>. The argument
|
||||
<var>table</var> is the jump-table insn, and <var>num</var> is the label-number
|
||||
of the preceding label.
|
||||
|
||||
<p>If this macro is not defined, nothing special is output at the end of
|
||||
the jump-table.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_EMIT_UNWIND_LABEL</b> (<var>FILE *stream, tree decl, int for_eh, int empty</var>)<var><a name="index-TARGET_005fASM_005fEMIT_005fUNWIND_005fLABEL-4656"></a></var><br>
|
||||
<blockquote><p>This target hook emits a label at the beginning of each FDE. It
|
||||
should be defined on targets where FDEs need special labels, and it
|
||||
should write the appropriate label, for the FDE associated with the
|
||||
function declaration <var>decl</var>, to the stdio stream <var>stream</var>.
|
||||
The third argument, <var>for_eh</var>, is a boolean: true if this is for an
|
||||
exception table. The fourth argument, <var>empty</var>, is a boolean:
|
||||
true if this is a placeholder label for an omitted FDE.
|
||||
|
||||
<p>The default is that FDEs are not given nonlocal labels.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL</b> (<var>FILE *stream</var>)<var><a name="index-TARGET_005fASM_005fEMIT_005fEXCEPT_005fTABLE_005fLABEL-4657"></a></var><br>
|
||||
<blockquote><p>This target hook emits a label at the beginning of the exception table.
|
||||
It should be defined on targets where it is desirable for the table
|
||||
to be broken up according to function.
|
||||
|
||||
<p>The default is that no label is emitted.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_EMIT_EXCEPT_PERSONALITY</b> (<var>rtx personality</var>)<var><a name="index-TARGET_005fASM_005fEMIT_005fEXCEPT_005fPERSONALITY-4658"></a></var><br>
|
||||
<blockquote><p>If the target implements <code>TARGET_ASM_UNWIND_EMIT</code>, this hook may be used to emit a directive to install a personality hook into the unwind info. This hook should not be used if dwarf2 unwind info is used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_UNWIND_EMIT</b> (<var>FILE *stream, rtx insn</var>)<var><a name="index-TARGET_005fASM_005fUNWIND_005fEMIT-4659"></a></var><br>
|
||||
<blockquote><p>This target hook emits assembly directives required to unwind the
|
||||
given instruction. This is only used when <code>TARGET_EXCEPT_UNWIND_INFO</code>
|
||||
returns <code>UI_TARGET</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_ASM_UNWIND_EMIT_BEFORE_INSN</b><var><a name="index-TARGET_005fASM_005fUNWIND_005fEMIT_005fBEFORE_005fINSN-4660"></a></var><br>
|
||||
<blockquote><p>True if the <code>TARGET_ASM_UNWIND_EMIT</code> hook should be called before the assembly for <var>insn</var> has been emitted, false if the hook should be called afterward.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Documentation - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="gcc-Directory.html#gcc-Directory" title="gcc Directory">
|
||||
<link rel="prev" href="Headers.html#Headers" title="Headers">
|
||||
<link rel="next" href="Front-End.html#Front-End" title="Front End">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Documentation"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Front-End.html#Front-End">Front End</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Headers.html#Headers">Headers</a>,
|
||||
Up: <a rel="up" accesskey="u" href="gcc-Directory.html#gcc-Directory">gcc Directory</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">6.3.7 Building Documentation</h4>
|
||||
|
||||
<p>The main GCC documentation is in the form of manuals in Texinfo
|
||||
format. These are installed in Info format; DVI versions may be
|
||||
generated by ‘<samp><span class="samp">make dvi</span></samp>’, PDF versions by ‘<samp><span class="samp">make pdf</span></samp>’, and
|
||||
HTML versions by ‘<samp><span class="samp">make html</span></samp>’. In addition, some man pages are
|
||||
generated from the Texinfo manuals, there are some other text files
|
||||
with miscellaneous documentation, and runtime libraries have their own
|
||||
documentation outside the <samp><span class="file">gcc</span></samp> directory. FIXME: document the
|
||||
documentation for runtime libraries somewhere.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Texinfo-Manuals.html#Texinfo-Manuals">Texinfo Manuals</a>: GCC manuals in Texinfo format.
|
||||
<li><a accesskey="2" href="Man-Page-Generation.html#Man-Page-Generation">Man Page Generation</a>: Generating man pages from Texinfo manuals.
|
||||
<li><a accesskey="3" href="Miscellaneous-Docs.html#Miscellaneous-Docs">Miscellaneous Docs</a>: Miscellaneous text files with documentation.
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,550 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Driver - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="Target-Structure.html#Target-Structure" title="Target Structure">
|
||||
<link rel="next" href="Run_002dtime-Target.html#Run_002dtime-Target" title="Run-time Target">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Driver"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Run_002dtime-Target.html#Run_002dtime-Target">Run-time Target</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Target-Structure.html#Target-Structure">Target Structure</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.2 Controlling the Compilation Driver, <samp><span class="file">gcc</span></samp></h3>
|
||||
|
||||
<p><a name="index-driver-3795"></a><a name="index-controlling-the-compilation-driver-3796"></a>
|
||||
<!-- prevent bad page break with this line -->
|
||||
You can control the compilation driver.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DRIVER_SELF_SPECS</b><var><a name="index-DRIVER_005fSELF_005fSPECS-3797"></a></var><br>
|
||||
<blockquote><p>A list of specs for the driver itself. It should be a suitable
|
||||
initializer for an array of strings, with no surrounding braces.
|
||||
|
||||
<p>The driver applies these specs to its own command line between loading
|
||||
default <samp><span class="file">specs</span></samp> files (but not command-line specified ones) and
|
||||
choosing the multilib directory or running any subcommands. It
|
||||
applies them in the order given, so each spec can depend on the
|
||||
options added by earlier ones. It is also possible to remove options
|
||||
using ‘<samp><span class="samp">%<</span><var>option</var></samp>’ in the usual way.
|
||||
|
||||
<p>This macro can be useful when a port has several interdependent target
|
||||
options. It provides a way of standardizing the command line so
|
||||
that the other specs are easier to write.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>OPTION_DEFAULT_SPECS</b><var><a name="index-OPTION_005fDEFAULT_005fSPECS-3798"></a></var><br>
|
||||
<blockquote><p>A list of specs used to support configure-time default options (i.e.
|
||||
<samp><span class="option">--with</span></samp> options) in the driver. It should be a suitable initializer
|
||||
for an array of structures, each containing two strings, without the
|
||||
outermost pair of surrounding braces.
|
||||
|
||||
<p>The first item in the pair is the name of the default. This must match
|
||||
the code in <samp><span class="file">config.gcc</span></samp> for the target. The second item is a spec
|
||||
to apply if a default with this name was specified. The string
|
||||
‘<samp><span class="samp">%(VALUE)</span></samp>’ in the spec will be replaced by the value of the default
|
||||
everywhere it occurs.
|
||||
|
||||
<p>The driver will apply these specs to its own command line between loading
|
||||
default <samp><span class="file">specs</span></samp> files and processing <code>DRIVER_SELF_SPECS</code>, using
|
||||
the same mechanism as <code>DRIVER_SELF_SPECS</code>.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CPP_SPEC</b><var><a name="index-CPP_005fSPEC-3799"></a></var><br>
|
||||
<blockquote><p>A C string constant that tells the GCC driver program options to
|
||||
pass to CPP. It can also specify how to translate options you
|
||||
give to GCC into options for GCC to pass to the CPP.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CPLUSPLUS_CPP_SPEC</b><var><a name="index-CPLUSPLUS_005fCPP_005fSPEC-3800"></a></var><br>
|
||||
<blockquote><p>This macro is just like <code>CPP_SPEC</code>, but is used for C++, rather
|
||||
than C. If you do not define this macro, then the value of
|
||||
<code>CPP_SPEC</code> (if any) will be used instead.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CC1_SPEC</b><var><a name="index-CC1_005fSPEC-3801"></a></var><br>
|
||||
<blockquote><p>A C string constant that tells the GCC driver program options to
|
||||
pass to <code>cc1</code>, <code>cc1plus</code>, <code>f771</code>, and the other language
|
||||
front ends.
|
||||
It can also specify how to translate options you give to GCC into options
|
||||
for GCC to pass to front ends.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>CC1PLUS_SPEC</b><var><a name="index-CC1PLUS_005fSPEC-3802"></a></var><br>
|
||||
<blockquote><p>A C string constant that tells the GCC driver program options to
|
||||
pass to <code>cc1plus</code>. It can also specify how to translate options you
|
||||
give to GCC into options for GCC to pass to the <code>cc1plus</code>.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
Note that everything defined in CC1_SPEC is already passed to
|
||||
<code>cc1plus</code> so there is no need to duplicate the contents of
|
||||
CC1_SPEC in CC1PLUS_SPEC.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_SPEC</b><var><a name="index-ASM_005fSPEC-3803"></a></var><br>
|
||||
<blockquote><p>A C string constant that tells the GCC driver program options to
|
||||
pass to the assembler. It can also specify how to translate options
|
||||
you give to GCC into options for GCC to pass to the assembler.
|
||||
See the file <samp><span class="file">sun3.h</span></samp> for an example of this.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_FINAL_SPEC</b><var><a name="index-ASM_005fFINAL_005fSPEC-3804"></a></var><br>
|
||||
<blockquote><p>A C string constant that tells the GCC driver program how to
|
||||
run any programs which cleanup after the normal assembler.
|
||||
Normally, this is not needed. See the file <samp><span class="file">mips.h</span></samp> for
|
||||
an example of this.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>AS_NEEDS_DASH_FOR_PIPED_INPUT</b><var><a name="index-AS_005fNEEDS_005fDASH_005fFOR_005fPIPED_005fINPUT-3805"></a></var><br>
|
||||
<blockquote><p>Define this macro, with no value, if the driver should give the assembler
|
||||
an argument consisting of a single dash, <samp><span class="option">-</span></samp>, to instruct it to
|
||||
read from its standard input (which will be a pipe connected to the
|
||||
output of the compiler proper). This argument is given after any
|
||||
<samp><span class="option">-o</span></samp> option specifying the name of the output file.
|
||||
|
||||
<p>If you do not define this macro, the assembler is assumed to read its
|
||||
standard input if given no non-option arguments. If your assembler
|
||||
cannot read standard input at all, use a ‘<samp><span class="samp">%{pipe:%e}</span></samp>’ construct;
|
||||
see <samp><span class="file">mips.h</span></samp> for instance.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LINK_SPEC</b><var><a name="index-LINK_005fSPEC-3806"></a></var><br>
|
||||
<blockquote><p>A C string constant that tells the GCC driver program options to
|
||||
pass to the linker. It can also specify how to translate options you
|
||||
give to GCC into options for GCC to pass to the linker.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LIB_SPEC</b><var><a name="index-LIB_005fSPEC-3807"></a></var><br>
|
||||
<blockquote><p>Another C string constant used much like <code>LINK_SPEC</code>. The difference
|
||||
between the two is that <code>LIB_SPEC</code> is used at the end of the
|
||||
command given to the linker.
|
||||
|
||||
<p>If this macro is not defined, a default is provided that
|
||||
loads the standard C library from the usual place. See <samp><span class="file">gcc.c</span></samp>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LIBGCC_SPEC</b><var><a name="index-LIBGCC_005fSPEC-3808"></a></var><br>
|
||||
<blockquote><p>Another C string constant that tells the GCC driver program
|
||||
how and when to place a reference to <samp><span class="file">libgcc.a</span></samp> into the
|
||||
linker command line. This constant is placed both before and after
|
||||
the value of <code>LIB_SPEC</code>.
|
||||
|
||||
<p>If this macro is not defined, the GCC driver provides a default that
|
||||
passes the string <samp><span class="option">-lgcc</span></samp> to the linker.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>REAL_LIBGCC_SPEC</b><var><a name="index-REAL_005fLIBGCC_005fSPEC-3809"></a></var><br>
|
||||
<blockquote><p>By default, if <code>ENABLE_SHARED_LIBGCC</code> is defined, the
|
||||
<code>LIBGCC_SPEC</code> is not directly used by the driver program but is
|
||||
instead modified to refer to different versions of <samp><span class="file">libgcc.a</span></samp>
|
||||
depending on the values of the command line flags <samp><span class="option">-static</span></samp>,
|
||||
<samp><span class="option">-shared</span></samp>, <samp><span class="option">-static-libgcc</span></samp>, and <samp><span class="option">-shared-libgcc</span></samp>. On
|
||||
targets where these modifications are inappropriate, define
|
||||
<code>REAL_LIBGCC_SPEC</code> instead. <code>REAL_LIBGCC_SPEC</code> tells the
|
||||
driver how to place a reference to <samp><span class="file">libgcc</span></samp> on the link command
|
||||
line, but, unlike <code>LIBGCC_SPEC</code>, it is used unmodified.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>USE_LD_AS_NEEDED</b><var><a name="index-USE_005fLD_005fAS_005fNEEDED-3810"></a></var><br>
|
||||
<blockquote><p>A macro that controls the modifications to <code>LIBGCC_SPEC</code>
|
||||
mentioned in <code>REAL_LIBGCC_SPEC</code>. If nonzero, a spec will be
|
||||
generated that uses –as-needed and the shared libgcc in place of the
|
||||
static exception handler library, when linking without any of
|
||||
<code>-static</code>, <code>-static-libgcc</code>, or <code>-shared-libgcc</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LINK_EH_SPEC</b><var><a name="index-LINK_005fEH_005fSPEC-3811"></a></var><br>
|
||||
<blockquote><p>If defined, this C string constant is added to <code>LINK_SPEC</code>.
|
||||
When <code>USE_LD_AS_NEEDED</code> is zero or undefined, it also affects
|
||||
the modifications to <code>LIBGCC_SPEC</code> mentioned in
|
||||
<code>REAL_LIBGCC_SPEC</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>STARTFILE_SPEC</b><var><a name="index-STARTFILE_005fSPEC-3812"></a></var><br>
|
||||
<blockquote><p>Another C string constant used much like <code>LINK_SPEC</code>. The
|
||||
difference between the two is that <code>STARTFILE_SPEC</code> is used at
|
||||
the very beginning of the command given to the linker.
|
||||
|
||||
<p>If this macro is not defined, a default is provided that loads the
|
||||
standard C startup file from the usual place. See <samp><span class="file">gcc.c</span></samp>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ENDFILE_SPEC</b><var><a name="index-ENDFILE_005fSPEC-3813"></a></var><br>
|
||||
<blockquote><p>Another C string constant used much like <code>LINK_SPEC</code>. The
|
||||
difference between the two is that <code>ENDFILE_SPEC</code> is used at
|
||||
the very end of the command given to the linker.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>THREAD_MODEL_SPEC</b><var><a name="index-THREAD_005fMODEL_005fSPEC-3814"></a></var><br>
|
||||
<blockquote><p>GCC <code>-v</code> will print the thread model GCC was configured to use.
|
||||
However, this doesn't work on platforms that are multilibbed on thread
|
||||
models, such as AIX 4.3. On such platforms, define
|
||||
<code>THREAD_MODEL_SPEC</code> such that it evaluates to a string without
|
||||
blanks that names one of the recognized thread models. <code>%*</code>, the
|
||||
default value of this macro, will expand to the value of
|
||||
<code>thread_file</code> set in <samp><span class="file">config.gcc</span></samp>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>SYSROOT_SUFFIX_SPEC</b><var><a name="index-SYSROOT_005fSUFFIX_005fSPEC-3815"></a></var><br>
|
||||
<blockquote><p>Define this macro to add a suffix to the target sysroot when GCC is
|
||||
configured with a sysroot. This will cause GCC to search for usr/lib,
|
||||
et al, within sysroot+suffix.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>SYSROOT_HEADERS_SUFFIX_SPEC</b><var><a name="index-SYSROOT_005fHEADERS_005fSUFFIX_005fSPEC-3816"></a></var><br>
|
||||
<blockquote><p>Define this macro to add a headers_suffix to the target sysroot when
|
||||
GCC is configured with a sysroot. This will cause GCC to pass the
|
||||
updated sysroot+headers_suffix to CPP, causing it to search for
|
||||
usr/include, et al, within sysroot+headers_suffix.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>EXTRA_SPECS</b><var><a name="index-EXTRA_005fSPECS-3817"></a></var><br>
|
||||
<blockquote><p>Define this macro to provide additional specifications to put in the
|
||||
<samp><span class="file">specs</span></samp> file that can be used in various specifications like
|
||||
<code>CC1_SPEC</code>.
|
||||
|
||||
<p>The definition should be an initializer for an array of structures,
|
||||
containing a string constant, that defines the specification name, and a
|
||||
string constant that provides the specification.
|
||||
|
||||
<p>Do not define this macro if it does not need to do anything.
|
||||
|
||||
<p><code>EXTRA_SPECS</code> is useful when an architecture contains several
|
||||
related targets, which have various <code>..._SPECS</code> which are similar
|
||||
to each other, and the maintainer would like one central place to keep
|
||||
these definitions.
|
||||
|
||||
<p>For example, the PowerPC System V.4 targets use <code>EXTRA_SPECS</code> to
|
||||
define either <code>_CALL_SYSV</code> when the System V calling sequence is
|
||||
used or <code>_CALL_AIX</code> when the older AIX-based calling sequence is
|
||||
used.
|
||||
|
||||
<p>The <samp><span class="file">config/rs6000/rs6000.h</span></samp> target file defines:
|
||||
|
||||
<pre class="smallexample"> #define EXTRA_SPECS \
|
||||
{ "cpp_sysv_default", CPP_SYSV_DEFAULT },
|
||||
|
||||
#define CPP_SYS_DEFAULT ""
|
||||
</pre>
|
||||
<p>The <samp><span class="file">config/rs6000/sysv.h</span></samp> target file defines:
|
||||
<pre class="smallexample"> #undef CPP_SPEC
|
||||
#define CPP_SPEC \
|
||||
"%{posix: -D_POSIX_SOURCE } \
|
||||
%{mcall-sysv: -D_CALL_SYSV } \
|
||||
%{!mcall-sysv: %(cpp_sysv_default) } \
|
||||
%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}"
|
||||
|
||||
#undef CPP_SYSV_DEFAULT
|
||||
#define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
|
||||
</pre>
|
||||
<p>while the <samp><span class="file">config/rs6000/eabiaix.h</span></samp> target file defines
|
||||
<code>CPP_SYSV_DEFAULT</code> as:
|
||||
|
||||
<pre class="smallexample"> #undef CPP_SYSV_DEFAULT
|
||||
#define CPP_SYSV_DEFAULT "-D_CALL_AIX"
|
||||
</pre>
|
||||
</blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LINK_LIBGCC_SPECIAL_1</b><var><a name="index-LINK_005fLIBGCC_005fSPECIAL_005f1-3818"></a></var><br>
|
||||
<blockquote><p>Define this macro if the driver program should find the library
|
||||
<samp><span class="file">libgcc.a</span></samp>. If you do not define this macro, the driver program will pass
|
||||
the argument <samp><span class="option">-lgcc</span></samp> to tell the linker to do the search.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LINK_GCC_C_SEQUENCE_SPEC</b><var><a name="index-LINK_005fGCC_005fC_005fSEQUENCE_005fSPEC-3819"></a></var><br>
|
||||
<blockquote><p>The sequence in which libgcc and libc are specified to the linker.
|
||||
By default this is <code>%G %L %G</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LINK_COMMAND_SPEC</b><var><a name="index-LINK_005fCOMMAND_005fSPEC-3820"></a></var><br>
|
||||
<blockquote><p>A C string constant giving the complete command line need to execute the
|
||||
linker. When you do this, you will need to update your port each time a
|
||||
change is made to the link command line within <samp><span class="file">gcc.c</span></samp>. Therefore,
|
||||
define this macro only if you need to completely redefine the command
|
||||
line for invoking the linker and there is no other way to accomplish
|
||||
the effect you need. Overriding this macro may be avoidable by overriding
|
||||
<code>LINK_GCC_C_SEQUENCE_SPEC</code> instead.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Common Target Hook: bool <b>TARGET_ALWAYS_STRIP_DOTDOT</b><var><a name="index-TARGET_005fALWAYS_005fSTRIP_005fDOTDOT-3821"></a></var><br>
|
||||
<blockquote><p>True if <samp><span class="file">..</span></samp> components should always be removed from directory names computed relative to GCC's internal directories, false (default) if such components should be preserved and directory names containing them passed to other tools such as the linker.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MULTILIB_DEFAULTS</b><var><a name="index-MULTILIB_005fDEFAULTS-3822"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C expression for the initializer of an array of
|
||||
string to tell the driver program which options are defaults for this
|
||||
target and thus do not need to be handled specially when using
|
||||
<code>MULTILIB_OPTIONS</code>.
|
||||
|
||||
<p>Do not define this macro if <code>MULTILIB_OPTIONS</code> is not defined in
|
||||
the target makefile fragment or if none of the options listed in
|
||||
<code>MULTILIB_OPTIONS</code> are set by default.
|
||||
See <a href="Target-Fragment.html#Target-Fragment">Target Fragment</a>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>RELATIVE_PREFIX_NOT_LINKDIR</b><var><a name="index-RELATIVE_005fPREFIX_005fNOT_005fLINKDIR-3823"></a></var><br>
|
||||
<blockquote><p>Define this macro to tell <samp><span class="command">gcc</span></samp> that it should only translate
|
||||
a <samp><span class="option">-B</span></samp> prefix into a <samp><span class="option">-L</span></samp> linker option if the prefix
|
||||
indicates an absolute file name.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MD_EXEC_PREFIX</b><var><a name="index-MD_005fEXEC_005fPREFIX-3824"></a></var><br>
|
||||
<blockquote><p>If defined, this macro is an additional prefix to try after
|
||||
<code>STANDARD_EXEC_PREFIX</code>. <code>MD_EXEC_PREFIX</code> is not searched
|
||||
when the compiler is built as a cross
|
||||
compiler. If you define <code>MD_EXEC_PREFIX</code>, then be sure to add it
|
||||
to the list of directories used to find the assembler in <samp><span class="file">configure.in</span></samp>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>STANDARD_STARTFILE_PREFIX</b><var><a name="index-STANDARD_005fSTARTFILE_005fPREFIX-3825"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C string constant if you wish to override the
|
||||
standard choice of <code>libdir</code> as the default prefix to
|
||||
try when searching for startup files such as <samp><span class="file">crt0.o</span></samp>.
|
||||
<code>STANDARD_STARTFILE_PREFIX</code> is not searched when the compiler
|
||||
is built as a cross compiler.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>STANDARD_STARTFILE_PREFIX_1</b><var><a name="index-STANDARD_005fSTARTFILE_005fPREFIX_005f1-3826"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C string constant if you wish to override the
|
||||
standard choice of <code>/lib</code> as a prefix to try after the default prefix
|
||||
when searching for startup files such as <samp><span class="file">crt0.o</span></samp>.
|
||||
<code>STANDARD_STARTFILE_PREFIX_1</code> is not searched when the compiler
|
||||
is built as a cross compiler.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>STANDARD_STARTFILE_PREFIX_2</b><var><a name="index-STANDARD_005fSTARTFILE_005fPREFIX_005f2-3827"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C string constant if you wish to override the
|
||||
standard choice of <code>/lib</code> as yet another prefix to try after the
|
||||
default prefix when searching for startup files such as <samp><span class="file">crt0.o</span></samp>.
|
||||
<code>STANDARD_STARTFILE_PREFIX_2</code> is not searched when the compiler
|
||||
is built as a cross compiler.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MD_STARTFILE_PREFIX</b><var><a name="index-MD_005fSTARTFILE_005fPREFIX-3828"></a></var><br>
|
||||
<blockquote><p>If defined, this macro supplies an additional prefix to try after the
|
||||
standard prefixes. <code>MD_EXEC_PREFIX</code> is not searched when the
|
||||
compiler is built as a cross compiler.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MD_STARTFILE_PREFIX_1</b><var><a name="index-MD_005fSTARTFILE_005fPREFIX_005f1-3829"></a></var><br>
|
||||
<blockquote><p>If defined, this macro supplies yet another prefix to try after the
|
||||
standard prefixes. It is not searched when the compiler is built as a
|
||||
cross compiler.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>INIT_ENVIRONMENT</b><var><a name="index-INIT_005fENVIRONMENT-3830"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C string constant if you wish to set environment
|
||||
variables for programs called by the driver, such as the assembler and
|
||||
loader. The driver passes the value of this macro to <code>putenv</code> to
|
||||
initialize the necessary environment variables.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>LOCAL_INCLUDE_DIR</b><var><a name="index-LOCAL_005fINCLUDE_005fDIR-3831"></a></var><br>
|
||||
<blockquote><p>Define this macro as a C string constant if you wish to override the
|
||||
standard choice of <samp><span class="file">/usr/local/include</span></samp> as the default prefix to
|
||||
try when searching for local header files. <code>LOCAL_INCLUDE_DIR</code>
|
||||
comes before <code>NATIVE_SYSTEM_HEADER_DIR</code> (set in
|
||||
<samp><span class="file">config.gcc</span></samp>, normally <samp><span class="file">/usr/include</span></samp>) in the search order.
|
||||
|
||||
<p>Cross compilers do not search either <samp><span class="file">/usr/local/include</span></samp> or its
|
||||
replacement.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>NATIVE_SYSTEM_HEADER_COMPONENT</b><var><a name="index-NATIVE_005fSYSTEM_005fHEADER_005fCOMPONENT-3832"></a></var><br>
|
||||
<blockquote><p>The “component” corresponding to <code>NATIVE_SYSTEM_HEADER_DIR</code>.
|
||||
See <code>INCLUDE_DEFAULTS</code>, below, for the description of components.
|
||||
If you do not define this macro, no component is used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>INCLUDE_DEFAULTS</b><var><a name="index-INCLUDE_005fDEFAULTS-3833"></a></var><br>
|
||||
<blockquote><p>Define this macro if you wish to override the entire default search path
|
||||
for include files. For a native compiler, the default search path
|
||||
usually consists of <code>GCC_INCLUDE_DIR</code>, <code>LOCAL_INCLUDE_DIR</code>,
|
||||
<code>GPLUSPLUS_INCLUDE_DIR</code>, and
|
||||
<code>NATIVE_SYSTEM_HEADER_DIR</code>. In addition, <code>GPLUSPLUS_INCLUDE_DIR</code>
|
||||
and <code>GCC_INCLUDE_DIR</code> are defined automatically by <samp><span class="file">Makefile</span></samp>,
|
||||
and specify private search areas for GCC. The directory
|
||||
<code>GPLUSPLUS_INCLUDE_DIR</code> is used only for C++ programs.
|
||||
|
||||
<p>The definition should be an initializer for an array of structures.
|
||||
Each array element should have four elements: the directory name (a
|
||||
string constant), the component name (also a string constant), a flag
|
||||
for C++-only directories,
|
||||
and a flag showing that the includes in the directory don't need to be
|
||||
wrapped in <code>extern ‘</code><samp><span class="samp">C</span></samp><code>’</code> when compiling C++. Mark the end of
|
||||
the array with a null element.
|
||||
|
||||
<p>The component name denotes what GNU package the include file is part of,
|
||||
if any, in all uppercase letters. For example, it might be ‘<samp><span class="samp">GCC</span></samp>’
|
||||
or ‘<samp><span class="samp">BINUTILS</span></samp>’. If the package is part of a vendor-supplied
|
||||
operating system, code the component name as ‘<samp><span class="samp">0</span></samp>’.
|
||||
|
||||
<p>For example, here is the definition used for VAX/VMS:
|
||||
|
||||
<pre class="smallexample"> #define INCLUDE_DEFAULTS \
|
||||
{ \
|
||||
{ "GNU_GXX_INCLUDE:", "G++", 1, 1}, \
|
||||
{ "GNU_CC_INCLUDE:", "GCC", 0, 0}, \
|
||||
{ "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0}, \
|
||||
{ ".", 0, 0, 0}, \
|
||||
{ 0, 0, 0, 0} \
|
||||
}
|
||||
</pre>
|
||||
</blockquote></div>
|
||||
|
||||
<p>Here is the order of prefixes tried for exec files:
|
||||
|
||||
<ol type=1 start=1>
|
||||
<li>Any prefixes specified by the user with <samp><span class="option">-B</span></samp>.
|
||||
|
||||
<li>The environment variable <code>GCC_EXEC_PREFIX</code> or, if <code>GCC_EXEC_PREFIX</code>
|
||||
is not set and the compiler has not been installed in the configure-time
|
||||
<var>prefix</var>, the location in which the compiler has actually been installed.
|
||||
|
||||
<li>The directories specified by the environment variable <code>COMPILER_PATH</code>.
|
||||
|
||||
<li>The macro <code>STANDARD_EXEC_PREFIX</code>, if the compiler has been installed
|
||||
in the configured-time <var>prefix</var>.
|
||||
|
||||
<li>The location <samp><span class="file">/usr/libexec/gcc/</span></samp>, but only if this is a native compiler.
|
||||
|
||||
<li>The location <samp><span class="file">/usr/lib/gcc/</span></samp>, but only if this is a native compiler.
|
||||
|
||||
<li>The macro <code>MD_EXEC_PREFIX</code>, if defined, but only if this is a native
|
||||
compiler.
|
||||
</ol>
|
||||
|
||||
<p>Here is the order of prefixes tried for startfiles:
|
||||
|
||||
<ol type=1 start=1>
|
||||
<li>Any prefixes specified by the user with <samp><span class="option">-B</span></samp>.
|
||||
|
||||
<li>The environment variable <code>GCC_EXEC_PREFIX</code> or its automatically determined
|
||||
value based on the installed toolchain location.
|
||||
|
||||
<li>The directories specified by the environment variable <code>LIBRARY_PATH</code>
|
||||
(or port-specific name; native only, cross compilers do not use this).
|
||||
|
||||
<li>The macro <code>STANDARD_EXEC_PREFIX</code>, but only if the toolchain is installed
|
||||
in the configured <var>prefix</var> or this is a native compiler.
|
||||
|
||||
<li>The location <samp><span class="file">/usr/lib/gcc/</span></samp>, but only if this is a native compiler.
|
||||
|
||||
<li>The macro <code>MD_EXEC_PREFIX</code>, if defined, but only if this is a native
|
||||
compiler.
|
||||
|
||||
<li>The macro <code>MD_STARTFILE_PREFIX</code>, if defined, but only if this is a
|
||||
native compiler, or we have a target system root.
|
||||
|
||||
<li>The macro <code>MD_STARTFILE_PREFIX_1</code>, if defined, but only if this is a
|
||||
native compiler, or we have a target system root.
|
||||
|
||||
<li>The macro <code>STANDARD_STARTFILE_PREFIX</code>, with any sysroot modifications.
|
||||
If this path is relative it will be prefixed by <code>GCC_EXEC_PREFIX</code> and
|
||||
the machine suffix or <code>STANDARD_EXEC_PREFIX</code> and the machine suffix.
|
||||
|
||||
<li>The macro <code>STANDARD_STARTFILE_PREFIX_1</code>, but only if this is a native
|
||||
compiler, or we have a target system root. The default for this macro is
|
||||
<samp><span class="file">/lib/</span></samp>.
|
||||
|
||||
<li>The macro <code>STANDARD_STARTFILE_PREFIX_2</code>, but only if this is a native
|
||||
compiler, or we have a target system root. The default for this macro is
|
||||
<samp><span class="file">/usr/lib/</span></samp>.
|
||||
</ol>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Edges - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Control-Flow.html#Control-Flow" title="Control Flow">
|
||||
<link rel="prev" href="Basic-Blocks.html#Basic-Blocks" title="Basic Blocks">
|
||||
<link rel="next" href="Profile-information.html#Profile-information" title="Profile information">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Edges"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Profile-information.html#Profile-information">Profile information</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Basic-Blocks.html#Basic-Blocks">Basic Blocks</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Control-Flow.html#Control-Flow">Control Flow</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">15.2 Edges</h3>
|
||||
|
||||
<p><a name="index-edge-in-the-flow-graph-3135"></a><a name="index-edge-3136"></a>Edges represent possible control flow transfers from the end of some
|
||||
basic block A to the head of another basic block B. We say that A is
|
||||
a predecessor of B, and B is a successor of A. Edges are represented
|
||||
in GCC with the <code>edge</code> data type. Each <code>edge</code> acts as a
|
||||
link between two basic blocks: The <code>src</code> member of an edge
|
||||
points to the predecessor basic block of the <code>dest</code> basic block.
|
||||
The members <code>preds</code> and <code>succs</code> of the <code>basic_block</code> data
|
||||
type point to type-safe vectors of edges to the predecessors and
|
||||
successors of the block.
|
||||
|
||||
<p><a name="index-edge-iterators-3137"></a>When walking the edges in an edge vector, <dfn>edge iterators</dfn> should
|
||||
be used. Edge iterators are constructed using the
|
||||
<code>edge_iterator</code> data structure and several methods are available
|
||||
to operate on them:
|
||||
|
||||
<dl>
|
||||
<dt><code>ei_start</code><a name="index-ei_005fstart-3138"></a><dd>This function initializes an <code>edge_iterator</code> that points to the
|
||||
first edge in a vector of edges.
|
||||
|
||||
<br><dt><code>ei_last</code><a name="index-ei_005flast-3139"></a><dd>This function initializes an <code>edge_iterator</code> that points to the
|
||||
last edge in a vector of edges.
|
||||
|
||||
<br><dt><code>ei_end_p</code><a name="index-ei_005fend_005fp-3140"></a><dd>This predicate is <code>true</code> if an <code>edge_iterator</code> represents
|
||||
the last edge in an edge vector.
|
||||
|
||||
<br><dt><code>ei_one_before_end_p</code><a name="index-ei_005fone_005fbefore_005fend_005fp-3141"></a><dd>This predicate is <code>true</code> if an <code>edge_iterator</code> represents
|
||||
the second last edge in an edge vector.
|
||||
|
||||
<br><dt><code>ei_next</code><a name="index-ei_005fnext-3142"></a><dd>This function takes a pointer to an <code>edge_iterator</code> and makes it
|
||||
point to the next edge in the sequence.
|
||||
|
||||
<br><dt><code>ei_prev</code><a name="index-ei_005fprev-3143"></a><dd>This function takes a pointer to an <code>edge_iterator</code> and makes it
|
||||
point to the previous edge in the sequence.
|
||||
|
||||
<br><dt><code>ei_edge</code><a name="index-ei_005fedge-3144"></a><dd>This function returns the <code>edge</code> currently pointed to by an
|
||||
<code>edge_iterator</code>.
|
||||
|
||||
<br><dt><code>ei_safe_safe</code><a name="index-ei_005fsafe_005fsafe-3145"></a><dd>This function returns the <code>edge</code> currently pointed to by an
|
||||
<code>edge_iterator</code>, but returns <code>NULL</code> if the iterator is
|
||||
pointing at the end of the sequence. This function has been provided
|
||||
for existing code makes the assumption that a <code>NULL</code> edge
|
||||
indicates the end of the sequence.
|
||||
|
||||
</dl>
|
||||
|
||||
<p>The convenience macro <code>FOR_EACH_EDGE</code> can be used to visit all of
|
||||
the edges in a sequence of predecessor or successor edges. It must
|
||||
not be used when an element might be removed during the traversal,
|
||||
otherwise elements will be missed. Here is an example of how to use
|
||||
the macro:
|
||||
|
||||
<pre class="smallexample"> edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
{
|
||||
if (e->flags & EDGE_FALLTHRU)
|
||||
break;
|
||||
}
|
||||
</pre>
|
||||
<p><a name="index-fall_002dthru-3146"></a>There are various reasons why control flow may transfer from one block
|
||||
to another. One possibility is that some instruction, for example a
|
||||
<code>CODE_LABEL</code>, in a linearized instruction stream just always
|
||||
starts a new basic block. In this case a <dfn>fall-thru</dfn> edge links
|
||||
the basic block to the first following basic block. But there are
|
||||
several other reasons why edges may be created. The <code>flags</code>
|
||||
field of the <code>edge</code> data type is used to store information
|
||||
about the type of edge we are dealing with. Each edge is of one of
|
||||
the following types:
|
||||
|
||||
<dl>
|
||||
<dt><em>jump</em><dd>No type flags are set for edges corresponding to jump instructions.
|
||||
These edges are used for unconditional or conditional jumps and in
|
||||
RTL also for table jumps. They are the easiest to manipulate as they
|
||||
may be freely redirected when the flow graph is not in SSA form.
|
||||
|
||||
<br><dt><em>fall-thru</em><dd><a name="index-EDGE_005fFALLTHRU_002c-force_005fnonfallthru-3147"></a>Fall-thru edges are present in case where the basic block may continue
|
||||
execution to the following one without branching. These edges have
|
||||
the <code>EDGE_FALLTHRU</code> flag set. Unlike other types of edges, these
|
||||
edges must come into the basic block immediately following in the
|
||||
instruction stream. The function <code>force_nonfallthru</code> is
|
||||
available to insert an unconditional jump in the case that redirection
|
||||
is needed. Note that this may require creation of a new basic block.
|
||||
|
||||
<br><dt><em>exception handling</em><dd><a name="index-exception-handling-3148"></a><a name="index-EDGE_005fABNORMAL_002c-EDGE_005fEH-3149"></a>Exception handling edges represent possible control transfers from a
|
||||
trapping instruction to an exception handler. The definition of
|
||||
“trapping” varies. In C++, only function calls can throw, but for
|
||||
Java and Ada, exceptions like division by zero or segmentation fault are
|
||||
defined and thus each instruction possibly throwing this kind of
|
||||
exception needs to be handled as control flow instruction. Exception
|
||||
edges have the <code>EDGE_ABNORMAL</code> and <code>EDGE_EH</code> flags set.
|
||||
|
||||
<p><a name="index-purge_005fdead_005fedges-3150"></a>When updating the instruction stream it is easy to change possibly
|
||||
trapping instruction to non-trapping, by simply removing the exception
|
||||
edge. The opposite conversion is difficult, but should not happen
|
||||
anyway. The edges can be eliminated via <code>purge_dead_edges</code> call.
|
||||
|
||||
<p><a name="index-REG_005fEH_005fREGION_002c-EDGE_005fABNORMAL_005fCALL-3151"></a>In the RTL representation, the destination of an exception edge is
|
||||
specified by <code>REG_EH_REGION</code> note attached to the insn.
|
||||
In case of a trapping call the <code>EDGE_ABNORMAL_CALL</code> flag is set
|
||||
too. In the <code>GIMPLE</code> representation, this extra flag is not set.
|
||||
|
||||
<p><a name="index-may_005ftrap_005fp_002c-tree_005fcould_005ftrap_005fp-3152"></a>In the RTL representation, the predicate <code>may_trap_p</code> may be used
|
||||
to check whether instruction still may trap or not. For the tree
|
||||
representation, the <code>tree_could_trap_p</code> predicate is available,
|
||||
but this predicate only checks for possible memory traps, as in
|
||||
dereferencing an invalid pointer location.
|
||||
|
||||
<br><dt><em>sibling calls</em><dd><a name="index-sibling-call-3153"></a><a name="index-EDGE_005fABNORMAL_002c-EDGE_005fSIBCALL-3154"></a>Sibling calls or tail calls terminate the function in a non-standard
|
||||
way and thus an edge to the exit must be present.
|
||||
<code>EDGE_SIBCALL</code> and <code>EDGE_ABNORMAL</code> are set in such case.
|
||||
These edges only exist in the RTL representation.
|
||||
|
||||
<br><dt><em>computed jumps</em><dd><a name="index-computed-jump-3155"></a><a name="index-EDGE_005fABNORMAL-3156"></a>Computed jumps contain edges to all labels in the function referenced
|
||||
from the code. All those edges have <code>EDGE_ABNORMAL</code> flag set.
|
||||
The edges used to represent computed jumps often cause compile time
|
||||
performance problems, since functions consisting of many taken labels
|
||||
and many computed jumps may have <em>very</em> dense flow graphs, so
|
||||
these edges need to be handled with special care. During the earlier
|
||||
stages of the compilation process, GCC tries to avoid such dense flow
|
||||
graphs by factoring computed jumps. For example, given the following
|
||||
series of jumps,
|
||||
|
||||
<pre class="smallexample"> goto *x;
|
||||
[ ... ]
|
||||
|
||||
goto *x;
|
||||
[ ... ]
|
||||
|
||||
goto *x;
|
||||
[ ... ]
|
||||
</pre>
|
||||
<p class="noindent">factoring the computed jumps results in the following code sequence
|
||||
which has a much simpler flow graph:
|
||||
|
||||
<pre class="smallexample"> goto y;
|
||||
[ ... ]
|
||||
|
||||
goto y;
|
||||
[ ... ]
|
||||
|
||||
goto y;
|
||||
[ ... ]
|
||||
|
||||
y:
|
||||
goto *x;
|
||||
</pre>
|
||||
<p><a name="index-pass_005fduplicate_005fcomputed_005fgotos-3157"></a>However, the classic problem with this transformation is that it has a
|
||||
runtime cost in there resulting code: An extra jump. Therefore, the
|
||||
computed jumps are un-factored in the later passes of the compiler
|
||||
(in the pass called <code>pass_duplicate_computed_gotos</code>).
|
||||
Be aware of that when you work on passes in that area. There have
|
||||
been numerous examples already where the compile time for code with
|
||||
unfactored computed jumps caused some serious headaches.
|
||||
|
||||
<br><dt><em>nonlocal goto handlers</em><dd><a name="index-nonlocal-goto-handler-3158"></a><a name="index-EDGE_005fABNORMAL_002c-EDGE_005fABNORMAL_005fCALL-3159"></a>GCC allows nested functions to return into caller using a <code>goto</code>
|
||||
to a label passed to as an argument to the callee. The labels passed
|
||||
to nested functions contain special code to cleanup after function
|
||||
call. Such sections of code are referred to as “nonlocal goto
|
||||
receivers”. If a function contains such nonlocal goto receivers, an
|
||||
edge from the call to the label is created with the
|
||||
<code>EDGE_ABNORMAL</code> and <code>EDGE_ABNORMAL_CALL</code> flags set.
|
||||
|
||||
<br><dt><em>function entry points</em><dd><a name="index-function-entry-point_002c-alternate-function-entry-point-3160"></a><a name="index-LABEL_005fALTERNATE_005fNAME-3161"></a>By definition, execution of function starts at basic block 0, so there
|
||||
is always an edge from the <code>ENTRY_BLOCK_PTR</code> to basic block 0.
|
||||
There is no <code>GIMPLE</code> representation for alternate entry points at
|
||||
this moment. In RTL, alternate entry points are specified by
|
||||
<code>CODE_LABEL</code> with <code>LABEL_ALTERNATE_NAME</code> defined. This
|
||||
feature is currently used for multiple entry point prologues and is
|
||||
limited to post-reload passes only. This can be used by back-ends to
|
||||
emit alternate prologues for functions called from different contexts.
|
||||
In future full support for multiple entry functions defined by Fortran
|
||||
90 needs to be implemented.
|
||||
|
||||
<br><dt><em>function exits</em><dd>In the pre-reload representation a function terminates after the last
|
||||
instruction in the insn chain and no explicit return instructions are
|
||||
used. This corresponds to the fall-thru edge into exit block. After
|
||||
reload, optimal RTL epilogues are used that use explicit (conditional)
|
||||
return instructions that are represented by edges with no flags set.
|
||||
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,549 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Effective-Target Keywords - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Test-Directives.html#Test-Directives" title="Test Directives">
|
||||
<link rel="prev" href="Selectors.html#Selectors" title="Selectors">
|
||||
<link rel="next" href="Add-Options.html#Add-Options" title="Add Options">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Effective-Target-Keywords"></a>
|
||||
<a name="Effective_002dTarget-Keywords"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Add-Options.html#Add-Options">Add Options</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Selectors.html#Selectors">Selectors</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Test-Directives.html#Test-Directives">Test Directives</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">7.2.3 Keywords describing target attributes</h4>
|
||||
|
||||
<p>Effective-target keywords identify sets of targets that support
|
||||
particular functionality. They are used to limit tests to be run only
|
||||
for particular targets, or to specify that particular sets of targets
|
||||
are expected to fail some tests.
|
||||
|
||||
<p>Effective-target keywords are defined in <samp><span class="file">lib/target-supports.exp</span></samp> in
|
||||
the GCC testsuite, with the exception of those that are documented as
|
||||
being local to a particular test directory.
|
||||
|
||||
<p>The ‘<samp><span class="samp">effective target</span></samp>’ takes into account all of the compiler options
|
||||
with which the test will be compiled, including the multilib options.
|
||||
By convention, keywords ending in <code>_nocache</code> can also include options
|
||||
specified for the particular test in an earlier <code>dg-options</code> or
|
||||
<code>dg-add-options</code> directive.
|
||||
|
||||
<h5 class="subsubsection">7.2.3.1 Data type sizes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>ilp32</code><dd>Target has 32-bit <code>int</code>, <code>long</code>, and pointers.
|
||||
|
||||
<br><dt><code>lp64</code><dd>Target has 32-bit <code>int</code>, 64-bit <code>long</code> and pointers.
|
||||
|
||||
<br><dt><code>llp64</code><dd>Target has 32-bit <code>int</code> and <code>long</code>, 64-bit <code>long long</code>
|
||||
and pointers.
|
||||
|
||||
<br><dt><code>double64</code><dd>Target has 64-bit <code>double</code>.
|
||||
|
||||
<br><dt><code>double64plus</code><dd>Target has <code>double</code> that is 64 bits or longer.
|
||||
|
||||
<br><dt><code>int32plus</code><dd>Target has <code>int</code> that is at 32 bits or longer.
|
||||
|
||||
<br><dt><code>int16</code><dd>Target has <code>int</code> that is 16 bits or shorter.
|
||||
|
||||
<br><dt><code>long_neq_int</code><dd>Target has <code>int</code> and <code>long</code> with different sizes.
|
||||
|
||||
<br><dt><code>large_double</code><dd>Target supports <code>double</code> that is longer than <code>float</code>.
|
||||
|
||||
<br><dt><code>large_long_double</code><dd>Target supports <code>long double</code> that is longer than <code>double</code>.
|
||||
|
||||
<br><dt><code>ptr32plus</code><dd>Target has pointers that are 32 bits or longer.
|
||||
|
||||
<br><dt><code>size32plus</code><dd>Target supports array and structure sizes that are 32 bits or longer.
|
||||
|
||||
<br><dt><code>4byte_wchar_t</code><dd>Target has <code>wchar_t</code> that is at least 4 bytes.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.2 Fortran-specific attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>fortran_integer_16</code><dd>Target supports Fortran <code>integer</code> that is 16 bytes or longer.
|
||||
|
||||
<br><dt><code>fortran_large_int</code><dd>Target supports Fortran <code>integer</code> kinds larger than <code>integer(8)</code>.
|
||||
|
||||
<br><dt><code>fortran_large_real</code><dd>Target supports Fortran <code>real</code> kinds larger than <code>real(8)</code>.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.3 Vector-specific attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>vect_condition</code><dd>Target supports vector conditional operations.
|
||||
|
||||
<br><dt><code>vect_double</code><dd>Target supports hardware vectors of <code>double</code>.
|
||||
|
||||
<br><dt><code>vect_float</code><dd>Target supports hardware vectors of <code>float</code>.
|
||||
|
||||
<br><dt><code>vect_int</code><dd>Target supports hardware vectors of <code>int</code>.
|
||||
|
||||
<br><dt><code>vect_long</code><dd>Target supports hardware vectors of <code>long</code>.
|
||||
|
||||
<br><dt><code>vect_long_long</code><dd>Target supports hardware vectors of <code>long long</code>.
|
||||
|
||||
<br><dt><code>vect_aligned_arrays</code><dd>Target aligns arrays to vector alignment boundary.
|
||||
|
||||
<br><dt><code>vect_hw_misalign</code><dd>Target supports a vector misalign access.
|
||||
|
||||
<br><dt><code>vect_no_align</code><dd>Target does not support a vector alignment mechanism.
|
||||
|
||||
<br><dt><code>vect_no_int_max</code><dd>Target does not support a vector max instruction on <code>int</code>.
|
||||
|
||||
<br><dt><code>vect_no_int_add</code><dd>Target does not support a vector add instruction on <code>int</code>.
|
||||
|
||||
<br><dt><code>vect_no_bitwise</code><dd>Target does not support vector bitwise instructions.
|
||||
|
||||
<br><dt><code>vect_char_mult</code><dd>Target supports <code>vector char</code> multiplication.
|
||||
|
||||
<br><dt><code>vect_short_mult</code><dd>Target supports <code>vector short</code> multiplication.
|
||||
|
||||
<br><dt><code>vect_int_mult</code><dd>Target supports <code>vector int</code> multiplication.
|
||||
|
||||
<br><dt><code>vect_extract_even_odd</code><dd>Target supports vector even/odd element extraction.
|
||||
|
||||
<br><dt><code>vect_extract_even_odd_wide</code><dd>Target supports vector even/odd element extraction of vectors with elements
|
||||
<code>SImode</code> or larger.
|
||||
|
||||
<br><dt><code>vect_interleave</code><dd>Target supports vector interleaving.
|
||||
|
||||
<br><dt><code>vect_strided</code><dd>Target supports vector interleaving and extract even/odd.
|
||||
|
||||
<br><dt><code>vect_strided_wide</code><dd>Target supports vector interleaving and extract even/odd for wide
|
||||
element types.
|
||||
|
||||
<br><dt><code>vect_perm</code><dd>Target supports vector permutation.
|
||||
|
||||
<br><dt><code>vect_shift</code><dd>Target supports a hardware vector shift operation.
|
||||
|
||||
<br><dt><code>vect_widen_sum_hi_to_si</code><dd>Target supports a vector widening summation of <code>short</code> operands
|
||||
into <code>int</code> results, or can promote (unpack) from <code>short</code>
|
||||
to <code>int</code>.
|
||||
|
||||
<br><dt><code>vect_widen_sum_qi_to_hi</code><dd>Target supports a vector widening summation of <code>char</code> operands
|
||||
into <code>short</code> results, or can promote (unpack) from <code>char</code>
|
||||
to <code>short</code>.
|
||||
|
||||
<br><dt><code>vect_widen_sum_qi_to_si</code><dd>Target supports a vector widening summation of <code>char</code> operands
|
||||
into <code>int</code> results.
|
||||
|
||||
<br><dt><code>vect_widen_mult_qi_to_hi</code><dd>Target supports a vector widening multiplication of <code>char</code> operands
|
||||
into <code>short</code> results, or can promote (unpack) from <code>char</code> to
|
||||
<code>short</code> and perform non-widening multiplication of <code>short</code>.
|
||||
|
||||
<br><dt><code>vect_widen_mult_hi_to_si</code><dd>Target supports a vector widening multiplication of <code>short</code> operands
|
||||
into <code>int</code> results, or can promote (unpack) from <code>short</code> to
|
||||
<code>int</code> and perform non-widening multiplication of <code>int</code>.
|
||||
|
||||
<br><dt><code>vect_sdot_qi</code><dd>Target supports a vector dot-product of <code>signed char</code>.
|
||||
|
||||
<br><dt><code>vect_udot_qi</code><dd>Target supports a vector dot-product of <code>unsigned char</code>.
|
||||
|
||||
<br><dt><code>vect_sdot_hi</code><dd>Target supports a vector dot-product of <code>signed short</code>.
|
||||
|
||||
<br><dt><code>vect_udot_hi</code><dd>Target supports a vector dot-product of <code>unsigned short</code>.
|
||||
|
||||
<br><dt><code>vect_pack_trunc</code><dd>Target supports a vector demotion (packing) of <code>short</code> to <code>char</code>
|
||||
and from <code>int</code> to <code>short</code> using modulo arithmetic.
|
||||
|
||||
<br><dt><code>vect_unpack</code><dd>Target supports a vector promotion (unpacking) of <code>char</code> to <code>short</code>
|
||||
and from <code>char</code> to <code>int</code>.
|
||||
|
||||
<br><dt><code>vect_intfloat_cvt</code><dd>Target supports conversion from <code>signed int</code> to <code>float</code>.
|
||||
|
||||
<br><dt><code>vect_uintfloat_cvt</code><dd>Target supports conversion from <code>unsigned int</code> to <code>float</code>.
|
||||
|
||||
<br><dt><code>vect_floatint_cvt</code><dd>Target supports conversion from <code>float</code> to <code>signed int</code>.
|
||||
|
||||
<br><dt><code>vect_floatuint_cvt</code><dd>Target supports conversion from <code>float</code> to <code>unsigned int</code>.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.4 Thread Local Storage attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>tls</code><dd>Target supports thread-local storage.
|
||||
|
||||
<br><dt><code>tls_native</code><dd>Target supports native (rather than emulated) thread-local storage.
|
||||
|
||||
<br><dt><code>tls_runtime</code><dd>Test system supports executing TLS executables.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.5 Decimal floating point attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>dfp</code><dd>Targets supports compiling decimal floating point extension to C.
|
||||
|
||||
<br><dt><code>dfp_nocache</code><dd>Including the options used to compile this particular test, the
|
||||
target supports compiling decimal floating point extension to C.
|
||||
|
||||
<br><dt><code>dfprt</code><dd>Test system can execute decimal floating point tests.
|
||||
|
||||
<br><dt><code>dfprt_nocache</code><dd>Including the options used to compile this particular test, the
|
||||
test system can execute decimal floating point tests.
|
||||
|
||||
<br><dt><code>hard_dfp</code><dd>Target generates decimal floating point instructions with current options.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.6 ARM-specific attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>arm32</code><dd>ARM target generates 32-bit code.
|
||||
|
||||
<br><dt><code>arm_eabi</code><dd>ARM target adheres to the ABI for the ARM Architecture.
|
||||
|
||||
<br><dt><code>arm_hf_eabi</code><dd>ARM target adheres to the VFP and Advanced SIMD Register Arguments
|
||||
variant of the ABI for the ARM Architecture (as selected with
|
||||
<code>-mfloat-abi=hard</code>).
|
||||
|
||||
<br><dt><code>arm_hard_vfp_ok</code><dd>ARM target supports <code>-mfpu=vfp -mfloat-abi=hard</code>.
|
||||
Some multilibs may be incompatible with these options.
|
||||
|
||||
<br><dt><code>arm_iwmmxt_ok</code><dd>ARM target supports <code>-mcpu=iwmmxt</code>.
|
||||
Some multilibs may be incompatible with this option.
|
||||
|
||||
<br><dt><code>arm_neon</code><dd>ARM target supports generating NEON instructions.
|
||||
|
||||
<br><dt><code>arm_neon_hw</code><dd>Test system supports executing NEON instructions.
|
||||
|
||||
<br><dt><code>arm_neonv2_hw</code><dd>Test system supports executing NEON v2 instructions.
|
||||
|
||||
<br><dt><code>arm_neon_ok</code><dd><a name="arm_005fneon_005fok"></a>ARM Target supports <code>-mfpu=neon -mfloat-abi=softfp</code> or compatible
|
||||
options. Some multilibs may be incompatible with these options.
|
||||
|
||||
<br><dt><code>arm_neonv2_ok</code><dd><a name="arm_005fneonv2_005fok"></a>ARM Target supports <code>-mfpu=neon-vfpv4 -mfloat-abi=softfp</code> or compatible
|
||||
options. Some multilibs may be incompatible with these options.
|
||||
|
||||
<br><dt><code>arm_neon_fp16_ok</code><dd><a name="arm_005fneon_005ffp16_005fok"></a>ARM Target supports <code>-mfpu=neon-fp16 -mfloat-abi=softfp</code> or compatible
|
||||
options. Some multilibs may be incompatible with these options.
|
||||
|
||||
<br><dt><code>arm_thumb1_ok</code><dd>ARM target generates Thumb-1 code for <code>-mthumb</code>.
|
||||
|
||||
<br><dt><code>arm_thumb2_ok</code><dd>ARM target generates Thumb-2 code for <code>-mthumb</code>.
|
||||
|
||||
<br><dt><code>arm_vfp_ok</code><dd>ARM target supports <code>-mfpu=vfp -mfloat-abi=softfp</code>.
|
||||
Some multilibs may be incompatible with these options.
|
||||
|
||||
<br><dt><code>arm_v8_vfp_ok</code><dd>ARM target supports <code>-mfpu=fp-armv8 -mfloat-abi=softfp</code>.
|
||||
Some multilibs may be incompatible with these options.
|
||||
|
||||
<br><dt><code>arm_v8_neon_ok</code><dd>ARM target supports <code>-mfpu=neon-fp-armv8 -mfloat-abi=softfp</code>.
|
||||
Some multilibs may be incompatible with these options.
|
||||
|
||||
<br><dt><code>arm_prefer_ldrd_strd</code><dd>ARM target prefers <code>LDRD</code> and <code>STRD</code> instructions over
|
||||
<code>LDM</code> and <code>STM</code> instructions.
|
||||
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.7 MIPS-specific attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>mips64</code><dd>MIPS target supports 64-bit instructions.
|
||||
|
||||
<br><dt><code>nomips16</code><dd>MIPS target does not produce MIPS16 code.
|
||||
|
||||
<br><dt><code>mips16_attribute</code><dd>MIPS target can generate MIPS16 code.
|
||||
|
||||
<br><dt><code>mips_loongson</code><dd>MIPS target is a Loongson-2E or -2F target using an ABI that supports
|
||||
the Loongson vector modes.
|
||||
|
||||
<br><dt><code>mips_newabi_large_long_double</code><dd>MIPS target supports <code>long double</code> larger than <code>double</code>
|
||||
when using the new ABI.
|
||||
|
||||
<br><dt><code>mpaired_single</code><dd>MIPS target supports <code>-mpaired-single</code>.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.8 PowerPC-specific attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>powerpc64</code><dd>Test system supports executing 64-bit instructions.
|
||||
|
||||
<br><dt><code>powerpc_altivec</code><dd>PowerPC target supports AltiVec.
|
||||
|
||||
<br><dt><code>powerpc_altivec_ok</code><dd>PowerPC target supports <code>-maltivec</code>.
|
||||
|
||||
<br><dt><code>powerpc_fprs</code><dd>PowerPC target supports floating-point registers.
|
||||
|
||||
<br><dt><code>powerpc_hard_double</code><dd>PowerPC target supports hardware double-precision floating-point.
|
||||
|
||||
<br><dt><code>powerpc_ppu_ok</code><dd>PowerPC target supports <code>-mcpu=cell</code>.
|
||||
|
||||
<br><dt><code>powerpc_spe</code><dd>PowerPC target supports PowerPC SPE.
|
||||
|
||||
<br><dt><code>powerpc_spe_nocache</code><dd>Including the options used to compile this particular test, the
|
||||
PowerPC target supports PowerPC SPE.
|
||||
|
||||
<br><dt><code>powerpc_spu</code><dd>PowerPC target supports PowerPC SPU.
|
||||
|
||||
<br><dt><code>spu_auto_overlay</code><dd>SPU target has toolchain that supports automatic overlay generation.
|
||||
|
||||
<br><dt><code>powerpc_vsx_ok</code><dd>PowerPC target supports <code>-mvsx</code>.
|
||||
|
||||
<br><dt><code>powerpc_405_nocache</code><dd>Including the options used to compile this particular test, the
|
||||
PowerPC target supports PowerPC 405.
|
||||
|
||||
<br><dt><code>vmx_hw</code><dd>PowerPC target supports executing AltiVec instructions.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.9 Other hardware attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>avx</code><dd>Target supports compiling <code>avx</code> instructions.
|
||||
|
||||
<br><dt><code>avx_runtime</code><dd>Target supports the execution of <code>avx</code> instructions.
|
||||
|
||||
<br><dt><code>cell_hw</code><dd>Test system can execute AltiVec and Cell PPU instructions.
|
||||
|
||||
<br><dt><code>coldfire_fpu</code><dd>Target uses a ColdFire FPU.
|
||||
|
||||
<br><dt><code>hard_float</code><dd>Target supports FPU instructions.
|
||||
|
||||
<br><dt><code>sse</code><dd>Target supports compiling <code>sse</code> instructions.
|
||||
|
||||
<br><dt><code>sse_runtime</code><dd>Target supports the execution of <code>sse</code> instructions.
|
||||
|
||||
<br><dt><code>sse2</code><dd>Target supports compiling <code>sse2</code> instructions.
|
||||
|
||||
<br><dt><code>sse2_runtime</code><dd>Target supports the execution of <code>sse2</code> instructions.
|
||||
|
||||
<br><dt><code>sync_char_short</code><dd>Target supports atomic operations on <code>char</code> and <code>short</code>.
|
||||
|
||||
<br><dt><code>sync_int_long</code><dd>Target supports atomic operations on <code>int</code> and <code>long</code>.
|
||||
|
||||
<br><dt><code>ultrasparc_hw</code><dd>Test environment appears to run executables on a simulator that
|
||||
accepts only <code>EM_SPARC</code> executables and chokes on <code>EM_SPARC32PLUS</code>
|
||||
or <code>EM_SPARCV9</code> executables.
|
||||
|
||||
<br><dt><code>vect_cmdline_needed</code><dd>Target requires a command line argument to enable a SIMD instruction set.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.10 Environment attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>c</code><dd>The language for the compiler under test is C.
|
||||
|
||||
<br><dt><code>c++</code><dd>The language for the compiler under test is C++.
|
||||
|
||||
<br><dt><code>c99_runtime</code><dd>Target provides a full C99 runtime.
|
||||
|
||||
<br><dt><code>correct_iso_cpp_string_wchar_protos</code><dd>Target <code>string.h</code> and <code>wchar.h</code> headers provide C++ required
|
||||
overloads for <code>strchr</code> etc. functions.
|
||||
|
||||
<br><dt><code>dummy_wcsftime</code><dd>Target uses a dummy <code>wcsftime</code> function that always returns zero.
|
||||
|
||||
<br><dt><code>fd_truncate</code><dd>Target can truncate a file from a file descriptor, as used by
|
||||
<samp><span class="file">libgfortran/io/unix.c:fd_truncate</span></samp>; i.e. <code>ftruncate</code> or
|
||||
<code>chsize</code>.
|
||||
|
||||
<br><dt><code>freestanding</code><dd>Target is ‘<samp><span class="samp">freestanding</span></samp>’ as defined in section 4 of the C99 standard.
|
||||
Effectively, it is a target which supports no extra headers or libraries
|
||||
other than what is considered essential.
|
||||
|
||||
<br><dt><code>init_priority</code><dd>Target supports constructors with initialization priority arguments.
|
||||
|
||||
<br><dt><code>inttypes_types</code><dd>Target has the basic signed and unsigned types in <code>inttypes.h</code>.
|
||||
This is for tests that GCC's notions of these types agree with those
|
||||
in the header, as some systems have only <code>inttypes.h</code>.
|
||||
|
||||
<br><dt><code>lax_strtofp</code><dd>Target might have errors of a few ULP in string to floating-point
|
||||
conversion functions and overflow is not always detected correctly by
|
||||
those functions.
|
||||
|
||||
<br><dt><code>mmap</code><dd>Target supports <code>mmap</code>.
|
||||
|
||||
<br><dt><code>newlib</code><dd>Target supports Newlib.
|
||||
|
||||
<br><dt><code>pow10</code><dd>Target provides <code>pow10</code> function.
|
||||
|
||||
<br><dt><code>pthread</code><dd>Target can compile using <code>pthread.h</code> with no errors or warnings.
|
||||
|
||||
<br><dt><code>pthread_h</code><dd>Target has <code>pthread.h</code>.
|
||||
|
||||
<br><dt><code>run_expensive_tests</code><dd>Expensive testcases (usually those that consume excessive amounts of CPU
|
||||
time) should be run on this target. This can be enabled by setting the
|
||||
<samp><span class="env">GCC_TEST_RUN_EXPENSIVE</span></samp> environment variable to a non-empty string.
|
||||
|
||||
<br><dt><code>simulator</code><dd>Test system runs executables on a simulator (i.e. slowly) rather than
|
||||
hardware (i.e. fast).
|
||||
|
||||
<br><dt><code>stdint_types</code><dd>Target has the basic signed and unsigned C types in <code>stdint.h</code>.
|
||||
This will be obsolete when GCC ensures a working <code>stdint.h</code> for
|
||||
all targets.
|
||||
|
||||
<br><dt><code>trampolines</code><dd>Target supports trampolines.
|
||||
|
||||
<br><dt><code>uclibc</code><dd>Target supports uClibc.
|
||||
|
||||
<br><dt><code>unwrapped</code><dd>Target does not use a status wrapper.
|
||||
|
||||
<br><dt><code>vxworks_kernel</code><dd>Target is a VxWorks kernel.
|
||||
|
||||
<br><dt><code>vxworks_rtp</code><dd>Target is a VxWorks RTP.
|
||||
|
||||
<br><dt><code>wchar</code><dd>Target supports wide characters.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.11 Other attributes</h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>automatic_stack_alignment</code><dd>Target supports automatic stack alignment.
|
||||
|
||||
<br><dt><code>cxa_atexit</code><dd>Target uses <code>__cxa_atexit</code>.
|
||||
|
||||
<br><dt><code>default_packed</code><dd>Target has packed layout of structure members by default.
|
||||
|
||||
<br><dt><code>fgraphite</code><dd>Target supports Graphite optimizations.
|
||||
|
||||
<br><dt><code>fixed_point</code><dd>Target supports fixed-point extension to C.
|
||||
|
||||
<br><dt><code>fopenmp</code><dd>Target supports OpenMP via <samp><span class="option">-fopenmp</span></samp>.
|
||||
|
||||
<br><dt><code>fpic</code><dd>Target supports <samp><span class="option">-fpic</span></samp> and <samp><span class="option">-fPIC</span></samp>.
|
||||
|
||||
<br><dt><code>freorder</code><dd>Target supports <samp><span class="option">-freorder-blocks-and-partition</span></samp>.
|
||||
|
||||
<br><dt><code>fstack_protector</code><dd>Target supports <samp><span class="option">-fstack-protector</span></samp>.
|
||||
|
||||
<br><dt><code>gas</code><dd>Target uses GNU <samp><span class="command">as</span></samp>.
|
||||
|
||||
<br><dt><code>gc_sections</code><dd>Target supports <samp><span class="option">--gc-sections</span></samp>.
|
||||
|
||||
<br><dt><code>gld</code><dd>Target uses GNU <samp><span class="command">ld</span></samp>.
|
||||
|
||||
<br><dt><code>keeps_null_pointer_checks</code><dd>Target keeps null pointer checks, either due to the use of
|
||||
<samp><span class="option">-fno-delete-null-pointer-checks</span></samp> or hardwired into the target.
|
||||
|
||||
<br><dt><code>lto</code><dd>Compiler has been configured to support link-time optimization (LTO).
|
||||
|
||||
<br><dt><code>naked_functions</code><dd>Target supports the <code>naked</code> function attribute.
|
||||
|
||||
<br><dt><code>named_sections</code><dd>Target supports named sections.
|
||||
|
||||
<br><dt><code>natural_alignment_32</code><dd>Target uses natural alignment (aligned to type size) for types of
|
||||
32 bits or less.
|
||||
|
||||
<br><dt><code>target_natural_alignment_64</code><dd>Target uses natural alignment (aligned to type size) for types of
|
||||
64 bits or less.
|
||||
|
||||
<br><dt><code>nonpic</code><dd>Target does not generate PIC by default.
|
||||
|
||||
<br><dt><code>pcc_bitfield_type_matters</code><dd>Target defines <code>PCC_BITFIELD_TYPE_MATTERS</code>.
|
||||
|
||||
<br><dt><code>pe_aligned_commons</code><dd>Target supports <samp><span class="option">-mpe-aligned-commons</span></samp>.
|
||||
|
||||
<br><dt><code>pie</code><dd>Target supports <samp><span class="option">-pie</span></samp>, <samp><span class="option">-fpie</span></samp> and <samp><span class="option">-fPIE</span></samp>.
|
||||
|
||||
<br><dt><code>section_anchors</code><dd>Target supports section anchors.
|
||||
|
||||
<br><dt><code>short_enums</code><dd>Target defaults to short enums.
|
||||
|
||||
<br><dt><code>static</code><dd>Target supports <samp><span class="option">-static</span></samp>.
|
||||
|
||||
<br><dt><code>static_libgfortran</code><dd>Target supports statically linking ‘<samp><span class="samp">libgfortran</span></samp>’.
|
||||
|
||||
<br><dt><code>string_merging</code><dd>Target supports merging string constants at link time.
|
||||
|
||||
<br><dt><code>ucn</code><dd>Target supports compiling and assembling UCN.
|
||||
|
||||
<br><dt><code>ucn_nocache</code><dd>Including the options used to compile this particular test, the
|
||||
target supports compiling and assembling UCN.
|
||||
|
||||
<br><dt><code>unaligned_stack</code><dd>Target does not guarantee that its <code>STACK_BOUNDARY</code> is greater than
|
||||
or equal to the required vector alignment.
|
||||
|
||||
<br><dt><code>vector_alignment_reachable</code><dd>Vector alignment is reachable for types of 32 bits or less.
|
||||
|
||||
<br><dt><code>vector_alignment_reachable_for_64bit</code><dd>Vector alignment is reachable for types of 64 bits or less.
|
||||
|
||||
<br><dt><code>wchar_t_char16_t_compatible</code><dd>Target supports <code>wchar_t</code> that is compatible with <code>char16_t</code>.
|
||||
|
||||
<br><dt><code>wchar_t_char32_t_compatible</code><dd>Target supports <code>wchar_t</code> that is compatible with <code>char32_t</code>.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.12 Local to tests in <code>gcc.target/i386</code></h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>3dnow</code><dd>Target supports compiling <code>3dnow</code> instructions.
|
||||
|
||||
<br><dt><code>aes</code><dd>Target supports compiling <code>aes</code> instructions.
|
||||
|
||||
<br><dt><code>fma4</code><dd>Target supports compiling <code>fma4</code> instructions.
|
||||
|
||||
<br><dt><code>ms_hook_prologue</code><dd>Target supports attribute <code>ms_hook_prologue</code>.
|
||||
|
||||
<br><dt><code>pclmul</code><dd>Target supports compiling <code>pclmul</code> instructions.
|
||||
|
||||
<br><dt><code>sse3</code><dd>Target supports compiling <code>sse3</code> instructions.
|
||||
|
||||
<br><dt><code>sse4</code><dd>Target supports compiling <code>sse4</code> instructions.
|
||||
|
||||
<br><dt><code>sse4a</code><dd>Target supports compiling <code>sse4a</code> instructions.
|
||||
|
||||
<br><dt><code>ssse3</code><dd>Target supports compiling <code>ssse3</code> instructions.
|
||||
|
||||
<br><dt><code>vaes</code><dd>Target supports compiling <code>vaes</code> instructions.
|
||||
|
||||
<br><dt><code>vpclmul</code><dd>Target supports compiling <code>vpclmul</code> instructions.
|
||||
|
||||
<br><dt><code>xop</code><dd>Target supports compiling <code>xop</code> instructions.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.13 Local to tests in <code>gcc.target/spu/ea</code></h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>ealib</code><dd>Target <code>__ea</code> library functions are available.
|
||||
</dl>
|
||||
|
||||
<h5 class="subsubsection">7.2.3.14 Local to tests in <code>gcc.test-framework</code></h5>
|
||||
|
||||
<dl>
|
||||
<dt><code>no</code><dd>Always returns 0.
|
||||
|
||||
<br><dt><code>yes</code><dd>Always returns 1.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Elimination - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Stack-and-Calling.html#Stack-and-Calling" title="Stack and Calling">
|
||||
<link rel="prev" href="Frame-Registers.html#Frame-Registers" title="Frame Registers">
|
||||
<link rel="next" href="Stack-Arguments.html#Stack-Arguments" title="Stack Arguments">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Elimination"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Stack-Arguments.html#Stack-Arguments">Stack Arguments</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Frame-Registers.html#Frame-Registers">Frame Registers</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Stack-and-Calling.html#Stack-and-Calling">Stack and Calling</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.10.5 Eliminating Frame Pointer and Arg Pointer</h4>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>This is about eliminating the frame pointer and arg pointer.
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_FRAME_POINTER_REQUIRED</b> (<var>void</var>)<var><a name="index-TARGET_005fFRAME_005fPOINTER_005fREQUIRED-4162"></a></var><br>
|
||||
<blockquote><p>This target hook should return <code>true</code> if a function must have and use
|
||||
a frame pointer. This target hook is called in the reload pass. If its return
|
||||
value is <code>true</code> the function will have a frame pointer.
|
||||
|
||||
<p>This target hook can in principle examine the current function and decide
|
||||
according to the facts, but on most machines the constant <code>false</code> or the
|
||||
constant <code>true</code> suffices. Use <code>false</code> when the machine allows code
|
||||
to be generated with no frame pointer, and doing so saves some time or space.
|
||||
Use <code>true</code> when there is no possible advantage to avoiding a frame
|
||||
pointer.
|
||||
|
||||
<p>In certain cases, the compiler does not know how to produce valid code
|
||||
without a frame pointer. The compiler recognizes those cases and
|
||||
automatically gives the function a frame pointer regardless of what
|
||||
<code>TARGET_FRAME_POINTER_REQUIRED</code> returns. You don't need to worry about
|
||||
them.
|
||||
|
||||
<p>In a function that does not require a frame pointer, the frame pointer
|
||||
register can be allocated for ordinary usage, unless you mark it as a
|
||||
fixed register. See <code>FIXED_REGISTERS</code> for more information.
|
||||
|
||||
<p>Default return value is <code>false</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p><a name="index-get_005fframe_005fsize-4163"></a>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>INITIAL_FRAME_POINTER_OFFSET</b> (<var>depth-var</var>)<var><a name="index-INITIAL_005fFRAME_005fPOINTER_005fOFFSET-4164"></a></var><br>
|
||||
<blockquote><p>A C statement to store in the variable <var>depth-var</var> the difference
|
||||
between the frame pointer and the stack pointer values immediately after
|
||||
the function prologue. The value would be computed from information
|
||||
such as the result of <code>get_frame_size ()</code> and the tables of
|
||||
registers <code>regs_ever_live</code> and <code>call_used_regs</code>.
|
||||
|
||||
<p>If <code>ELIMINABLE_REGS</code> is defined, this macro will be not be used and
|
||||
need not be defined. Otherwise, it must be defined even if
|
||||
<code>TARGET_FRAME_POINTER_REQUIRED</code> always returns true; in that
|
||||
case, you may set <var>depth-var</var> to anything.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ELIMINABLE_REGS</b><var><a name="index-ELIMINABLE_005fREGS-4165"></a></var><br>
|
||||
<blockquote><p>If defined, this macro specifies a table of register pairs used to
|
||||
eliminate unneeded registers that point into the stack frame. If it is not
|
||||
defined, the only elimination attempted by the compiler is to replace
|
||||
references to the frame pointer with references to the stack pointer.
|
||||
|
||||
<p>The definition of this macro is a list of structure initializations, each
|
||||
of which specifies an original and replacement register.
|
||||
|
||||
<p>On some machines, the position of the argument pointer is not known until
|
||||
the compilation is completed. In such a case, a separate hard register
|
||||
must be used for the argument pointer. This register can be eliminated by
|
||||
replacing it with either the frame pointer or the argument pointer,
|
||||
depending on whether or not the frame pointer has been eliminated.
|
||||
|
||||
<p>In this case, you might specify:
|
||||
<pre class="smallexample"> #define ELIMINABLE_REGS \
|
||||
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
|
||||
{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
|
||||
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
|
||||
</pre>
|
||||
<p>Note that the elimination of the argument pointer with the stack pointer is
|
||||
specified first since that is the preferred elimination.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_CAN_ELIMINATE</b> (<var>const int from_reg, const int to_reg</var>)<var><a name="index-TARGET_005fCAN_005fELIMINATE-4166"></a></var><br>
|
||||
<blockquote><p>This target hook should returns <code>true</code> if the compiler is allowed to
|
||||
try to replace register number <var>from_reg</var> with register number
|
||||
<var>to_reg</var>. This target hook need only be defined if <code>ELIMINABLE_REGS</code>
|
||||
is defined, and will usually be <code>true</code>, since most of the cases
|
||||
preventing register elimination are things that the compiler already
|
||||
knows about.
|
||||
|
||||
<p>Default return value is <code>true</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>INITIAL_ELIMINATION_OFFSET</b> (<var>from-reg, to-reg, offset-var</var>)<var><a name="index-INITIAL_005fELIMINATION_005fOFFSET-4167"></a></var><br>
|
||||
<blockquote><p>This macro is similar to <code>INITIAL_FRAME_POINTER_OFFSET</code>. It
|
||||
specifies the initial difference between the specified pair of
|
||||
registers. This macro must be defined if <code>ELIMINABLE_REGS</code> is
|
||||
defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Empty Statements - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Statements.html#Statements" title="Statements">
|
||||
<link rel="prev" href="Statement-Sequences.html#Statement-Sequences" title="Statement Sequences">
|
||||
<link rel="next" href="Jumps.html#Jumps" title="Jumps">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Empty-Statements"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Jumps.html#Jumps">Jumps</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Statement-Sequences.html#Statement-Sequences">Statement Sequences</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Statements.html#Statements">Statements</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">11.7.4 Empty Statements</h4>
|
||||
|
||||
<p><a name="index-Empty-Statements-2522"></a>
|
||||
Whenever possible, statements with no effect are discarded. But
|
||||
if they are nested within another construct which cannot be
|
||||
discarded for some reason, they are instead replaced with an
|
||||
empty statement, generated by <code>build_empty_stmt</code>.
|
||||
Initially, all empty statements were shared, after the pattern of
|
||||
the Java front end, but this caused a lot of trouble in practice.
|
||||
|
||||
<p>An empty statement is represented as <code>(void)0</code>.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Emulated TLS - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Target-Macros.html#Target-Macros" title="Target Macros">
|
||||
<link rel="prev" href="Target-Attributes.html#Target-Attributes" title="Target Attributes">
|
||||
<link rel="next" href="MIPS-Coprocessors.html#MIPS-Coprocessors" title="MIPS Coprocessors">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Emulated-TLS"></a>
|
||||
Next: <a rel="next" accesskey="n" href="MIPS-Coprocessors.html#MIPS-Coprocessors">MIPS Coprocessors</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Target-Attributes.html#Target-Attributes">Target Attributes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Target-Macros.html#Target-Macros">Target Macros</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">17.26 Emulating TLS</h3>
|
||||
|
||||
<p><a name="index-Emulated-TLS-4790"></a>
|
||||
For targets whose psABI does not provide Thread Local Storage via
|
||||
specific relocations and instruction sequences, an emulation layer is
|
||||
used. A set of target hooks allows this emulation layer to be
|
||||
configured for the requirements of a particular target. For instance
|
||||
the psABI may in fact specify TLS support in terms of an emulation
|
||||
layer.
|
||||
|
||||
<p>The emulation layer works by creating a control object for every TLS
|
||||
object. To access the TLS object, a lookup function is provided
|
||||
which, when given the address of the control object, will return the
|
||||
address of the current thread's instance of the TLS object.
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_EMUTLS_GET_ADDRESS</b><var><a name="index-TARGET_005fEMUTLS_005fGET_005fADDRESS-4791"></a></var><br>
|
||||
<blockquote><p>Contains the name of the helper function that uses a TLS control
|
||||
object to locate a TLS instance. The default causes libgcc's
|
||||
emulated TLS helper function to be used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_EMUTLS_REGISTER_COMMON</b><var><a name="index-TARGET_005fEMUTLS_005fREGISTER_005fCOMMON-4792"></a></var><br>
|
||||
<blockquote><p>Contains the name of the helper function that should be used at
|
||||
program startup to register TLS objects that are implicitly
|
||||
initialized to zero. If this is <code>NULL</code>, all TLS objects will
|
||||
have explicit initializers. The default causes libgcc's emulated TLS
|
||||
registration function to be used.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_EMUTLS_VAR_SECTION</b><var><a name="index-TARGET_005fEMUTLS_005fVAR_005fSECTION-4793"></a></var><br>
|
||||
<blockquote><p>Contains the name of the section in which TLS control variables should
|
||||
be placed. The default of <code>NULL</code> allows these to be placed in
|
||||
any section.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_EMUTLS_TMPL_SECTION</b><var><a name="index-TARGET_005fEMUTLS_005fTMPL_005fSECTION-4794"></a></var><br>
|
||||
<blockquote><p>Contains the name of the section in which TLS initializers should be
|
||||
placed. The default of <code>NULL</code> allows these to be placed in any
|
||||
section.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_EMUTLS_VAR_PREFIX</b><var><a name="index-TARGET_005fEMUTLS_005fVAR_005fPREFIX-4795"></a></var><br>
|
||||
<blockquote><p>Contains the prefix to be prepended to TLS control variable names.
|
||||
The default of <code>NULL</code> uses a target-specific prefix.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_EMUTLS_TMPL_PREFIX</b><var><a name="index-TARGET_005fEMUTLS_005fTMPL_005fPREFIX-4796"></a></var><br>
|
||||
<blockquote><p>Contains the prefix to be prepended to TLS initializer objects. The
|
||||
default of <code>NULL</code> uses a target-specific prefix.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_EMUTLS_VAR_FIELDS</b> (<var>tree type, tree *name</var>)<var><a name="index-TARGET_005fEMUTLS_005fVAR_005fFIELDS-4797"></a></var><br>
|
||||
<blockquote><p>Specifies a function that generates the FIELD_DECLs for a TLS control
|
||||
object type. <var>type</var> is the RECORD_TYPE the fields are for and
|
||||
<var>name</var> should be filled with the structure tag, if the default of
|
||||
<code>__emutls_object</code> is unsuitable. The default creates a type suitable
|
||||
for libgcc's emulated TLS function.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: tree <b>TARGET_EMUTLS_VAR_INIT</b> (<var>tree var, tree decl, tree tmpl_addr</var>)<var><a name="index-TARGET_005fEMUTLS_005fVAR_005fINIT-4798"></a></var><br>
|
||||
<blockquote><p>Specifies a function that generates the CONSTRUCTOR to initialize a
|
||||
TLS control object. <var>var</var> is the TLS control object, <var>decl</var>
|
||||
is the TLS object and <var>tmpl_addr</var> is the address of the
|
||||
initializer. The default initializes libgcc's emulated TLS control object.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_EMUTLS_VAR_ALIGN_FIXED</b><var><a name="index-TARGET_005fEMUTLS_005fVAR_005fALIGN_005fFIXED-4799"></a></var><br>
|
||||
<blockquote><p>Specifies whether the alignment of TLS control variable objects is
|
||||
fixed and should not be increased as some backends may do to optimize
|
||||
single objects. The default is false.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS</b><var><a name="index-TARGET_005fEMUTLS_005fDEBUG_005fFORM_005fTLS_005fADDRESS-4800"></a></var><br>
|
||||
<blockquote><p>Specifies whether a DWARF <code>DW_OP_form_tls_address</code> location descriptor
|
||||
may be used to describe emulated TLS control objects.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Example - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Machine-Desc.html#Machine-Desc" title="Machine Desc">
|
||||
<link rel="prev" href="Patterns.html#Patterns" title="Patterns">
|
||||
<link rel="next" href="RTL-Template.html#RTL-Template" title="RTL Template">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Example"></a>
|
||||
Next: <a rel="next" accesskey="n" href="RTL-Template.html#RTL-Template">RTL Template</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Patterns.html#Patterns">Patterns</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Machine-Desc.html#Machine-Desc">Machine Desc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">16.3 Example of <code>define_insn</code></h3>
|
||||
|
||||
<p><a name="index-g_t_0040code_007bdefine_005finsn_007d-example-3205"></a>
|
||||
Here is an actual example of an instruction pattern, for the 68000/68020.
|
||||
|
||||
<pre class="smallexample"> (define_insn "tstsi"
|
||||
[(set (cc0)
|
||||
(match_operand:SI 0 "general_operand" "rm"))]
|
||||
""
|
||||
"*
|
||||
{
|
||||
if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
|
||||
return \"tstl %0\";
|
||||
return \"cmpl #0,%0\";
|
||||
}")
|
||||
</pre>
|
||||
<p class="noindent">This can also be written using braced strings:
|
||||
|
||||
<pre class="smallexample"> (define_insn "tstsi"
|
||||
[(set (cc0)
|
||||
(match_operand:SI 0 "general_operand" "rm"))]
|
||||
""
|
||||
{
|
||||
if (TARGET_68020 || ! ADDRESS_REG_P (operands[0]))
|
||||
return "tstl %0";
|
||||
return "cmpl #0,%0";
|
||||
})
|
||||
</pre>
|
||||
<p>This is an instruction that sets the condition codes based on the value of
|
||||
a general operand. It has no condition, so any insn whose RTL description
|
||||
has the form shown may be handled according to this pattern. The name
|
||||
‘<samp><span class="samp">tstsi</span></samp>’ means “test a <code>SImode</code> value” and tells the RTL generation
|
||||
pass that, when it is necessary to test such a value, an insn to do so
|
||||
can be constructed using this pattern.
|
||||
|
||||
<p>The output control string is a piece of C code which chooses which
|
||||
output template to return based on the kind of operand and the specific
|
||||
type of CPU for which code is being generated.
|
||||
|
||||
<p>‘<samp><span class="samp">"rm"</span></samp>’ is an operand constraint. Its meaning is explained below.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Examples - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Mode-Iterators.html#Mode-Iterators" title="Mode Iterators">
|
||||
<link rel="prev" href="Substitutions.html#Substitutions" title="Substitutions">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Examples"></a>
|
||||
Previous: <a rel="previous" accesskey="p" href="Substitutions.html#Substitutions">Substitutions</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Mode-Iterators.html#Mode-Iterators">Mode Iterators</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h5 class="subsubsection">16.23.1.3 Mode Iterator Examples</h5>
|
||||
|
||||
<p>Here is an example from the MIPS port. It defines the following
|
||||
modes and attributes (among others):
|
||||
|
||||
<pre class="smallexample"> (define_mode_iterator GPR [SI (DI "TARGET_64BIT")])
|
||||
(define_mode_attr d [(SI "") (DI "d")])
|
||||
</pre>
|
||||
<p>and uses the following template to define both <code>subsi3</code>
|
||||
and <code>subdi3</code>:
|
||||
|
||||
<pre class="smallexample"> (define_insn "sub<mode>3"
|
||||
[(set (match_operand:GPR 0 "register_operand" "=d")
|
||||
(minus:GPR (match_operand:GPR 1 "register_operand" "d")
|
||||
(match_operand:GPR 2 "register_operand" "d")))]
|
||||
""
|
||||
"<d>subu\t%0,%1,%2"
|
||||
[(set_attr "type" "arith")
|
||||
(set_attr "mode" "<MODE>")])
|
||||
</pre>
|
||||
<p>This is exactly equivalent to:
|
||||
|
||||
<pre class="smallexample"> (define_insn "subsi3"
|
||||
[(set (match_operand:SI 0 "register_operand" "=d")
|
||||
(minus:SI (match_operand:SI 1 "register_operand" "d")
|
||||
(match_operand:SI 2 "register_operand" "d")))]
|
||||
""
|
||||
"subu\t%0,%1,%2"
|
||||
[(set_attr "type" "arith")
|
||||
(set_attr "mode" "SI")])
|
||||
|
||||
(define_insn "subdi3"
|
||||
[(set (match_operand:DI 0 "register_operand" "=d")
|
||||
(minus:DI (match_operand:DI 1 "register_operand" "d")
|
||||
(match_operand:DI 2 "register_operand" "d")))]
|
||||
""
|
||||
"dsubu\t%0,%1,%2"
|
||||
[(set_attr "type" "arith")
|
||||
(set_attr "mode" "DI")])
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Exception Handling - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Stack-and-Calling.html#Stack-and-Calling" title="Stack and Calling">
|
||||
<link rel="prev" href="Frame-Layout.html#Frame-Layout" title="Frame Layout">
|
||||
<link rel="next" href="Stack-Checking.html#Stack-Checking" title="Stack Checking">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Exception-Handling"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Stack-Checking.html#Stack-Checking">Stack Checking</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Frame-Layout.html#Frame-Layout">Frame Layout</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Stack-and-Calling.html#Stack-and-Calling">Stack and Calling</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.10.2 Exception Handling Support</h4>
|
||||
|
||||
<p><a name="index-exception-handling-4124"></a>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>EH_RETURN_DATA_REGNO</b> (<var>N</var>)<var><a name="index-EH_005fRETURN_005fDATA_005fREGNO-4125"></a></var><br>
|
||||
<blockquote><p>A C expression whose value is the <var>N</var>th register number used for
|
||||
data by exception handlers, or <code>INVALID_REGNUM</code> if fewer than
|
||||
<var>N</var> registers are usable.
|
||||
|
||||
<p>The exception handling library routines communicate with the exception
|
||||
handlers via a set of agreed upon registers. Ideally these registers
|
||||
should be call-clobbered; it is possible to use call-saved registers,
|
||||
but may negatively impact code size. The target must support at least
|
||||
2 data registers, but should define 4 if there are enough free registers.
|
||||
|
||||
<p>You must define this macro if you want to support call frame exception
|
||||
handling like that provided by DWARF 2.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>EH_RETURN_STACKADJ_RTX</b><var><a name="index-EH_005fRETURN_005fSTACKADJ_005fRTX-4126"></a></var><br>
|
||||
<blockquote><p>A C expression whose value is RTL representing a location in which
|
||||
to store a stack adjustment to be applied before function return.
|
||||
This is used to unwind the stack to an exception handler's call frame.
|
||||
It will be assigned zero on code paths that return normally.
|
||||
|
||||
<p>Typically this is a call-clobbered hard register that is otherwise
|
||||
untouched by the epilogue, but could also be a stack slot.
|
||||
|
||||
<p>Do not define this macro if the stack pointer is saved and restored
|
||||
by the regular prolog and epilog code in the call frame itself; in
|
||||
this case, the exception handling library routines will update the
|
||||
stack location to be restored in place. Otherwise, you must define
|
||||
this macro if you want to support call frame exception handling like
|
||||
that provided by DWARF 2.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>EH_RETURN_HANDLER_RTX</b><var><a name="index-EH_005fRETURN_005fHANDLER_005fRTX-4127"></a></var><br>
|
||||
<blockquote><p>A C expression whose value is RTL representing a location in which
|
||||
to store the address of an exception handler to which we should
|
||||
return. It will not be assigned on code paths that return normally.
|
||||
|
||||
<p>Typically this is the location in the call frame at which the normal
|
||||
return address is stored. For targets that return by popping an
|
||||
address off the stack, this might be a memory address just below
|
||||
the <em>target</em> call frame rather than inside the current call
|
||||
frame. If defined, <code>EH_RETURN_STACKADJ_RTX</code> will have already
|
||||
been assigned, so it may be used to calculate the location of the
|
||||
target call frame.
|
||||
|
||||
<p>Some targets have more complex requirements than storing to an
|
||||
address calculable during initial code generation. In that case
|
||||
the <code>eh_return</code> instruction pattern should be used instead.
|
||||
|
||||
<p>If you want to support call frame exception handling, you must
|
||||
define either this macro or the <code>eh_return</code> instruction pattern.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>RETURN_ADDR_OFFSET</b><var><a name="index-RETURN_005fADDR_005fOFFSET-4128"></a></var><br>
|
||||
<blockquote><p>If defined, an integer-valued C expression for which rtl will be generated
|
||||
to add it to the exception handler address before it is searched in the
|
||||
exception handling tables, and to subtract it again from the address before
|
||||
using it to return to the exception handler.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_PREFERRED_EH_DATA_FORMAT</b> (<var>code, global</var>)<var><a name="index-ASM_005fPREFERRED_005fEH_005fDATA_005fFORMAT-4129"></a></var><br>
|
||||
<blockquote><p>This macro chooses the encoding of pointers embedded in the exception
|
||||
handling sections. If at all possible, this should be defined such
|
||||
that the exception handling section will not require dynamic relocations,
|
||||
and so may be read-only.
|
||||
|
||||
<p><var>code</var> is 0 for data, 1 for code labels, 2 for function pointers.
|
||||
<var>global</var> is true if the symbol may be affected by dynamic relocations.
|
||||
The macro should return a combination of the <code>DW_EH_PE_*</code> defines
|
||||
as found in <samp><span class="file">dwarf2.h</span></samp>.
|
||||
|
||||
<p>If this macro is not defined, pointers will not be encoded but
|
||||
represented directly.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX</b> (<var>file, encoding, size, addr, done</var>)<var><a name="index-ASM_005fMAYBE_005fOUTPUT_005fENCODED_005fADDR_005fRTX-4130"></a></var><br>
|
||||
<blockquote><p>This macro allows the target to emit whatever special magic is required
|
||||
to represent the encoding chosen by <code>ASM_PREFERRED_EH_DATA_FORMAT</code>.
|
||||
Generic code takes care of pc-relative and indirect encodings; this must
|
||||
be defined if the target uses text-relative or data-relative encodings.
|
||||
|
||||
<p>This is a C statement that branches to <var>done</var> if the format was
|
||||
handled. <var>encoding</var> is the format chosen, <var>size</var> is the number
|
||||
of bytes that the format occupies, <var>addr</var> is the <code>SYMBOL_REF</code>
|
||||
to be emitted.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MD_FALLBACK_FRAME_STATE_FOR</b> (<var>context, fs</var>)<var><a name="index-MD_005fFALLBACK_005fFRAME_005fSTATE_005fFOR-4131"></a></var><br>
|
||||
<blockquote><p>This macro allows the target to add CPU and operating system specific
|
||||
code to the call-frame unwinder for use when there is no unwind data
|
||||
available. The most common reason to implement this macro is to unwind
|
||||
through signal frames.
|
||||
|
||||
<p>This macro is called from <code>uw_frame_state_for</code> in
|
||||
<samp><span class="file">unwind-dw2.c</span></samp>, <samp><span class="file">unwind-dw2-xtensa.c</span></samp> and
|
||||
<samp><span class="file">unwind-ia64.c</span></samp>. <var>context</var> is an <code>_Unwind_Context</code>;
|
||||
<var>fs</var> is an <code>_Unwind_FrameState</code>. Examine <code>context->ra</code>
|
||||
for the address of the code being executed and <code>context->cfa</code> for
|
||||
the stack pointer value. If the frame can be decoded, the register
|
||||
save addresses should be updated in <var>fs</var> and the macro should
|
||||
evaluate to <code>_URC_NO_REASON</code>. If the frame cannot be decoded,
|
||||
the macro should evaluate to <code>_URC_END_OF_STACK</code>.
|
||||
|
||||
<p>For proper signal handling in Java this macro is accompanied by
|
||||
<code>MAKE_THROW_FRAME</code>, defined in <samp><span class="file">libjava/include/*-signal.h</span></samp> headers.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MD_HANDLE_UNWABI</b> (<var>context, fs</var>)<var><a name="index-MD_005fHANDLE_005fUNWABI-4132"></a></var><br>
|
||||
<blockquote><p>This macro allows the target to add operating system specific code to the
|
||||
call-frame unwinder to handle the IA-64 <code>.unwabi</code> unwinding directive,
|
||||
usually used for signal or interrupt frames.
|
||||
|
||||
<p>This macro is called from <code>uw_update_context</code> in libgcc's
|
||||
<samp><span class="file">unwind-ia64.c</span></samp>. <var>context</var> is an <code>_Unwind_Context</code>;
|
||||
<var>fs</var> is an <code>_Unwind_FrameState</code>. Examine <code>fs->unwabi</code>
|
||||
for the abi and context in the <code>.unwabi</code> directive. If the
|
||||
<code>.unwabi</code> directive can be handled, the register save addresses should
|
||||
be updated in <var>fs</var>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>TARGET_USES_WEAK_UNWIND_INFO</b><var><a name="index-TARGET_005fUSES_005fWEAK_005fUNWIND_005fINFO-4133"></a></var><br>
|
||||
<blockquote><p>A C expression that evaluates to true if the target requires unwind
|
||||
info to be given comdat linkage. Define it to be <code>1</code> if comdat
|
||||
linkage is necessary. The default is <code>0</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Exception Region Output - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Assembler-Format.html#Assembler-Format" title="Assembler Format">
|
||||
<link rel="prev" href="Dispatch-Tables.html#Dispatch-Tables" title="Dispatch Tables">
|
||||
<link rel="next" href="Alignment-Output.html#Alignment-Output" title="Alignment Output">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Exception-Region-Output"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Alignment-Output.html#Alignment-Output">Alignment Output</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Dispatch-Tables.html#Dispatch-Tables">Dispatch Tables</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Assembler-Format.html#Assembler-Format">Assembler Format</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.21.9 Assembler Commands for Exception Regions</h4>
|
||||
|
||||
<!-- prevent bad page break with this line -->
|
||||
<p>This describes commands marking the start and the end of an exception
|
||||
region.
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>EH_FRAME_SECTION_NAME</b><var><a name="index-EH_005fFRAME_005fSECTION_005fNAME-4661"></a></var><br>
|
||||
<blockquote><p>If defined, a C string constant for the name of the section containing
|
||||
exception handling frame unwind information. If not defined, GCC will
|
||||
provide a default definition if the target supports named sections.
|
||||
<samp><span class="file">crtstuff.c</span></samp> uses this macro to switch to the appropriate section.
|
||||
|
||||
<p>You should define this symbol if your target supports DWARF 2 frame
|
||||
unwind information and the default definition does not work.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>EH_FRAME_IN_DATA_SECTION</b><var><a name="index-EH_005fFRAME_005fIN_005fDATA_005fSECTION-4662"></a></var><br>
|
||||
<blockquote><p>If defined, DWARF 2 frame unwind information will be placed in the
|
||||
data section even though the target supports named sections. This
|
||||
might be necessary, for instance, if the system linker does garbage
|
||||
collection and sections cannot be marked as not to be collected.
|
||||
|
||||
<p>Do not define this macro unless <code>TARGET_ASM_NAMED_SECTION</code> is
|
||||
also defined.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>EH_TABLES_CAN_BE_READ_ONLY</b><var><a name="index-EH_005fTABLES_005fCAN_005fBE_005fREAD_005fONLY-4663"></a></var><br>
|
||||
<blockquote><p>Define this macro to 1 if your target is such that no frame unwind
|
||||
information encoding used with non-PIC code will ever require a
|
||||
runtime relocation, but the linker may not support merging read-only
|
||||
and read-write sections into a single read-write section.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>MASK_RETURN_ADDR</b><var><a name="index-MASK_005fRETURN_005fADDR-4664"></a></var><br>
|
||||
<blockquote><p>An rtx used to mask the return address found via <code>RETURN_ADDR_RTX</code>, so
|
||||
that it does not contain any extraneous set bits in it.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DWARF2_UNWIND_INFO</b><var><a name="index-DWARF2_005fUNWIND_005fINFO-4665"></a></var><br>
|
||||
<blockquote><p>Define this macro to 0 if your target supports DWARF 2 frame unwind
|
||||
information, but it does not yet work with exception handling.
|
||||
Otherwise, if your target supports this information (if it defines
|
||||
<code>INCOMING_RETURN_ADDR_RTX</code> and <code>OBJECT_FORMAT_ELF</code>),
|
||||
GCC will provide a default definition of 1.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Common Target Hook: enum unwind_info_type <b>TARGET_EXCEPT_UNWIND_INFO</b> (<var>struct gcc_options *opts</var>)<var><a name="index-TARGET_005fEXCEPT_005fUNWIND_005fINFO-4666"></a></var><br>
|
||||
<blockquote><p>This hook defines the mechanism that will be used for exception handling
|
||||
by the target. If the target has ABI specified unwind tables, the hook
|
||||
should return <code>UI_TARGET</code>. If the target is to use the
|
||||
<code>setjmp</code>/<code>longjmp</code>-based exception handling scheme, the hook
|
||||
should return <code>UI_SJLJ</code>. If the target supports DWARF 2 frame unwind
|
||||
information, the hook should return <code>UI_DWARF2</code>.
|
||||
|
||||
<p>A target may, if exceptions are disabled, choose to return <code>UI_NONE</code>.
|
||||
This may end up simplifying other parts of target-specific code. The
|
||||
default implementation of this hook never returns <code>UI_NONE</code>.
|
||||
|
||||
<p>Note that the value returned by this hook should be constant. It should
|
||||
not depend on anything except the command-line switches described by
|
||||
<var>opts</var>. In particular, the
|
||||
setting <code>UI_SJLJ</code> must be fixed at compiler start-up as C pre-processor
|
||||
macros and builtin functions related to exception handling are set up
|
||||
depending on this setting.
|
||||
|
||||
<p>The default implementation of the hook first honors the
|
||||
<samp><span class="option">--enable-sjlj-exceptions</span></samp> configure option, then
|
||||
<code>DWARF2_UNWIND_INFO</code>, and finally defaults to <code>UI_SJLJ</code>. If
|
||||
<code>DWARF2_UNWIND_INFO</code> depends on command-line options, the target
|
||||
must define this hook so that <var>opts</var> is used correctly.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Common Target Hook: bool <b>TARGET_UNWIND_TABLES_DEFAULT</b><var><a name="index-TARGET_005fUNWIND_005fTABLES_005fDEFAULT-4667"></a></var><br>
|
||||
<blockquote><p>This variable should be set to <code>true</code> if the target ABI requires unwinding
|
||||
tables even when exceptions are not used. It must not be modified by
|
||||
command-line option processing.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DONT_USE_BUILTIN_SETJMP</b><var><a name="index-DONT_005fUSE_005fBUILTIN_005fSETJMP-4668"></a></var><br>
|
||||
<blockquote><p>Define this macro to 1 if the <code>setjmp</code>/<code>longjmp</code>-based scheme
|
||||
should use the <code>setjmp</code>/<code>longjmp</code> functions from the C library
|
||||
instead of the <code>__builtin_setjmp</code>/<code>__builtin_longjmp</code> machinery.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>JMP_BUF_SIZE</b><var><a name="index-JMP_005fBUF_005fSIZE-4669"></a></var><br>
|
||||
<blockquote><p>This macro has no effect unless <code>DONT_USE_BUILTIN_SETJMP</code> is also
|
||||
defined. Define this macro if the default size of <code>jmp_buf</code> buffer
|
||||
for the <code>setjmp</code>/<code>longjmp</code>-based exception handling mechanism
|
||||
is not large enough, or if it is much too large.
|
||||
The default size is <code>FIRST_PSEUDO_REGISTER * sizeof(void *)</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>DWARF_CIE_DATA_ALIGNMENT</b><var><a name="index-DWARF_005fCIE_005fDATA_005fALIGNMENT-4670"></a></var><br>
|
||||
<blockquote><p>This macro need only be defined if the target might save registers in the
|
||||
function prologue at an offset to the stack pointer that is not aligned to
|
||||
<code>UNITS_PER_WORD</code>. The definition should be the negative minimum
|
||||
alignment if <code>STACK_GROWS_DOWNWARD</code> is defined, and the positive
|
||||
minimum alignment otherwise. See <a href="SDB-and-DWARF.html#SDB-and-DWARF">SDB and DWARF</a>. Only applicable if
|
||||
the target supports DWARF 2 frame unwind information.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_TERMINATE_DW2_EH_FRAME_INFO</b><var><a name="index-TARGET_005fTERMINATE_005fDW2_005fEH_005fFRAME_005fINFO-4671"></a></var><br>
|
||||
<blockquote><p>Contains the value true if the target should add a zero word onto the
|
||||
end of a Dwarf-2 frame info section when used for exception handling.
|
||||
Default value is false if <code>EH_FRAME_SECTION_NAME</code> is defined, and
|
||||
true otherwise.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: rtx <b>TARGET_DWARF_REGISTER_SPAN</b> (<var>rtx reg</var>)<var><a name="index-TARGET_005fDWARF_005fREGISTER_005fSPAN-4672"></a></var><br>
|
||||
<blockquote><p>Given a register, this hook should return a parallel of registers to
|
||||
represent where to find the register pieces. Define this hook if the
|
||||
register and its mode are represented in Dwarf in non-contiguous
|
||||
locations, or if the register should be represented in more than one
|
||||
register in Dwarf. Otherwise, this hook should return <code>NULL_RTX</code>.
|
||||
If not defined, the default is to return <code>NULL_RTX</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_INIT_DWARF_REG_SIZES_EXTRA</b> (<var>tree address</var>)<var><a name="index-TARGET_005fINIT_005fDWARF_005fREG_005fSIZES_005fEXTRA-4673"></a></var><br>
|
||||
<blockquote><p>If some registers are represented in Dwarf-2 unwind information in
|
||||
multiple pieces, define this hook to fill in information about the
|
||||
sizes of those pieces in the table used by the unwinder at runtime.
|
||||
It will be called by <code>expand_builtin_init_dwarf_reg_sizes</code> after
|
||||
filling in a single size corresponding to each hard register;
|
||||
<var>address</var> is the address of the table.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_ASM_TTYPE</b> (<var>rtx sym</var>)<var><a name="index-TARGET_005fASM_005fTTYPE-4674"></a></var><br>
|
||||
<blockquote><p>This hook is used to output a reference from a frame unwinding table to
|
||||
the type_info object identified by <var>sym</var>. It should return <code>true</code>
|
||||
if the reference was output. Returning <code>false</code> will cause the
|
||||
reference to be output using the normal Dwarf2 routines.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_ARM_EABI_UNWINDER</b><var><a name="index-TARGET_005fARM_005fEABI_005fUNWINDER-4675"></a></var><br>
|
||||
<blockquote><p>This flag should be set to <code>true</code> on targets that use an ARM EABI
|
||||
based unwinding library, and <code>false</code> on other targets. This effects
|
||||
the format of unwinding tables, and how the unwinder in entered after
|
||||
running a cleanup. The default is <code>false</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Exception handling routines - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Libgcc.html#Libgcc" title="Libgcc">
|
||||
<link rel="prev" href="Fixed_002dpoint-fractional-library-routines.html#Fixed_002dpoint-fractional-library-routines" title="Fixed-point fractional library routines">
|
||||
<link rel="next" href="Miscellaneous-routines.html#Miscellaneous-routines" title="Miscellaneous routines">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Exception-handling-routines"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Miscellaneous-routines.html#Miscellaneous-routines">Miscellaneous routines</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Fixed_002dpoint-fractional-library-routines.html#Fixed_002dpoint-fractional-library-routines">Fixed-point fractional library routines</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Libgcc.html#Libgcc">Libgcc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">4.5 Language-independent routines for exception handling</h3>
|
||||
|
||||
<p>document me!
|
||||
|
||||
<pre class="smallexample"> _Unwind_DeleteException
|
||||
_Unwind_Find_FDE
|
||||
_Unwind_ForcedUnwind
|
||||
_Unwind_GetGR
|
||||
_Unwind_GetIP
|
||||
_Unwind_GetLanguageSpecificData
|
||||
_Unwind_GetRegionStart
|
||||
_Unwind_GetTextRelBase
|
||||
_Unwind_GetDataRelBase
|
||||
_Unwind_RaiseException
|
||||
_Unwind_Resume
|
||||
_Unwind_SetGR
|
||||
_Unwind_SetIP
|
||||
_Unwind_FindEnclosingFunction
|
||||
_Unwind_SjLj_Register
|
||||
_Unwind_SjLj_Unregister
|
||||
_Unwind_SjLj_RaiseException
|
||||
_Unwind_SjLj_ForcedUnwind
|
||||
_Unwind_SjLj_Resume
|
||||
__deregister_frame
|
||||
__deregister_frame_info
|
||||
__deregister_frame_info_bases
|
||||
__register_frame
|
||||
__register_frame_info
|
||||
__register_frame_info_bases
|
||||
__register_frame_info_table
|
||||
__register_frame_info_table_bases
|
||||
__register_frame_table
|
||||
</pre>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Expander Definitions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Machine-Desc.html#Machine-Desc" title="Machine Desc">
|
||||
<link rel="prev" href="Insn-Canonicalizations.html#Insn-Canonicalizations" title="Insn Canonicalizations">
|
||||
<link rel="next" href="Insn-Splitting.html#Insn-Splitting" title="Insn Splitting">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Expander-Definitions"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Insn-Splitting.html#Insn-Splitting">Insn Splitting</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Insn-Canonicalizations.html#Insn-Canonicalizations">Insn Canonicalizations</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Machine-Desc.html#Machine-Desc">Machine Desc</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">16.15 Defining RTL Sequences for Code Generation</h3>
|
||||
|
||||
<p><a name="index-expander-definitions-3633"></a><a name="index-code-generation-RTL-sequences-3634"></a><a name="index-defining-RTL-sequences-for-code-generation-3635"></a>
|
||||
On some target machines, some standard pattern names for RTL generation
|
||||
cannot be handled with single insn, but a sequence of RTL insns can
|
||||
represent them. For these target machines, you can write a
|
||||
<code>define_expand</code> to specify how to generate the sequence of RTL.
|
||||
|
||||
<p><a name="index-define_005fexpand-3636"></a>A <code>define_expand</code> is an RTL expression that looks almost like a
|
||||
<code>define_insn</code>; but, unlike the latter, a <code>define_expand</code> is used
|
||||
only for RTL generation and it can produce more than one RTL insn.
|
||||
|
||||
<p>A <code>define_expand</code> RTX has four operands:
|
||||
|
||||
<ul>
|
||||
<li>The name. Each <code>define_expand</code> must have a name, since the only
|
||||
use for it is to refer to it by name.
|
||||
|
||||
<li>The RTL template. This is a vector of RTL expressions representing
|
||||
a sequence of separate instructions. Unlike <code>define_insn</code>, there
|
||||
is no implicit surrounding <code>PARALLEL</code>.
|
||||
|
||||
<li>The condition, a string containing a C expression. This expression is
|
||||
used to express how the availability of this pattern depends on
|
||||
subclasses of target machine, selected by command-line options when GCC
|
||||
is run. This is just like the condition of a <code>define_insn</code> that
|
||||
has a standard name. Therefore, the condition (if present) may not
|
||||
depend on the data in the insn being matched, but only the
|
||||
target-machine-type flags. The compiler needs to test these conditions
|
||||
during initialization in order to learn exactly which named instructions
|
||||
are available in a particular run.
|
||||
|
||||
<li>The preparation statements, a string containing zero or more C
|
||||
statements which are to be executed before RTL code is generated from
|
||||
the RTL template.
|
||||
|
||||
<p>Usually these statements prepare temporary registers for use as
|
||||
internal operands in the RTL template, but they can also generate RTL
|
||||
insns directly by calling routines such as <code>emit_insn</code>, etc.
|
||||
Any such insns precede the ones that come from the RTL template.
|
||||
|
||||
<li>Optionally, a vector containing the values of attributes. See <a href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>.
|
||||
</ul>
|
||||
|
||||
<p>Every RTL insn emitted by a <code>define_expand</code> must match some
|
||||
<code>define_insn</code> in the machine description. Otherwise, the compiler
|
||||
will crash when trying to generate code for the insn or trying to optimize
|
||||
it.
|
||||
|
||||
<p>The RTL template, in addition to controlling generation of RTL insns,
|
||||
also describes the operands that need to be specified when this pattern
|
||||
is used. In particular, it gives a predicate for each operand.
|
||||
|
||||
<p>A true operand, which needs to be specified in order to generate RTL from
|
||||
the pattern, should be described with a <code>match_operand</code> in its first
|
||||
occurrence in the RTL template. This enters information on the operand's
|
||||
predicate into the tables that record such things. GCC uses the
|
||||
information to preload the operand into a register if that is required for
|
||||
valid RTL code. If the operand is referred to more than once, subsequent
|
||||
references should use <code>match_dup</code>.
|
||||
|
||||
<p>The RTL template may also refer to internal “operands” which are
|
||||
temporary registers or labels used only within the sequence made by the
|
||||
<code>define_expand</code>. Internal operands are substituted into the RTL
|
||||
template with <code>match_dup</code>, never with <code>match_operand</code>. The
|
||||
values of the internal operands are not passed in as arguments by the
|
||||
compiler when it requests use of this pattern. Instead, they are computed
|
||||
within the pattern, in the preparation statements. These statements
|
||||
compute the values and store them into the appropriate elements of
|
||||
<code>operands</code> so that <code>match_dup</code> can find them.
|
||||
|
||||
<p>There are two special macros defined for use in the preparation statements:
|
||||
<code>DONE</code> and <code>FAIL</code>. Use them with a following semicolon,
|
||||
as a statement.
|
||||
|
||||
|
||||
<a name="index-DONE-3637"></a>
|
||||
<dl><dt><code>DONE</code><dd>Use the <code>DONE</code> macro to end RTL generation for the pattern. The
|
||||
only RTL insns resulting from the pattern on this occasion will be
|
||||
those already emitted by explicit calls to <code>emit_insn</code> within the
|
||||
preparation statements; the RTL template will not be generated.
|
||||
|
||||
<p><a name="index-FAIL-3638"></a><br><dt><code>FAIL</code><dd>Make the pattern fail on this occasion. When a pattern fails, it means
|
||||
that the pattern was not truly available. The calling routines in the
|
||||
compiler will try other strategies for code generation using other patterns.
|
||||
|
||||
<p>Failure is currently supported only for binary (addition, multiplication,
|
||||
shifting, etc.) and bit-field (<code>extv</code>, <code>extzv</code>, and <code>insv</code>)
|
||||
operations.
|
||||
</dl>
|
||||
|
||||
<p>If the preparation falls through (invokes neither <code>DONE</code> nor
|
||||
<code>FAIL</code>), then the <code>define_expand</code> acts like a
|
||||
<code>define_insn</code> in that the RTL template is used to generate the
|
||||
insn.
|
||||
|
||||
<p>The RTL template is not used for matching, only for generating the
|
||||
initial insn list. If the preparation statement always invokes
|
||||
<code>DONE</code> or <code>FAIL</code>, the RTL template may be reduced to a simple
|
||||
list of operands, such as this example:
|
||||
|
||||
<pre class="smallexample"> (define_expand "addsi3"
|
||||
[(match_operand:SI 0 "register_operand" "")
|
||||
(match_operand:SI 1 "register_operand" "")
|
||||
(match_operand:SI 2 "register_operand" "")]
|
||||
""
|
||||
"
|
||||
{
|
||||
handle_add (operands[0], operands[1], operands[2]);
|
||||
DONE;
|
||||
}")
|
||||
</pre>
|
||||
<p>Here is an example, the definition of left-shift for the SPUR chip:
|
||||
|
||||
<pre class="smallexample"> (define_expand "ashlsi3"
|
||||
[(set (match_operand:SI 0 "register_operand" "")
|
||||
(ashift:SI
|
||||
(match_operand:SI 1 "register_operand" "")
|
||||
(match_operand:SI 2 "nonmemory_operand" "")))]
|
||||
""
|
||||
"
|
||||
</pre>
|
||||
<pre class="smallexample"> {
|
||||
if (GET_CODE (operands[2]) != CONST_INT
|
||||
|| (unsigned) INTVAL (operands[2]) > 3)
|
||||
FAIL;
|
||||
}")
|
||||
</pre>
|
||||
<p class="noindent">This example uses <code>define_expand</code> so that it can generate an RTL insn
|
||||
for shifting when the shift-count is in the supported range of 0 to 3 but
|
||||
fail in other cases where machine insns aren't available. When it fails,
|
||||
the compiler tries another strategy using different patterns (such as, a
|
||||
library call).
|
||||
|
||||
<p>If the compiler were able to handle nontrivial condition-strings in
|
||||
patterns with names, then it would be possible to use a
|
||||
<code>define_insn</code> in that case. Here is another case (zero-extension
|
||||
on the 68000) which makes more use of the power of <code>define_expand</code>:
|
||||
|
||||
<pre class="smallexample"> (define_expand "zero_extendhisi2"
|
||||
[(set (match_operand:SI 0 "general_operand" "")
|
||||
(const_int 0))
|
||||
(set (strict_low_part
|
||||
(subreg:HI
|
||||
(match_dup 0)
|
||||
0))
|
||||
(match_operand:HI 1 "general_operand" ""))]
|
||||
""
|
||||
"operands[1] = make_safe_from (operands[1], operands[0]);")
|
||||
</pre>
|
||||
<p class="noindent"><a name="index-make_005fsafe_005ffrom-3639"></a>Here two RTL insns are generated, one to clear the entire output operand
|
||||
and the other to copy the input operand into its low half. This sequence
|
||||
is incorrect if the input operand refers to [the old value of] the output
|
||||
operand, so the preparation statement makes sure this isn't so. The
|
||||
function <code>make_safe_from</code> copies the <code>operands[1]</code> into a
|
||||
temporary register if it refers to <code>operands[0]</code>. It does this
|
||||
by emitting another RTL insn.
|
||||
|
||||
<p>Finally, a third example shows the use of an internal operand.
|
||||
Zero-extension on the SPUR chip is done by <code>and</code>-ing the result
|
||||
against a halfword mask. But this mask cannot be represented by a
|
||||
<code>const_int</code> because the constant value is too large to be legitimate
|
||||
on this machine. So it must be copied into a register with
|
||||
<code>force_reg</code> and then the register used in the <code>and</code>.
|
||||
|
||||
<pre class="smallexample"> (define_expand "zero_extendhisi2"
|
||||
[(set (match_operand:SI 0 "register_operand" "")
|
||||
(and:SI (subreg:SI
|
||||
(match_operand:HI 1 "register_operand" "")
|
||||
0)
|
||||
(match_dup 2)))]
|
||||
""
|
||||
"operands[2]
|
||||
= force_reg (SImode, GEN_INT (65535)); ")
|
||||
</pre>
|
||||
<p><em>Note:</em> If the <code>define_expand</code> is used to serve a
|
||||
standard binary or unary arithmetic operation or a bit-field operation,
|
||||
then the last insn it generates must not be a <code>code_label</code>,
|
||||
<code>barrier</code> or <code>note</code>. It must be an <code>insn</code>,
|
||||
<code>jump_insn</code> or <code>call_insn</code>. If you don't need a real insn
|
||||
at the end, emit an insn to copy the result of the operation into
|
||||
itself. Such an insn will generate no code, but it can avoid problems
|
||||
in the compiler.
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Expression trees - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="GENERIC.html#GENERIC" title="GENERIC">
|
||||
<link rel="prev" href="Attributes.html#Attributes" title="Attributes">
|
||||
<link rel="next" href="Statements.html#Statements" title="Statements">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Expression-trees"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Statements.html#Statements">Statements</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Attributes.html#Attributes">Attributes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="GENERIC.html#GENERIC">GENERIC</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3 class="section">11.6 Expressions</h3>
|
||||
|
||||
<p><a name="index-expression-2409"></a><a name="index-TREE_005fTYPE-2410"></a><a name="index-TREE_005fOPERAND-2411"></a>
|
||||
The internal representation for expressions is for the most part quite
|
||||
straightforward. However, there are a few facts that one must bear in
|
||||
mind. In particular, the expression “tree” is actually a directed
|
||||
acyclic graph. (For example there may be many references to the integer
|
||||
constant zero throughout the source program; many of these will be
|
||||
represented by the same expression node.) You should not rely on
|
||||
certain kinds of node being shared, nor should you rely on certain kinds of
|
||||
nodes being unshared.
|
||||
|
||||
<p>The following macros can be used with all expression nodes:
|
||||
|
||||
<dl>
|
||||
<dt><code>TREE_TYPE</code><a name="index-TREE_005fTYPE-2412"></a><dd>Returns the type of the expression. This value may not be precisely the
|
||||
same type that would be given the expression in the original program.
|
||||
</dl>
|
||||
|
||||
<p>In what follows, some nodes that one might expect to always have type
|
||||
<code>bool</code> are documented to have either integral or boolean type. At
|
||||
some point in the future, the C front end may also make use of this same
|
||||
intermediate representation, and at this point these nodes will
|
||||
certainly have integral type. The previous sentence is not meant to
|
||||
imply that the C++ front end does not or will not give these nodes
|
||||
integral type.
|
||||
|
||||
<p>Below, we list the various kinds of expression nodes. Except where
|
||||
noted otherwise, the operands to an expression are accessed using the
|
||||
<code>TREE_OPERAND</code> macro. For example, to access the first operand to
|
||||
a binary plus expression <code>expr</code>, use:
|
||||
|
||||
<pre class="smallexample"> TREE_OPERAND (expr, 0)
|
||||
</pre>
|
||||
<p class="noindent">As this example indicates, the operands are zero-indexed.
|
||||
|
||||
<ul class="menu">
|
||||
<li><a accesskey="1" href="Constant-expressions.html#Constant-expressions">Constants</a>
|
||||
<li><a accesskey="2" href="Storage-References.html#Storage-References">Storage References</a>
|
||||
<li><a accesskey="3" href="Unary-and-Binary-Expressions.html#Unary-and-Binary-Expressions">Unary and Binary Expressions</a>
|
||||
<li><a accesskey="4" href="Vectors.html#Vectors">Vectors</a>
|
||||
</ul>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>Expressions - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Insn-Attributes.html#Insn-Attributes" title="Insn Attributes">
|
||||
<link rel="prev" href="Defining-Attributes.html#Defining-Attributes" title="Defining Attributes">
|
||||
<link rel="next" href="Tagging-Insns.html#Tagging-Insns" title="Tagging Insns">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="Expressions"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Tagging-Insns.html#Tagging-Insns">Tagging Insns</a>,
|
||||
Previous: <a rel="previous" accesskey="p" href="Defining-Attributes.html#Defining-Attributes">Defining Attributes</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Insn-Attributes.html#Insn-Attributes">Insn Attributes</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">16.19.2 Attribute Expressions</h4>
|
||||
|
||||
<p><a name="index-attribute-expressions-3665"></a>
|
||||
RTL expressions used to define attributes use the codes described above
|
||||
plus a few specific to attribute definitions, to be discussed below.
|
||||
Attribute value expressions must have one of the following forms:
|
||||
|
||||
|
||||
<a name="index-g_t_0040code_007bconst_005fint_007d-and-attributes-3666"></a>
|
||||
<dl><dt><code>(const_int </code><var>i</var><code>)</code><dd>The integer <var>i</var> specifies the value of a numeric attribute. <var>i</var>
|
||||
must be non-negative.
|
||||
|
||||
<p>The value of a numeric attribute can be specified either with a
|
||||
<code>const_int</code>, or as an integer represented as a string in
|
||||
<code>const_string</code>, <code>eq_attr</code> (see below), <code>attr</code>,
|
||||
<code>symbol_ref</code>, simple arithmetic expressions, and <code>set_attr</code>
|
||||
overrides on specific instructions (see <a href="Tagging-Insns.html#Tagging-Insns">Tagging Insns</a>).
|
||||
|
||||
<p><a name="index-g_t_0040code_007bconst_005fstring_007d-and-attributes-3667"></a><br><dt><code>(const_string </code><var>value</var><code>)</code><dd>The string <var>value</var> specifies a constant attribute value.
|
||||
If <var>value</var> is specified as ‘<samp><span class="samp">"*"</span></samp>’, it means that the default value of
|
||||
the attribute is to be used for the insn containing this expression.
|
||||
‘<samp><span class="samp">"*"</span></samp>’ obviously cannot be used in the <var>default</var> expression
|
||||
of a <code>define_attr</code>.
|
||||
|
||||
<p>If the attribute whose value is being specified is numeric, <var>value</var>
|
||||
must be a string containing a non-negative integer (normally
|
||||
<code>const_int</code> would be used in this case). Otherwise, it must
|
||||
contain one of the valid values for the attribute.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bif_005fthen_005felse_007d-and-attributes-3668"></a><br><dt><code>(if_then_else </code><var>test</var> <var>true-value</var> <var>false-value</var><code>)</code><dd><var>test</var> specifies an attribute test, whose format is defined below.
|
||||
The value of this expression is <var>true-value</var> if <var>test</var> is true,
|
||||
otherwise it is <var>false-value</var>.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bcond_007d-and-attributes-3669"></a><br><dt><code>(cond [</code><var>test1</var> <var>value1</var><code> ...] </code><var>default</var><code>)</code><dd>The first operand of this expression is a vector containing an even
|
||||
number of expressions and consisting of pairs of <var>test</var> and <var>value</var>
|
||||
expressions. The value of the <code>cond</code> expression is that of the
|
||||
<var>value</var> corresponding to the first true <var>test</var> expression. If
|
||||
none of the <var>test</var> expressions are true, the value of the <code>cond</code>
|
||||
expression is that of the <var>default</var> expression.
|
||||
</dl>
|
||||
|
||||
<p><var>test</var> expressions can have one of the following forms:
|
||||
|
||||
|
||||
<a name="index-g_t_0040code_007bconst_005fint_007d-and-attribute-tests-3670"></a>
|
||||
<dl><dt><code>(const_int </code><var>i</var><code>)</code><dd>This test is true if <var>i</var> is nonzero and false otherwise.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bnot_007d-and-attributes-3671"></a><a name="index-g_t_0040code_007bior_007d-and-attributes-3672"></a><a name="index-g_t_0040code_007band_007d-and-attributes-3673"></a><br><dt><code>(not </code><var>test</var><code>)</code><dt><code>(ior </code><var>test1</var> <var>test2</var><code>)</code><dt><code>(and </code><var>test1</var> <var>test2</var><code>)</code><dd>These tests are true if the indicated logical function is true.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bmatch_005foperand_007d-and-attributes-3674"></a><br><dt><code>(match_operand:</code><var>m</var> <var>n</var> <var>pred</var> <var>constraints</var><code>)</code><dd>This test is true if operand <var>n</var> of the insn whose attribute value
|
||||
is being determined has mode <var>m</var> (this part of the test is ignored
|
||||
if <var>m</var> is <code>VOIDmode</code>) and the function specified by the string
|
||||
<var>pred</var> returns a nonzero value when passed operand <var>n</var> and mode
|
||||
<var>m</var> (this part of the test is ignored if <var>pred</var> is the null
|
||||
string).
|
||||
|
||||
<p>The <var>constraints</var> operand is ignored and should be the null string.
|
||||
|
||||
<p><a name="index-g_t_0040code_007bmatch_005ftest_007d-and-attributes-3675"></a><br><dt><code>(match_test </code><var>c-expr</var><code>)</code><dd>The test is true if C expression <var>c-expr</var> is true. In non-constant
|
||||
attributes, <var>c-expr</var> has access to the following variables:
|
||||
|
||||
<dl>
|
||||
<dt><var>insn</var><dd>The rtl instruction under test.
|
||||
<br><dt><var>which_alternative</var><dd>The <code>define_insn</code> alternative that <var>insn</var> matches.
|
||||
See <a href="Output-Statement.html#Output-Statement">Output Statement</a>.
|
||||
<br><dt><var>operands</var><dd>An array of <var>insn</var>'s rtl operands.
|
||||
</dl>
|
||||
|
||||
<p><var>c-expr</var> behaves like the condition in a C <code>if</code> statement,
|
||||
so there is no need to explicitly convert the expression into a boolean
|
||||
0 or 1 value. For example, the following two tests are equivalent:
|
||||
|
||||
<pre class="smallexample"> (match_test "x & 2")
|
||||
(match_test "(x & 2) != 0")
|
||||
</pre>
|
||||
<p><a name="index-g_t_0040code_007ble_007d-and-attributes-3676"></a><a name="index-g_t_0040code_007bleu_007d-and-attributes-3677"></a><a name="index-g_t_0040code_007blt_007d-and-attributes-3678"></a><a name="index-g_t_0040code_007bgt_007d-and-attributes-3679"></a><a name="index-g_t_0040code_007bgtu_007d-and-attributes-3680"></a><a name="index-g_t_0040code_007bge_007d-and-attributes-3681"></a><a name="index-g_t_0040code_007bgeu_007d-and-attributes-3682"></a><a name="index-g_t_0040code_007bne_007d-and-attributes-3683"></a><a name="index-g_t_0040code_007beq_007d-and-attributes-3684"></a><a name="index-g_t_0040code_007bplus_007d-and-attributes-3685"></a><a name="index-g_t_0040code_007bminus_007d-and-attributes-3686"></a><a name="index-g_t_0040code_007bmult_007d-and-attributes-3687"></a><a name="index-g_t_0040code_007bdiv_007d-and-attributes-3688"></a><a name="index-g_t_0040code_007bmod_007d-and-attributes-3689"></a><a name="index-g_t_0040code_007babs_007d-and-attributes-3690"></a><a name="index-g_t_0040code_007bneg_007d-and-attributes-3691"></a><a name="index-g_t_0040code_007bashift_007d-and-attributes-3692"></a><a name="index-g_t_0040code_007blshiftrt_007d-and-attributes-3693"></a><a name="index-g_t_0040code_007bashiftrt_007d-and-attributes-3694"></a><br><dt><code>(le </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(leu </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(lt </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(ltu </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(gt </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(gtu </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(ge </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(geu </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(ne </code><var>arith1</var> <var>arith2</var><code>)</code><dt><code>(eq </code><var>arith1</var> <var>arith2</var><code>)</code><dd>These tests are true if the indicated comparison of the two arithmetic
|
||||
expressions is true. Arithmetic expressions are formed with
|
||||
<code>plus</code>, <code>minus</code>, <code>mult</code>, <code>div</code>, <code>mod</code>,
|
||||
<code>abs</code>, <code>neg</code>, <code>and</code>, <code>ior</code>, <code>xor</code>, <code>not</code>,
|
||||
<code>ashift</code>, <code>lshiftrt</code>, and <code>ashiftrt</code> expressions.
|
||||
|
||||
<p><a name="index-get_005fattr-3695"></a><code>const_int</code> and <code>symbol_ref</code> are always valid terms (see <a href="Insn-Lengths.html#Insn-Lengths">Insn Lengths</a>,for additional forms). <code>symbol_ref</code> is a string
|
||||
denoting a C expression that yields an <code>int</code> when evaluated by the
|
||||
‘<samp><span class="samp">get_attr_...</span></samp>’ routine. It should normally be a global
|
||||
variable.
|
||||
|
||||
<p><a name="index-eq_005fattr-3696"></a><br><dt><code>(eq_attr </code><var>name</var> <var>value</var><code>)</code><dd><var>name</var> is a string specifying the name of an attribute.
|
||||
|
||||
<p><var>value</var> is a string that is either a valid value for attribute
|
||||
<var>name</var>, a comma-separated list of values, or ‘<samp><span class="samp">!</span></samp>’ followed by a
|
||||
value or list. If <var>value</var> does not begin with a ‘<samp><span class="samp">!</span></samp>’, this
|
||||
test is true if the value of the <var>name</var> attribute of the current
|
||||
insn is in the list specified by <var>value</var>. If <var>value</var> begins
|
||||
with a ‘<samp><span class="samp">!</span></samp>’, this test is true if the attribute's value is
|
||||
<em>not</em> in the specified list.
|
||||
|
||||
<p>For example,
|
||||
|
||||
<pre class="smallexample"> (eq_attr "type" "load,store")
|
||||
</pre>
|
||||
<p class="noindent">is equivalent to
|
||||
|
||||
<pre class="smallexample"> (ior (eq_attr "type" "load") (eq_attr "type" "store"))
|
||||
</pre>
|
||||
<p>If <var>name</var> specifies an attribute of ‘<samp><span class="samp">alternative</span></samp>’, it refers to the
|
||||
value of the compiler variable <code>which_alternative</code>
|
||||
(see <a href="Output-Statement.html#Output-Statement">Output Statement</a>) and the values must be small integers. For
|
||||
example,
|
||||
|
||||
<pre class="smallexample"> (eq_attr "alternative" "2,3")
|
||||
</pre>
|
||||
<p class="noindent">is equivalent to
|
||||
|
||||
<pre class="smallexample"> (ior (eq (symbol_ref "which_alternative") (const_int 2))
|
||||
(eq (symbol_ref "which_alternative") (const_int 3)))
|
||||
</pre>
|
||||
<p>Note that, for most attributes, an <code>eq_attr</code> test is simplified in cases
|
||||
where the value of the attribute being tested is known for all insns matching
|
||||
a particular pattern. This is by far the most common case.
|
||||
|
||||
<p><a name="index-attr_005fflag-3697"></a><br><dt><code>(attr_flag </code><var>name</var><code>)</code><dd>The value of an <code>attr_flag</code> expression is true if the flag
|
||||
specified by <var>name</var> is true for the <code>insn</code> currently being
|
||||
scheduled.
|
||||
|
||||
<p><var>name</var> is a string specifying one of a fixed set of flags to test.
|
||||
Test the flags <code>forward</code> and <code>backward</code> to determine the
|
||||
direction of a conditional branch.
|
||||
|
||||
<p>This example describes a conditional branch delay slot which
|
||||
can be nullified for forward branches that are taken (annul-true) or
|
||||
for backward branches which are not taken (annul-false).
|
||||
|
||||
<pre class="smallexample"> (define_delay (eq_attr "type" "cbranch")
|
||||
[(eq_attr "in_branch_delay" "true")
|
||||
(and (eq_attr "in_branch_delay" "true")
|
||||
(attr_flag "forward"))
|
||||
(and (eq_attr "in_branch_delay" "true")
|
||||
(attr_flag "backward"))])
|
||||
</pre>
|
||||
<p>The <code>forward</code> and <code>backward</code> flags are false if the current
|
||||
<code>insn</code> being scheduled is not a conditional branch.
|
||||
|
||||
<p><code>attr_flag</code> is only used during delay slot scheduling and has no
|
||||
meaning to other passes of the compiler.
|
||||
|
||||
<p><a name="index-attr-3698"></a><br><dt><code>(attr </code><var>name</var><code>)</code><dd>The value of another attribute is returned. This is most useful
|
||||
for numeric attributes, as <code>eq_attr</code> and <code>attr_flag</code>
|
||||
produce more efficient code for non-numeric attributes.
|
||||
</dl>
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -0,0 +1,291 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>File Framework - GNU Compiler Collection (GCC) Internals</title>
|
||||
<meta http-equiv="Content-Type" content="text/html">
|
||||
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
|
||||
<meta name="generator" content="makeinfo 4.11">
|
||||
<link title="Top" rel="start" href="index.html#Top">
|
||||
<link rel="up" href="Assembler-Format.html#Assembler-Format" title="Assembler Format">
|
||||
<link rel="next" href="Data-Output.html#Data-Output" title="Data Output">
|
||||
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
||||
<!--
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with the
|
||||
Invariant Sections being ``Funding Free Software'', the Front-Cover
|
||||
Texts being (a) (see below), and with the Back-Cover Texts being (b)
|
||||
(see below). A copy of the license is included in the section entitled
|
||||
``GNU Free Documentation License''.
|
||||
|
||||
(a) The FSF's Front-Cover Text is:
|
||||
|
||||
A GNU Manual
|
||||
|
||||
(b) The FSF's Back-Cover Text is:
|
||||
|
||||
You have freedom to copy and modify this GNU Manual, like GNU
|
||||
software. Copies published by the Free Software Foundation raise
|
||||
funds for GNU development.-->
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<style type="text/css"><!--
|
||||
pre.display { font-family:inherit }
|
||||
pre.format { font-family:inherit }
|
||||
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
||||
pre.smallformat { font-family:inherit; font-size:smaller }
|
||||
pre.smallexample { font-size:smaller }
|
||||
pre.smalllisp { font-size:smaller }
|
||||
span.sc { font-variant:small-caps }
|
||||
span.roman { font-family:serif; font-weight:normal; }
|
||||
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="node">
|
||||
<p>
|
||||
<a name="File-Framework"></a>
|
||||
Next: <a rel="next" accesskey="n" href="Data-Output.html#Data-Output">Data Output</a>,
|
||||
Up: <a rel="up" accesskey="u" href="Assembler-Format.html#Assembler-Format">Assembler Format</a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h4 class="subsection">17.21.1 The Overall Framework of an Assembler File</h4>
|
||||
|
||||
<p><a name="index-assembler-format-4497"></a><a name="index-output-of-assembler-code-4498"></a>
|
||||
<!-- prevent bad page break with this line -->
|
||||
This describes the overall framework of an assembly file.
|
||||
|
||||
<p><a name="index-default_005ffile_005fstart-4499"></a>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_FILE_START</b> (<var>void</var>)<var><a name="index-TARGET_005fASM_005fFILE_005fSTART-4500"></a></var><br>
|
||||
<blockquote><p>Output to <code>asm_out_file</code> any text which the assembler expects to
|
||||
find at the beginning of a file. The default behavior is controlled
|
||||
by two flags, documented below. Unless your target's assembler is
|
||||
quite unusual, if you override the default, you should call
|
||||
<code>default_file_start</code> at some point in your target hook. This
|
||||
lets other target files rely on these variables.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_ASM_FILE_START_APP_OFF</b><var><a name="index-TARGET_005fASM_005fFILE_005fSTART_005fAPP_005fOFF-4501"></a></var><br>
|
||||
<blockquote><p>If this flag is true, the text of the macro <code>ASM_APP_OFF</code> will be
|
||||
printed as the very first line in the assembly file, unless
|
||||
<samp><span class="option">-fverbose-asm</span></samp> is in effect. (If that macro has been defined
|
||||
to the empty string, this variable has no effect.) With the normal
|
||||
definition of <code>ASM_APP_OFF</code>, the effect is to notify the GNU
|
||||
assembler that it need not bother stripping comments or extra
|
||||
whitespace from its input. This allows it to work a bit faster.
|
||||
|
||||
<p>The default is false. You should not set it to true unless you have
|
||||
verified that your port does not generate any extra whitespace or
|
||||
comments that will cause GAS to issue errors in NO_APP mode.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_ASM_FILE_START_FILE_DIRECTIVE</b><var><a name="index-TARGET_005fASM_005fFILE_005fSTART_005fFILE_005fDIRECTIVE-4502"></a></var><br>
|
||||
<blockquote><p>If this flag is true, <code>output_file_directive</code> will be called
|
||||
for the primary source file, immediately after printing
|
||||
<code>ASM_APP_OFF</code> (if that is enabled). Most ELF assemblers expect
|
||||
this to be done. The default is false.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_FILE_END</b> (<var>void</var>)<var><a name="index-TARGET_005fASM_005fFILE_005fEND-4503"></a></var><br>
|
||||
<blockquote><p>Output to <code>asm_out_file</code> any text which the assembler expects
|
||||
to find at the end of a file. The default is to output nothing.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Function: void <b>file_end_indicate_exec_stack</b> ()<var><a name="index-file_005fend_005findicate_005fexec_005fstack-4504"></a></var><br>
|
||||
<blockquote><p>Some systems use a common convention, the ‘<samp><span class="samp">.note.GNU-stack</span></samp>’
|
||||
special section, to indicate whether or not an object file relies on
|
||||
the stack being executable. If your system uses this convention, you
|
||||
should define <code>TARGET_ASM_FILE_END</code> to this function. If you
|
||||
need to do other things in that hook, have your hook function call
|
||||
this function.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_LTO_START</b> (<var>void</var>)<var><a name="index-TARGET_005fASM_005fLTO_005fSTART-4505"></a></var><br>
|
||||
<blockquote><p>Output to <code>asm_out_file</code> any text which the assembler expects
|
||||
to find at the start of an LTO section. The default is to output
|
||||
nothing.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_LTO_END</b> (<var>void</var>)<var><a name="index-TARGET_005fASM_005fLTO_005fEND-4506"></a></var><br>
|
||||
<blockquote><p>Output to <code>asm_out_file</code> any text which the assembler expects
|
||||
to find at the end of an LTO section. The default is to output
|
||||
nothing.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_CODE_END</b> (<var>void</var>)<var><a name="index-TARGET_005fASM_005fCODE_005fEND-4507"></a></var><br>
|
||||
<blockquote><p>Output to <code>asm_out_file</code> any text which is needed before emitting
|
||||
unwind info and debug info at the end of a file. Some targets emit
|
||||
here PIC setup thunks that cannot be emitted at the end of file,
|
||||
because they couldn't have unwind info then. The default is to output
|
||||
nothing.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_COMMENT_START</b><var><a name="index-ASM_005fCOMMENT_005fSTART-4508"></a></var><br>
|
||||
<blockquote><p>A C string constant describing how to begin a comment in the target
|
||||
assembler language. The compiler assumes that the comment will end at
|
||||
the end of the line.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_APP_ON</b><var><a name="index-ASM_005fAPP_005fON-4509"></a></var><br>
|
||||
<blockquote><p>A C string constant for text to be output before each <code>asm</code>
|
||||
statement or group of consecutive ones. Normally this is
|
||||
<code>"#APP"</code>, which is a comment that has no effect on most
|
||||
assemblers but tells the GNU assembler that it must check the lines
|
||||
that follow for all valid assembler constructs.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_APP_OFF</b><var><a name="index-ASM_005fAPP_005fOFF-4510"></a></var><br>
|
||||
<blockquote><p>A C string constant for text to be output after each <code>asm</code>
|
||||
statement or group of consecutive ones. Normally this is
|
||||
<code>"#NO_APP"</code>, which tells the GNU assembler to resume making the
|
||||
time-saving assumptions that are valid for ordinary compiler output.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>ASM_OUTPUT_SOURCE_FILENAME</b> (<var>stream, name</var>)<var><a name="index-ASM_005fOUTPUT_005fSOURCE_005fFILENAME-4511"></a></var><br>
|
||||
<blockquote><p>A C statement to output COFF information or DWARF debugging information
|
||||
which indicates that filename <var>name</var> is the current source file to
|
||||
the stdio stream <var>stream</var>.
|
||||
|
||||
<p>This macro need not be defined if the standard form of output
|
||||
for the file format in use is appropriate.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_OUTPUT_SOURCE_FILENAME</b> (<var>FILE *file, const char *name</var>)<var><a name="index-TARGET_005fASM_005fOUTPUT_005fSOURCE_005fFILENAME-4512"></a></var><br>
|
||||
<blockquote><p>Output COFF information or DWARF debugging information which indicates that filename <var>name</var> is the current source file to the stdio stream <var>file</var>.
|
||||
|
||||
<p>This target hook need not be defined if the standard form of output for the file format in use is appropriate.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_OUTPUT_IDENT</b> (<var>const char *name</var>)<var><a name="index-TARGET_005fASM_005fOUTPUT_005fIDENT-4513"></a></var><br>
|
||||
<blockquote><p>Output a string based on <var>name</var>, suitable for the ‘<samp><span class="samp">#ident</span></samp>’ directive, or the equivalent directive or pragma in non-C-family languages. If this hook is not defined, nothing is output for the ‘<samp><span class="samp">#ident</span></samp>’ directive.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Macro: <b>OUTPUT_QUOTED_STRING</b> (<var>stream, string</var>)<var><a name="index-OUTPUT_005fQUOTED_005fSTRING-4514"></a></var><br>
|
||||
<blockquote><p>A C statement to output the string <var>string</var> to the stdio stream
|
||||
<var>stream</var>. If you do not call the function <code>output_quoted_string</code>
|
||||
in your config files, GCC will only call it to output filenames to
|
||||
the assembler source. So you can use it to canonicalize the format
|
||||
of the filename using this macro.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_NAMED_SECTION</b> (<var>const char *name, unsigned int flags, tree decl</var>)<var><a name="index-TARGET_005fASM_005fNAMED_005fSECTION-4515"></a></var><br>
|
||||
<blockquote><p>Output assembly directives to switch to section <var>name</var>. The section
|
||||
should have attributes as specified by <var>flags</var>, which is a bit mask
|
||||
of the <code>SECTION_*</code> flags defined in <samp><span class="file">output.h</span></samp>. If <var>decl</var>
|
||||
is non-NULL, it is the <code>VAR_DECL</code> or <code>FUNCTION_DECL</code> with which
|
||||
this section is associated.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: section * <b>TARGET_ASM_FUNCTION_SECTION</b> (<var>tree decl, enum node_frequency freq, bool startup, bool exit</var>)<var><a name="index-TARGET_005fASM_005fFUNCTION_005fSECTION-4516"></a></var><br>
|
||||
<blockquote><p>Return preferred text (sub)section for function <var>decl</var>.
|
||||
Main purpose of this function is to separate cold, normal and hot
|
||||
functions. <var>startup</var> is true when function is known to be used only
|
||||
at startup (from static constructors or it is <code>main()</code>).
|
||||
<var>exit</var> is true when function is known to be used only at exit
|
||||
(from static destructors).
|
||||
Return NULL if function should go to default text section.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: void <b>TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS</b> (<var>FILE *file, tree decl, bool new_is_cold</var>)<var><a name="index-TARGET_005fASM_005fFUNCTION_005fSWITCHED_005fTEXT_005fSECTIONS-4517"></a></var><br>
|
||||
<blockquote><p>Used by the target to emit any assembler directives or additional labels needed when a function is partitioned between different sections. Output should be written to <var>file</var>. The function decl is available as <var>decl</var> and the new section is `cold' if <var>new_is_cold</var> is <code>true</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Common Target Hook: bool <b>TARGET_HAVE_NAMED_SECTIONS</b><var><a name="index-TARGET_005fHAVE_005fNAMED_005fSECTIONS-4518"></a></var><br>
|
||||
<blockquote><p>This flag is true if the target supports <code>TARGET_ASM_NAMED_SECTION</code>.
|
||||
It must not be modified by command-line option processing.
|
||||
</p></blockquote></div>
|
||||
|
||||
<p><a name="TARGET_005fHAVE_005fSWITCHABLE_005fBSS_005fSECTIONS"></a>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: bool <b>TARGET_HAVE_SWITCHABLE_BSS_SECTIONS</b><var><a name="index-TARGET_005fHAVE_005fSWITCHABLE_005fBSS_005fSECTIONS-4519"></a></var><br>
|
||||
<blockquote><p>This flag is true if we can create zeroed data by switching to a BSS
|
||||
section and then using <code>ASM_OUTPUT_SKIP</code> to allocate the space.
|
||||
This is true on most ELF targets.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: unsigned int <b>TARGET_SECTION_TYPE_FLAGS</b> (<var>tree decl, const char *name, int reloc</var>)<var><a name="index-TARGET_005fSECTION_005fTYPE_005fFLAGS-4520"></a></var><br>
|
||||
<blockquote><p>Choose a set of section attributes for use by <code>TARGET_ASM_NAMED_SECTION</code>
|
||||
based on a variable or function decl, a section name, and whether or not the
|
||||
declaration's initializer may contain runtime relocations. <var>decl</var> may be
|
||||
null, in which case read-write data should be assumed.
|
||||
|
||||
<p>The default version of this function handles choosing code vs data,
|
||||
read-only vs read-write data, and <code>flag_pic</code>. You should only
|
||||
need to override this if your target has special flags that might be
|
||||
set via <code>__attribute__</code>.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: int <b>TARGET_ASM_RECORD_GCC_SWITCHES</b> (<var>print_switch_type type, const char *text</var>)<var><a name="index-TARGET_005fASM_005fRECORD_005fGCC_005fSWITCHES-4521"></a></var><br>
|
||||
<blockquote><p>Provides the target with the ability to record the gcc command line
|
||||
switches that have been passed to the compiler, and options that are
|
||||
enabled. The <var>type</var> argument specifies what is being recorded.
|
||||
It can take the following values:
|
||||
|
||||
<dl>
|
||||
<dt><code>SWITCH_TYPE_PASSED</code><dd><var>text</var> is a command line switch that has been set by the user.
|
||||
|
||||
<br><dt><code>SWITCH_TYPE_ENABLED</code><dd><var>text</var> is an option which has been enabled. This might be as a
|
||||
direct result of a command line switch, or because it is enabled by
|
||||
default or because it has been enabled as a side effect of a different
|
||||
command line switch. For example, the <samp><span class="option">-O2</span></samp> switch enables
|
||||
various different individual optimization passes.
|
||||
|
||||
<br><dt><code>SWITCH_TYPE_DESCRIPTIVE</code><dd><var>text</var> is either NULL or some descriptive text which should be
|
||||
ignored. If <var>text</var> is NULL then it is being used to warn the
|
||||
target hook that either recording is starting or ending. The first
|
||||
time <var>type</var> is SWITCH_TYPE_DESCRIPTIVE and <var>text</var> is NULL, the
|
||||
warning is for start up and the second time the warning is for
|
||||
wind down. This feature is to allow the target hook to make any
|
||||
necessary preparations before it starts to record switches and to
|
||||
perform any necessary tidying up after it has finished recording
|
||||
switches.
|
||||
|
||||
<br><dt><code>SWITCH_TYPE_LINE_START</code><dd>This option can be ignored by this target hook.
|
||||
|
||||
<br><dt><code>SWITCH_TYPE_LINE_END</code><dd>This option can be ignored by this target hook.
|
||||
</dl>
|
||||
|
||||
<p>The hook's return value must be zero. Other return values may be
|
||||
supported in the future.
|
||||
|
||||
<p>By default this hook is set to NULL, but an example implementation is
|
||||
provided for ELF based targets. Called <var>elf_record_gcc_switches</var>,
|
||||
it records the switches as ASCII text inside a new, string mergeable
|
||||
section in the assembler output file. The name of the new section is
|
||||
provided by the <code>TARGET_ASM_RECORD_GCC_SWITCHES_SECTION</code> target
|
||||
hook.
|
||||
</p></blockquote></div>
|
||||
|
||||
<div class="defun">
|
||||
— Target Hook: const char * <b>TARGET_ASM_RECORD_GCC_SWITCHES_SECTION</b><var><a name="index-TARGET_005fASM_005fRECORD_005fGCC_005fSWITCHES_005fSECTION-4522"></a></var><br>
|
||||
<blockquote><p>This is the name of the section that will be created by the example
|
||||
ELF implementation of the <code>TARGET_ASM_RECORD_GCC_SWITCHES</code> target
|
||||
hook.
|
||||
</p></blockquote></div>
|
||||
|
||||
</body></html>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue