public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Terry Guo <terry.xpguo@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
		Uros Bizjak <ubizjak@gmail.com>
Subject: Re: [PATCH] x86-64: Use TI->SF and TI->DF conversions in soft-fp
Date: Tue, 22 Jan 2019 00:40:00 -0000	[thread overview]
Message-ID: <CAATtE7CUE4ZwF54=O7uCkoT7iCKkfYcs5dtBZXUExG1KG4Y3Dg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1901212326290.27116@digraph.polyomino.org.uk>

On Tue, Jan 22, 2019 at 7:48 AM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 21 Jan 2019, H.J. Lu wrote:
>
> > TI->SF and TI->DF conversions in libgcc2.c:
> >
> > FSTYPE
> > FUNC (DWtype u)
> > {
> >   ...
> > }
> >
> > have no rounding mode support.  We should replace __floattisf, __floattidf,
> > __floatuntisf and __floatuntidf in libgcc2.c with these from soft-fp.
>
> Please explain what you mean by "have no rounding mode support" (i.e., the
> exact flow through a function that is incorrect in a non-default rounding
> mode).  This patch is missing testcases - which of course should be
> architecture-independent.  (Any bug in libgcc2.c should first have an
> architecture-independent fix - it can't be considered fixed based on a fix
> for one architecture.  Then, if some other approach is optimal on
> particular architectures, they can get optimized variants.)
>
> I believe all those function implementations are designed so that only a
> single rounding occurs, which is for the final result, so no explicit
> handling of rounding modes is ever needed (the integer code before then
> may set up sticky bits appropriately to ensure the floating-point parts of
> the code only need a single rounding, which works in all modes), but maybe
> there are bugs in certain cases.  To identify the correct fix, we need
> details of the exact code path being used (the exact values of the various
> macros, choices for the various conditional parts of the function, values
> each variable has at each point) and where the existing,
> rounding-mode-independent logic goes wrong.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com

Hi Joseph,

I believe HJ is proposing patch to fix bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88931. In the test case
of the bug, the "#pragma STDC FENV_ACCESS ON" is used and there are
four rounding modes:

  {
    ROUNDING (FE_DOWNWARD),
    ROUNDING (FE_UPWARD),
    ROUNDING (FE_TOWARDZERO),
    ROUNDING (FE_TONEAREST)
  }

The current _floattisf from libgcc2 doesn't support those four rounding modes.

BR,
Terry

  reply	other threads:[~2019-01-22  0:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21 16:16 H.J. Lu
2019-01-21 16:43 ` Uros Bizjak
2019-01-21 16:56   ` H.J. Lu
2019-01-21 16:59     ` Uros Bizjak
2019-01-21 17:10       ` H.J. Lu
2019-01-21 18:37         ` H.J. Lu
2019-01-21 23:48 ` Joseph Myers
2019-01-22  0:40   ` Terry Guo [this message]
2019-01-22  0:58     ` Joseph Myers
2019-01-22  1:34       ` H.J. Lu
2019-01-22  2:03         ` Joseph Myers
2019-01-23  8:19           ` H.J. Lu

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='CAATtE7CUE4ZwF54=O7uCkoT7iCKkfYcs5dtBZXUExG1KG4Y3Dg@mail.gmail.com' \
    --to=terry.xpguo@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=joseph@codesourcery.com \
    --cc=ubizjak@gmail.com \
    /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).