This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Backport PowerPC complex __float128 compiler support to GCC 6.x
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Richard Henderson <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Jeff Law <law at redhat dot com>, Jason Merrill <jason at redhat dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Ian Lance Taylor <ian at airs dot com>, Jim Wilson <wilson at tuliptree dot org>
- Date: Tue, 21 Jun 2016 20:55:38 +0000
- Subject: Re: [PATCH] Backport PowerPC complex __float128 compiler support to GCC 6.x
- Authentication-results: sourceware.org; auth=none
- References: <20160603133335 dot GA28522 at ibm-tiger dot the-meissners dot org> <20160609200653 dot GA3361 at ibm-tiger dot the-meissners dot org> <alpine dot LSU dot 2 dot 11 dot 1606100905380 dot 13824 at t29 dot fhfr dot qr> <AB463E7C-3875-42DB-8B4D-035126F66ED1 at linux dot vnet dot ibm dot com> <alpine dot LSU dot 2 dot 11 dot 1606151055080 dot 13824 at t29 dot fhfr dot qr> <20160615123405 dot GA32375 at ibm-tiger dot the-meissners dot org> <alpine dot DEB dot 2 dot 20 dot 1606162156020 dot 18420 at digraph dot polyomino dot org dot uk> <20160621185153 dot GA29884 at ibm-tiger dot the-meissners dot org>
On Tue, 21 Jun 2016, Michael Meissner wrote:
> > I'm now working on support for TS 18661-3 _FloatN / _FloatNx type names
> > (keywords), constant suffixes and <float.h> addiitions. That will
> > address, for C, the need to use modes for complex float128 (bug 32187) by
> > allowing the standard _Complex _Float128 to be used. The issue would
> > still apply for C++ (I'm not including any C++ support for these type
> > names / constant suffixes in my patch), and for complex ibm128.
>
> Great!
>
> Of course we will need to have some solution for C++.
Since the C++-standard way of using complex numbers is std::complex, it's
not clear to me that the C-compatible _Complex _Float128 needs to be
particularly conveniently avilable in C++.
Rather, where the C++ standard says "The effect of instantiating the
template complex for any type other than float, double, or long double is
unspecified. The specializations complex<float>, complex<double>, and
complex<long double> are literal types (3.9).", presumably one should aim
to make complex<__float128> work properly if it doesn't already. And that
might internally use _Complex _Float128 in some way to call libm functions
when available, much as libstdc++ currently has _GLIBCXX_USE_C99_COMPLEX.
And then I suppose you'd want to make appropriate literal suffixes work as
well. That's part of rather more generally making libstdc++ work with a
new floating-point type;
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43622> has an overview of
the sorts of things involved and links to other discussions.
Standard C++ support for decimal floating-point types, TR 24733, took the
form of classes such as std::decimal::decimal64 rather than the C-style
_Decimal64. I don't know what form C++ bindings to IEEE interchange and
extended types might take, but something similar would seem natural.
--
Joseph S. Myers
joseph@codesourcery.com