This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Document changes in 3.4 for SPARC


Hi,

As suggested by Gerald, this patch documents the few changes in 3.4 specific 
to the SPARC port.  They are mostly ABI fixes, so I shamelessly borrowed the 
structure of mips-abi.html to devise the new sparc-abi.html which is, 
according to the W3C XHTML 1.0 Strict validator, "tentatively valid" :-)

-- 
Eric Botcazou
Index: gcc-3.4/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.4/changes.html,v
retrieving revision 1.90
diff -u -r1.90 changes.html
--- gcc-3.4/changes.html	26 Jan 2004 22:35:22 -0000	1.90
+++ gcc-3.4/changes.html	27 Jan 2004 18:32:55 -0000
@@ -633,6 +633,16 @@
       href="http://www.opendarwin.org/projects/dlcompat";> dlcompat</a>. </li>
   </ul>
 
+<h4>SPARC</h4>
+  <ul>
+    <li>Support for large (&gt; 2GB) frames has been added to the
+    64-bit port.</li>
+
+    <li>Several <a href="sparc-abi.html">ABI bugs</a> have been fixed.
+    Unfortunately, these changes will break binary compatibility with
+    earlier releases.</li>
+  </ul>
+
 <h4>SuperH</h4>
   <ul>
     <li>Support for the SH2E processor has been added.
