[PATCH] PR libstdc++/84654 Do not use __float128 if it is disabled by the compiler
Jakub Jelinek
jakub@redhat.com
Thu Mar 1 20:52:00 GMT 2018
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
More information about the Libstdc++
mailing list