public inbox for
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <>
To: Richard Henderson <>
Cc: <>, <>,
	Marcus Shawcroft	<>,
	Richard Henderson <>,
	David Holsgrove <>,
	Chris Metcalf <>,
	"David S. Miller" <>
Subject: Re: Implement fma in soft-fp
Date: Tue, 25 Jun 2013 16:45:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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

  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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \

* 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).