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]

[doc patch] document powerpc abi changes


I would like to apply the following, which documents PowerPC ABI
changes (that I know about!) for gcc-3.4.  Tested by
http://validator.w3.org/

--- htdocs/gcc-3.4/changes.html	2004-11-15 07:55:42.000000000 +1030
+++ changes.html	2004-11-22 13:28:25.150853629 +1030
@@ -955,7 +955,16 @@
 	  aimed at reducing the reliance on assembler macros.</li>
     </ul>
 
-<h3>PowerPC Darwin</h3>
+<h3>PowerPC</h3>
+  <ul>
+    <li>GCC 3.4 releases have a number of fixes for PowerPC and PowerPC64
+    <a href="powerpc-abi.html"> ABI incompatibilities</a>
+    regarding the way parameters are passed during functions calls.
+    These changes may result in incompatibility between code compiled
+    with GCC 3.3 and GCC 3.4.</li> 
+  </ul>
+
+<h4>PowerPC Darwin</h4>
   <ul>
     <li>Support for shared/dylib gcc libraries has been added. It is
       enabled by default on <code>powerpc-apple-darwin7.0.0</code>
@@ -965,6 +974,23 @@
       powerpc-apple-darwin7.0.0</code> you need to install <a
       href="http://www.opendarwin.org/projects/dlcompat/";>dlcompat</a>.
       </li>
+
+    <li>128 bit IBM extended precision format support added for long
+    doubles.</li>
+  </ul>
+
+<h4>PowerPC64 Linux</h4>
+  <ul>
+    <li> By default, PowerPC64 Linux now uses natural alignment of
+    structure elements.  The old four byte alignment for doubles, with
+    special rules for structs starting with a double, can be chosen with
+    -malign-power.  This change may result in incompatibility between
+    code compiled with GCC 3.3 and GCC 3.4.</li> 
+
+    <li>-mabi=altivec is now the default rather than -mabi=no-altivec.</li>
+
+    <li>128 bit IBM extended precision format support added for long
+    doubles.</li>
   </ul>
 
 <h3>S/390 and zSeries</h3>

