This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR libstdc++/84654 Do not use __float128 if it is disabled by the compiler
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Cc: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, wschmidt at linux dot vnet dot ibm dot com, Segher Boessenkool <segher at kernel dot crashing dot org>
- Date: Thu, 1 Mar 2018 22:04:03 +0000
- Subject: Re: [PATCH] PR libstdc++/84654 Do not use __float128 if it is disabled by the compiler
- Authentication-results: sourceware.org; auth=none
- References: <20180301184719.16691-1-tuliom@linux.vnet.ibm.com> <alpine.DEB.2.21.1803011951040.15620@stedding.saclay.inria.fr>
On 1 March 2018 at 18:54, Marc Glisse wrote:
> On Thu, 1 Mar 2018, Tulio Magno Quites Machado Filho wrote:
>
>> In order to use the __float128 in C++ it's necessary to check if
>> it is supported in libstdc++ (i.e. via _GLIBCXX_USE_FLOAT128) and if the
>> compiler enabled its support too, e.g. -mfloat128 or -mno-float128.
>
>
> Shouldn't we ensure that _GLIBCXX_USE_FLOAT128 is undefined instead?
Yes, a better approach might be to add this to
libstdc++-v3/include/bits/c++config.h:
#define _GLIBCXX_USE_FLOAT128
#if !defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)
#undef _GLIBCXX_USE_FLOAT128
#endif
Then change libstdc++-v3/acinclude.m4 so that instead of defining
_GLIBCXX_USE_FLOAT128 it does:
GLIBCXX_CONDITIONAL(ENABLE_FLOAT128, ...)
and then have libstdc++-v3/include/Makefile modify <bits/c++config.h>
based on that, setting _GLIBCXX_USE_FLOAT128 to 0 or 1