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]

Re: [PATCH] PR 85075, Fix PowerPC __float182/__ibm128 types and mangling


On Mon, Apr 16, 2018 at 11:53:13AM -0500, Segher Boessenkool wrote:
> Hi!
> 
> Thank you for working on this.
> 
> On Sun, Apr 15, 2018 at 03:50:44PM -0400, Michael Meissner wrote:
> > PR target/85075 shows that there are some problems with the types for the 3
> > 128-bit floating point types on the PowerPC:
> > 
> > 	__float128	(and _Float128 in C, IEEE 128-bit)
> > 	__ieee128	(IBM extended double)
> 
> (You mean __ibm128, right?)

Yes.

> > 	long double	(either IEEE 128-bit or IBM extended double)
> 
> > In developing this patch, Segher noticed that the mangling for __float128
> > violated the mangling standards.  This patch includes a change to use a more
> > official mangling (u10__float128).
> 
> To use a mangling that works *at all*, yeah.
> 
> > This means that GCC 8 will not be able to
> > link with C++ functions that pass or return __float128 values compiled with GCC
> > 6 or GCC 7.  I have put in a warning if __float128 is mangled.  The warning can
> > be silenced by using -Wno-psabi.
> 
> It's a note, not a warning (so -Werror won't fail builds, etc.)
> 
> > In addition, when I built this on big endian system, the changes exposed a
> > latent bug with the way __builtin_packlongdouble was done when it tried to
> > support the first argument overlapping with the result.  I have removed the
> > code to support overlapping input/output for this builtin.  I imagine that we
> > will need to add __builtin_packieee128 and __builtin_unpackieee128 as well in
> > the future (or make __builtin_{,un}packlongdouble support all three types).
> 
> Please send this part as a separate patch.  It will need backports, too.

I opened up PR 85424, and submitted this patch:
https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00767.html

Here is the PR 85075 patch without the rs6000.md bits:

[gcc]
2018-04-16  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/85075
	* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): __ibm128 is
	now a separate type, don't #define __ibm128 as long double.
	* config/rs6000/rs6000.c (rs6000_init_builtins): Make __ibm128 a
	separate type on systems that support IEEE 128-bit floating point.
	(rs6000_mangle_type): Use separate manglings for __ibm128 and
	__float128.  Change __float128 mangling from U10__float128 to
	u10__float128.  Issue a warning that the mangling has changed in
	GCC 8.

[gcc/testsuite]
2018-04-16  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/85075
	* g++.dg/pr85075-1.C: New tests.  Make sure that __float128,
	__ibm128, and long double are different types, and that you can
	mix them in templates and with overloaded functions.  Test all 3
	different long dobule variants (IEEE 128 bit, IBM 128 bit, and 64
	bit).
	* g++.dg/pr85075-2.C: Likewise.
	* g++.dg/pr85075-3.C: Likewise.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797

Attachment: pr85075.patch13b
Description: Text document


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