[Bug libstdc++/43622] no C++ typeinfo for __float128

john at johnmaddock dot co.uk gcc-bugzilla@gcc.gnu.org
Thu Nov 20 17:12:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43622

John Maddock <john at johnmaddock dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john at johnmaddock dot co.uk

--- Comment #24 from John Maddock <john at johnmaddock dot co.uk> ---
(In reply to joseph@codesourcery.com from comment #23)
> On Tue, 18 Nov 2014, glisse at gcc dot gnu.org wrote:
> 
> > __float128 is still missing a specialization of numeric_limits.
> 
> Fully supporting an extended type (whether floating-point, or one like 
> __int128 that mostly acts like an integer type) includes (as I noted in 
> one of the other past bug reports on such issues, bug 50441 (fixed)) 
> typeinfo, numeric_limits (maybe with associated built-in macros), I/O and 
> mathematical functions in general.
> 
> But you may not want libstdc++ to depend on libquadmath, which may limit 
> what you can support for __float128.  (The ideal would be full C support 
> for the relevant parts of TS 18661 in GCC and glibc, which would give you 
> library support in libc and libm that could then be used from libstdc++ 
> when used with glibc.)
> 
> I think it would be reasonable to define built-in __FLT128_*__ macros for 
> __float128 similar to those defined for other floating-point types (you'd 
> then make quadmath.h use those instead of hardcoding the values directly) 
> - and you could then use those macros in numeric_limits.  That naming is 
> in line with DTS 18661-3 defining e.g. FLT128_MANT_DIG as public names for 
> macros relating to _Float128.

+1 on supporting numeric_limits.

IMO while it would be nice to provide full standard lib support, there are
levels of importance here.  typeinfo was essential because the user cannot add
that support themselves.  numeric_limits and iostream support come next in
importance, and of course std::whatever overloads for the <cmath> functions
would be nice but come lower down I guess.

I understand the desire to limit the dependency on libquadmath - perhaps first
class std lib support should be added to <quadmath.h> rather than <limits>,
<cmath> etc if this is an overarching concern?  That said, implementating
numeric_limits for that type is trivial, and this is obviously a built in type,
not a pure library extension so there is a lot to be said for providing this
support without the need to include additional headers.

While we're opening cans of worms.... intmax_t should clearly be __int128...
just saying!



More information about the Gcc-bugs mailing list