--- /dev/null	Thu Apr 11 16:25:15 2002
+++ gcc-3.4/sparc-abi.html	Tue Jan 27 16:42:05 2004
@@ -0,0 +1,355 @@
+<html>
+
+<head>
+<title>SPARC ABI Changes in GCC 3.4</title>
+</head>
+
+<body>
+
+<h1>SPARC ABI Changes in GCC 3.4</h1>
+
+<p>GCC 3.4 fixes several cases in which earlier releases would not
+   follow the SPARC calling conventions.  This document describes
+   each fix and the kind of code it will affect.  In each case,
+   GCC 3.4 will not be binary compatible with earlier releases.</p>
+
+<p>Most of the fixes are related to the handling of small structure
+   and union types in 64-bit mode.</p>
+
+<h2>A. Small structure arguments and return values (1)</h2>
+
+<table cellpadding="4">
+  <tr valign="top">
+    <th align="right">Affected&nbsp;ABI</th>
+    <td>64-bit</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Conditions</th>
+    <td><ul>
+	  <li>A small structure is passed or returned in a register; and</li>
+	  <li>it contains a unique field of type 'float' .</li>
+	</ul></td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Old&nbsp;behavior</th>
+    <td>The register was odd-numbered.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">New&nbsp;behavior</th>
+    <td>The register is even-numbered.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Example</th>
+    <td><pre>struct s { float f; };
+void g (struct s x);</pre>
+
+	<p><code>x</code> is passed in floating-point register <code>%f0</code>,
+	   instead of <code>%f1</code> previously.</p></td>
+  </tr>
+</table>
+
+<h2>B. Small structure arguments and return values (2)</h2>
+
+<table cellpadding="4">
+  <tr valign="top">
+    <th align="right">Affected&nbsp;ABI</th>
+    <td>64-bit</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Conditions</th>
+    <td><ul>
+	  <li>A small structure is passed or returned in registers;</li>
+	  <li>its size in bytes is not a multiple of 8 and is greater than 8;</li>
+	  <li>its last field is of integral type; and</li>
+	  <li>its last but one field is smaller than a word.</li>
+	</ul></td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Old&nbsp;behavior</th>
+    <td>The last used register was padded at the most significant end.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">New&nbsp;behavior</th>
+    <td>The last used register is padded at the least significant end.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Example</th>
+    <td><pre>struct s { float f; int i; int j; };
+void g (struct s x);</pre>
+
+	<p><code>x</code> is passed in several registers, which are laid
+	    out as follows:</p>
+
+	<table cellpadding="4">
+	  <tr align="center">
+	  <th></th>
+	  <th>%f0</th> <th>%o0 (high)</th> <th>%o0 (low)</th>
+	  <th>%o1 (high)</th> <th>%o1 (low)</th>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">Old&nbsp;behavior</th>
+	  <td>f</td> <td>padding</td> <td>i</td>
+	  <td>padding</td> <td>j</td>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">New&nbsp;behavior</th>
+	  <td>f</td> <td>padding</td> <td>i</td>
+	  <td>j</td> <td>padding</td>
+	  </tr>
+	</table></td>
+  </tr>
+</table>
+
+<h2>C. Small unions arguments and return values</h2>
+
+<table cellpadding="4">
+  <tr valign="top">
+    <th align="right">Affected&nbsp;ABI</th>
+    <td>64-bit</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Conditions</th>
+    <td><ul>
+	  <li>A small union is passed or returned in a register; and</li>
+	  <li>its size in bytes is lesser than 8.</li>
+	</ul></td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Old&nbsp;behavior</th>
+    <td>The register was padded at the most significant end.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">New&nbsp;behavior</th>
+    <td>The register is padded at the least significant end.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Example</th>
+    <td><pre>union u { int i; float f; };
+void g (union u x);</pre>
+
+	<p><code>x</code> is passed in register <code>%o0</code>, which is
+	   laid out as follows:</p>
+
+	<table cellpadding="4">
+	  <tr align="center">
+	  <th></th>
+	  <th>%o0 (high)</th> <th>%o0 (low)</th>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">Old&nbsp;behavior</th>
+	  <td>padding</td> <td>i/f</td>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">New&nbsp;behavior</th>
+	  <td>i/f</td> <td>padding</td>
+	  </tr>
+	</table></td>
+  </tr>
+</table>
+
+<h2>D. Small structure arguments (1)</h2>
+
+<table cellpadding="4">
+  <tr valign="top">
+    <th align="right">Affected&nbsp;ABI</th>
+    <td>64-bit</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Conditions</th>
+    <td><ul>
+	  <li>A small structure is passed past the 6th argument slot and
+	      prior to the last one; and</li>
+	  <li>it contains a complex floating-point field.</li>
+	</ul></td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Old&nbsp;behavior</th>
+    <td>The complex floating-point field was passed in memory.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">New&nbsp;behavior</th>
+    <td>The complex floating-point field is passed in registers.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Example</th>
+    <td><pre>struct s { _Complex float cf; };
+void g (struct s x1, struct s x2, struct s x3, struct s x4, struct s x5, struct s x6, struct s x7);</pre>
+
+	<p><code>x7</code> is passed in floating-point registers <code>%f12-%f13</code>,
+	   instead of in memory previously.</p></td>
+  </tr>
+</table>
+
+<h2>E. Small structure arguments (2)</h2>
+
+<table cellpadding="4">
+  <tr valign="top">
+    <th align="right">Affected&nbsp;ABI</th>
+    <td>64-bit</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Conditions</th>
+    <td><ul>
+	  <li>A small structure is passed past the 6th argument slot and
+	      prior to the last one;</li>
+	  <li>it contains a nested structure; and</li>
+	  <li>the nested structure contains a floating-point field.</li>
+	</ul></td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Old&nbsp;behavior</th>
+    <td>The floating-point field was passed in memory.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">New&nbsp;behavior</th>
+    <td>The floating-point field is passed in registers.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Example</th>
+    <td><pre>struct s { struct { double d; } ns; };
+void g (struct s x1, struct s x2, struct s x3, struct s x4, struct s x5, struct s x6, struct s x7);</pre>
+
+	<p><code>x7</code> is passed in floating-point registers <code>%f12-%f13</code>,
+	   instead of in memory previously.</p></td>
+  </tr>
+</table>
+
+<h2>F. Complex floating-point arguments and return values</h2>
+
+<table cellpadding="4">
+  <tr valign="top">
+    <th align="right">Affected&nbsp;ABI</th>
+    <td>32-bit</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Conditions</th>
+    <td>A complex floating-point value is passed to or returned from a
+	function.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Old&nbsp;behavior</th>
+    <td><p>The complex floating-point value was passed or returned according
+	   to the following table:</p>
+
+	<table cellpadding="4">
+	  <tr align="center">
+	  <th></th>
+	  <th>argument</th> <th>return&nbsp;value</th>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">_Complex float</th>
+	  <td>integer registers</td> <td>integer registers</td>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">_Complex double</th>
+	  <td>integer registers</td> <td>integer registers</td>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">_Complex long double</th>
+	  <td>memory</td> <td>memory</td>
+	  </tr>
+	</table></td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">New&nbsp;behavior</th>
+    <td><p>The complex floating-point value is passed or returned according
+	   to the following table:</p>
+
+	<table cellpadding="4">
+	  <tr align="center">
+	  <th></th>
+	  <th>argument</th> <th>return&nbsp;value</th>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">_Complex float</th>
+	  <td>memory</td> <td>floating-point registers</td>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">_Complex double</th>
+	  <td>memory</td> <td>floating-point registers</td>
+	  </tr>
+
+	  <tr align="center">
+	  <th align="left">_Complex long double</th>
+	  <td>memory</td> <td>floating-point registers</td>
+	  </tr>
+	</table></td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Example</th>
+    <td><pre>_Complex float g (void);</pre>
+
+	<p>The return value is returned in floating-point registers <code>%f0-%f1</code>,
+	   instead of registers <code>%o0-%o1</code> previously.</p></td>
+  </tr>
+</table>
+
+<h2>G. Complex integral arguments (GCC extension)</h2>
+
+<table cellpadding="4">
+  <tr valign="top">
+    <th align="right">Affected&nbsp;ABI</th>
+    <td>64-bit</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Conditions</th>
+    <td>A complex integral value is passed in registers.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Old&nbsp;behavior</th>
+    <td>Two consecutive registers were reserved, regardless of the size of
+        the complex integral value.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">New&nbsp;behavior</th>
+    <td>Only one register is reserved if the complex integral value can fit
+        in a single register.</td>
+  </tr>
+
+  <tr valign="top">
+    <th align="right">Example</th>
+    <td><pre>void g (_Complex int x1, _Complex int x2);</pre>
+
+        <p><code>x2</code> is passed in register <code>%o1</code>, instead
+	    of <code>%o2</code> previously.</p></td>
+  </tr>
+</table>
+
+</body>
+</html>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]