--- /dev/null	2003-09-22 23:30:38.000000000 +0930
+++ powerpc-abi.html	2004-11-22 13:31:16.534935949 +1030
@@ -0,0 +1,132 @@
+<html>
+
+<head>
+<title>PowerPC ABI Changes in GCC 3.4 - GNU Project - Free Software Foundation (FSF)</title>
+</head>
+
+<body>
+<h1>PowerPC ABI Changes in GCC 3.4</h1>
+
+<p>The GCC 3.4 release series fixed several cases in which earlier
+   releases did not follow the proper calling conventions.  These
+   fixes unfortunately did not all happen in one release, so in certain
+   rare cases code will be incompatible when using different version
+   compilers within the release series.</p>
+
+
+<h2>Fixed in 3.4.0</h2>
+
+  <ul>
+    <li>_Complex integer types smaller than _Complex long, and _Complex
+    floating point types smaller than _Complex double were passed and
+    returned incorrectly in one register instead of the real and
+    imaginary components being in separate registers.  This has been
+    fixed for PowerPC64 Linux and AIX, with PowerPC Linux and Darwin
+    opting to stay compatible with GCC 3.3.</li>
+  </ul>
+
+  <ul>
+    <li>Under -mabi=altivec, PowerPC64 Linux used to pass vector args to
+    non-prototyped functions only in vector registers.  Without a
+    prototype the arg is supposed to be passed in both vector registers
+    and in gprs or on the stack.</li>
+  </ul>
+
+  <ul>
+    <li>DWARF2 debug information failed to use the correct numbers for
+    registers other than gprs or fprs.  This affected both PowerPC and
+    PowerPC64 Linux.</li>
+  </ul>
+
+  <ul>
+    <li>Many bugs fixed related to mixed-mode code, that is, use of
+    64-bit instructions and data on a 32-bit ABI.  Previously, 64-bit
+    values such as long long were passed in one register instead of
+    being split into separate 32-bit registers as required by the ABI.</li>
+  </ul>
+
+  <ul>
+    <li>Zero size arrays were incorrectly passed by reference in GCC
+    3.3.1 and GCC 3.3.0, a regression from GCC 3.2.  This was also fixed
+    in GCC 3.3.2.</li>
+  </ul>
+
+  <ul>
+    <li>Small structures passed by value were passed at the wrong end of
+    registers, or padded at the wrong end in memory, or passed on the
+    stack when they should be passed in registers.  AIX and PowerPC64
+    Linux support has been changed to comply with their respective ABIs,
+    which necessarily introduces an incompatibility with GCC 3.3.
+    &quot;Small&quot; here means less than eight bytes for the 64 bit
+    ABIs, and less than four bytes for AIX-32.</li>
+  </ul>
+
+
+<h2>Fixed in 3.4.1</h2>
+
+  <ul>
+    <li>Under -mabi=no-altivec, vector parameters were not aligned, and
+    wrong code was used to access them if the target function used
+    vector instructions.  Furthermore, -maltivec affected the way vector
+    parameters were passed and returned.  This affected all ABIs, both
+    32 bit and 64 bit.  The fix necessarily introduces an incompatibility
+    between GCC 3.3 and GCC 3.4, but not for the more common
+    -mabi=altivec case.</li>
+  </ul>
+
+  <ul>
+    <li>PowerPC Linux had a number of problems with functions accepting
+    variable arguments, with disagreement between caller and callee over
+    where arguments were to be found.  Affected were: all _Complex types,
+    128 bit long double, and vectors under -mabi=altivec when all altivec
+    registers had been used.</li>
+  </ul>
+
+  <ul>
+    <li>PowerPC64 Linux and AIX generated incorrect code for certain
+    _Complex types in functions accepting variable arguments.  _Complex
+    integer types smaller than _Complex long, and _Complex floating
+    point types smaller than _Complex double, were not properly
+    repackaged from registers used to pass the values.</li>
+  </ul>
+
+  <ul>
+    <li>A 128 bit long double partially passed in fp13 (because
+    fp2..fp12 were used for other fp args) also incorrectly used fp14
+    instead of passing the remainder of the arg on the stack.  Affected
+    PowerPC64 Linux, AIX, and Darwin.</li>
+  </ul>
+
+
+<h2>Fixed in 3.4.2</h2>
+
+  <ul>
+    <li>Arguments requiring alignment, and also passed partly in
+    registers and partly on the stack, did not have all the stack words
+    written.  This bug affected AIX-32 and Darwin in the following cases:
+    <ul><li>Under -mabi=altivec, vector args passed in the variable argument
+    part of a function with an ellipsis in the prototype.</li>
+    <li>Under -mabi=no-altivec, all vector args.</li></ul>
+    To be affected by this bug, the vector arg needs to be passed in r9,
+    r10 and two stack words, and r8 not be used for passing other args.</li>
+  </ul>
+
+  <ul>
+    <li>AIX-32 didn't pass 128 bit long doubles correctly when they
+    needed to be passed both in gprs and fprs (variable arg functions,
+    or not prototyped).  For example, if the long double should have
+    been passed partially in r8,r9,r10 then only r8 was set.</li>
+  </ul>
+
+  <ul>
+    <li>A 128 bit long double passed partially in fprs and partially on
+    the stack caused a compiler abort on PowerPC64 Linux and AIX-64.</li>
+  </ul>
+
+  <ul>
+    <li>Mixed-mode parameter passing bugs fixed for PowerPC Linux.
+    Somehow, PowerPC Linux missed the fixes applied for the other 32 bit
+    ABIs for GCC 3.4.0.</li>
+  </ul>
+</body>
+</html>

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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