public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Richard Henderson <rth@twiddle.net>
Cc: <libc-alpha@sourceware.org>, <libc-ports@sourceware.org>,
	Marcus Shawcroft	<marcus.shawcroft@linaro.org>,
	Richard Henderson <rth@redhat.com>,
	David Holsgrove <david.holsgrove@xilinx.com>,
	Chris Metcalf <cmetcalf@tilera.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: Implement fma in soft-fp
Date: Tue, 25 Jun 2013 16:45:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1306251637070.13034@digraph.polyomino.org.uk> (raw)
In-Reply-To: <51C9C5F5.1070809@twiddle.net>

On Tue, 25 Jun 2013, Richard Henderson wrote:

> With the following patch, I get
> 
> > testing long double (without inline functions)
> > Failure: fma (0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, 0x1p-16494): Exception "Underflow" set
> > Failure: fma (-0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, -0x1p-16494): Exception "Underflow" set
> > Failure: fma (0x1p-16494, -0x1p-16494, 0x1p-16382): Exception "Underflow" set
> > Failure: fma (0x1p-16494, 0x1p-16494, -0x1p-16382): Exception "Underflow" set
> > Failure: fma_downward (-0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, -0x1p-16494): Exception "Underflow" set
> > Failure: fma_downward (-0x1p-16494, 0x1.1p-1, -0x0.ffffffffffffffffffffffffffffp-16382): Exception "Underflow" set
> > Failure: fma_downward (0x1p-16494, 0x1p-16494, -0x1p-16382): Exception "Underflow" set
> > Failure: fma_upward (0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, 0x1p-16494): Exception "Underflow" set
> > Failure: fma_upward (0x1p-16494, 0x1.1p-1, 0x0.ffffffffffffffffffffffffffffp-16382): Exception "Underflow" set
> > Failure: fma_upward (0x1p-16494, -0x1p-16494, 0x1p-16382): Exception "Underflow" set
> 
> but I thought you'd already committed the patch to solve this
> as commit 695c378f81263640618bdebf56eaa065f578251f ?

No, that fix was about incorrect results rather than exceptions.  The 
above is what I was referring to about soft-fp not supporting 
after-rounding tininess detection.  _FP_PACK_SEMIRAW and 
_FP_PACK_CANONICAL will need, for results whose before-rounding exponent 
is the largest underflowing exponent, to check some new soft-fp macro for 
after-rounding architectures and if it's true then determine whether the 
result would still underflow if rounded to the normal precision (*not* if 
rounded to the subnormal precision with one less bit, so this involves an 
extra trial rounding in a temporary variable to determine whether the 
result counts as tiny).  See what stdlib/strtod_l.c does in 
round_and_return if (TININESS_AFTER_ROUNDING && shift == 1), for example.  
(But soft-fp would use its own macro definition from sfp-machine.h instead 
of the existing tininess.h since it's supposed to be usable outside glibc 
and independent of glibc internal headers.)

MIPS is an after-rounding architecture but this issue doesn't cause test 
failures there because the testsuite knows not to test exceptions for MIPS 
software floating point (which uses fp-bit in libgcc), via math-tests.h.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2013-06-25 16:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-22 17:17 Joseph S. Myers
2013-06-25 15:30 ` Richard Henderson
2013-06-25 16:13   ` Joseph S. Myers
2013-06-25 16:23     ` Richard Henderson
2013-06-25 16:31 ` Richard Henderson
2013-06-25 16:45   ` Joseph S. Myers [this message]
2013-06-27 23:26 ` Joseph S. Myers
2013-07-02 12:57   ` Ping " Joseph S. Myers
2013-07-02 14:45     ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1306251637070.13034@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=cmetcalf@tilera.com \
    --cc=davem@davemloft.net \
    --cc=david.holsgrove@xilinx.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-ports@sourceware.org \
    --cc=marcus.shawcroft@linaro.org \
    --cc=rth@redhat.com \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).