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: Jakub Jelinek <jakub at redhat dot com>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, wschmidt at linux dot vnet dot ibm dot com, segher at kernel dot crashing dot org
- Date: Thu, 1 Mar 2018 21:52:17 +0100
- 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> <20180301191003.GR5867@tucnak>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Mar 01, 2018 at 08:10:03PM +0100, Jakub Jelinek wrote:
> On Thu, Mar 01, 2018 at 03:47:19PM -0300, 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.
> >
> > 2018-03-01 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
>
> Two spaces between date and name and name and email address.
>
> > PR libstdc++/84654
> > * include/bits/std_abs.h: Avoid to use __float128 when the
> > compiler disabled it.
> > * include/std/type_traits: Likewise.
>
> That is incorrect. Only powerpc* defines __FLOAT128__ macro, but it isn't
> the only one with __float128 type, e.g. x86_64-linux provides __float128
> too, but doesn't define __FLOAT128__.
>
> On x86_64-linux one can check for defined(__SIZEOF_FLOAT128__) instead.
>
> One could argue that what powerpc does is wrong, defining __SIZEOF_*__ is
> consistent with all the other __SIZEOF_*__ macros.
>
> Also (up to libstdc++ maintainers) I'd say that _GLIBCXX_USE_FLOAT128
> macro should depend on this macro, rather than uglifying all the uses.
> So, #undef somewhere _GLIBCXX_USE_FLOAT128 if __SIZEOF_FLOAT128__ is
> not defined.
Note ia64, pa and powerpcspe likely need to be fixed too to predefine
__SIZEOF_FLOAT128__=16 if they provide __float128.
Jakub