This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: soft-fp: Make extensions of subnormals from XFmode to TFmode signal underflow if traps enabled
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 9 Oct 2014 00:18:43 +0000
- Subject: Re: soft-fp: Make extensions of subnormals from XFmode to TFmode signal underflow if traps enabled
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1409172134470 dot 17727 at digraph dot polyomino dot org dot uk> <5435CDC3 dot 2070107 at redhat dot com>
On Wed, 8 Oct 2014, Carlos O'Donell wrote:
> On 09/17/2014 05:35 PM, Joseph S. Myers wrote:
> > This patch fixes a soft-fp corner case I previously noted in
> > <https://sourceware.org/ml/libc-alpha/2013-10/msg00349.html>: when
> > trapping on underflow is enabled, extensions of subnormals from XFmode
> > to TFmode need to signal underflow because the result is tiny (but
> > exact, so the underflow flag is not raised unless trapping is
> > enabled).
>
> Slightly unrelated, but why isn't everything using TFmode?
> What benefit is there to XFmode?
As a hardware floating-point format, I expect XFmode is a lot faster (even
if x87 floating point is probably slower than SSE), though I don't have
any benchmarks comparing long double and __float128 on x86. (And the fact
that it's long double - on x86 / x86_64 / ia64 - whereas TFmode is
__float128 - no doubt also means it's much more widely used. And so far
getting libm functions and string conversions for __float128 requires you
to use libquadmath shipped with GCC. __float128 support in glibc was
previously rejected in
<https://sourceware.org/ml/libc-alpha/2004-03/msg00326.html> and
<https://sourceware.org/ml/libc-alpha/2004-05/msg00055.html>, but now
there are proposed standard C bindings for a _Float128 type with IEEE
binary128 format - draft TS 18661-3 - so I think it makes sense to revisit
the principle of adding such support to glibc now the standard bindings
exist.)
--
Joseph S. Myers
joseph@codesourcery.com