This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Add C++ runtime support for new 128-bit long double format
- From: Michael Meissner <meissner at linux dot ibm dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Pat Haugen <pthaugen at linux dot ibm dot com>, Peter Bergner <bergner at vnet dot ibm dot com>, Bill Schmidt <wschmidt at us dot ibm dot com>
- Date: Wed, 14 Nov 2018 08:16:50 -0500
- Subject: Re: [PATCH] Add C++ runtime support for new 128-bit long double format
- References: <20181112110945.GA26361@redhat.com>
On Mon, Nov 12, 2018 at 11:09:45AM +0000, Jonathan Wakely wrote:
> This adds support for the new 128-bit long double format on powerpc64,
> see https://fedoraproject.org/wiki/Changes/PPC64LE_Float128_Transition
> for more details.
>
> Most of the required changes are to the locale facets that parse and
> print long doubles, as used by iostreams for reading/writing numbers.
Thanks for the patches. Unfortunately I find if I use the Advance Toolchain
AT12 libraries which have the <func>f128 functions, and I try to use it, I get
some redefinition errors:
In file included from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/bits/move.h:55,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/bits/nested_exception.h:40,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/exception:144,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/ios:39,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/ostream:38,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/iostream:39,
from foo.cc:1:
/home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/type_traits:340:12: error: redefinition of 'struct std::__is_floating_point_helper<long double>'
340 | struct __is_floating_point_helper<__float128>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/type_traits:335:12: note: previous definition of 'struct std::__is_floating_point_helper<long double>'
335 | struct __is_floating_point_helper<long double>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/cstdlib:77,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/ext/string_conversions.h:41,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/bits/basic_string.h:6412,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/string:52,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/bits/locale_classes.h:40,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/bits/ios_base.h:41,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/ios:42,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/ostream:38,
from /home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/iostream:39,
from foo.cc:1:
/home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/bits/std_abs.h:102:3: error: redefinition of 'constexpr long double std::abs(long double)'
102 | abs(__float128 __x)
| ^~~
/home/meissner/fsf-install-ppc64le/ieee-c++/include/c++/9.0.0/bits/std_abs.h:78:3: note: 'constexpr long double std::abs(long double)' previously defined here
78 | abs(long double __x)
| ^~~
I configured the compiler with the options:
/home/meissner/fsf-src/ieee-c++/configure \
--prefix=/home/meissner/fsf-install-ppc64le/ieee-c++ \
--enable-languages=c,c++,fortran --enable-checking --enable-stage1-checking \
--enable-gnu-indirect-function --enable-plugin --enable-decimal-float \
--with-long-double-128 --enable-secureplt --enable-threads=posix \
--enable-__cxa_atexit --with-cpu=power8 \
--with-as=/opt/at12.0/bin/as --with-ld=/opt/at12.0/bin/ld \
--with-gnu-as=/opt/at12.0/bin/as --with-gnu-ld=/opt/at12.0/bin/ld \
--with-advance-toolchain=at12.0 --with-native-system-header-dir=/opt/at12.0/include \
--without-ppl --without-cloog --without-isl
The test case was:
#include <iostream>
#ifndef TYPE
#define TYPE long double
#endif
volatile TYPE a = (TYPE)3, b = (TYPE)4;
int main (void)
{
std::cout << "Value is " << a+b << "\n";
return 0;
}
And I invoked the compiler with:
$ /home/meissner/fsf-install-ppc64le/ieee-c++/bin/g++ -O2 -mabi=ieeelongdouble -Wno-psabi foo.cc
Let me know if I can help in testing future versions of the patch.
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.ibm.com, phone: +1 (978) 899-4797