public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: HAO CHEN GUI <guihaoc@linux.ibm.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, David <dje.gcc@gmail.com>,
	Bill Schmidt <wschmidt@linux.ibm.com>
Subject: Re: [PATCH, rs6000] Disable gimple fold for float or double vec_minmax when fast-math is not set
Date: Wed, 20 Oct 2021 11:19:00 -0500	[thread overview]
Message-ID: <20211020161900.GS614@gate.crashing.org> (raw)
In-Reply-To: <787f0d5d-a8f5-c513-997f-a5b906951da4@linux.ibm.com>

Hi!

On Wed, Oct 20, 2021 at 05:04:56PM +0800, HAO CHEN GUI wrote:
> This patch disables gimple folding for float or double vec_min/max when fast-math is not set. It makes vec_min/max conform with the guide.
> 
> Bootstrapped and tested on powerpc64le-linux with no regressions. Is this okay for trunk? Any recommendations? Thanks a lot.
> 
>   I refined the patch according to reviewers' advice. The attachments are 
> the ChangeLog and patch diff in case the email body is messed up.
> 
> 
> ChangeLog
> 
> 2021-10-20 Haochen Gui <guihaoc@linux.ibm.com>
> 
> gcc/
>         * config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin):
>         Disable gimple fold for VSX_BUILTIN_XVMINDP, 
> ALTIVEC_BUILTIN_VMINFP,
>         VSX_BUILTIN_XVMAXDP, ALTIVEC_BUILTIN_VMAXFP when fast-math 
> is not
>         set.

Content-Type: text/plain; charset=UTF-8; format=flowed

Please don't use flowed.  It makes patches unreadable and unusable if
you do (they will not apply anymore).

Also, the left border should be one tab, not eight spaces, and the right
border is at 80 chars (so there are 72 usable chars on a line).  Don't
end a line in ":" if you don't overflow a line if you put text after it.

> --- a/gcc/config/rs6000/rs6000-call.c
> +++ b/gcc/config/rs6000/rs6000-call.c
> @@ -12159,6 +12159,14 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator 
> *gsi)
>        return true;
>      /* flavors of vec_min.  */
>      case VSX_BUILTIN_XVMINDP:
> +    case ALTIVEC_BUILTIN_VMINFP:
> +      {
> +       lhs = gimple_call_lhs (stmt);
> +       tree type = TREE_TYPE (lhs);
> +       if (HONOR_NANS (type) || HONOR_SIGNED_ZEROS (type))
> +         return false;
> +       gcc_fallthrough ();
> +      }

Both vminfp anf xvmindp (and xvminsp and xsmindp) return -0 or the
minimum of +0 and -0, that is okay even with HONOR_SIGNED_ZEROS, I
think?

x[sv]min[sd]p returns the number for the minimum of a NaN and a number,
but vminfp returns a NaN.  Do you really want to make the xvmindp
builtin handle less than it does currently?  And, what about vminfp?
Did tht do the wrong thing before?

There are no tests for any of that apparently.  Hrm.


Segher

  reply	other threads:[~2021-10-20 16:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20  9:04 HAO CHEN GUI
2021-10-20 16:19 ` Segher Boessenkool [this message]
2021-10-21  6:25   ` HAO CHEN GUI
  -- strict thread matches above, loose matches on Subject: below --
2021-11-01  6:48 HAO CHEN GUI
2021-11-02  0:21 ` David Edelsohn
2021-11-02  2:40   ` HAO CHEN GUI
2021-11-02 13:12     ` David Edelsohn
2021-11-03  2:14       ` HAO CHEN GUI
2021-10-13 15:02 David Edelsohn
2021-10-12  8:57 HAO CHEN GUI
2021-10-12  9:57 ` Richard Biener
2021-10-13  7:43   ` HAO CHEN GUI
2021-10-13  8:29     ` Richard Biener
2021-10-13  9:15       ` HAO CHEN GUI
2021-10-13 18:19       ` Segher Boessenkool
2021-10-13 22:04     ` Joseph Myers
2021-10-13 18:28 ` Segher Boessenkool
2021-08-24  8:52 HAO CHEN GUI
2021-08-24 20:04 ` Bill Schmidt
2021-08-24 22:40   ` Segher Boessenkool
2021-08-25  7:06     ` HAO CHEN GUI
2021-08-25  7:50       ` Kewen.Lin
2021-08-25  8:17         ` HAO CHEN GUI
2021-08-25  8:44           ` HAO CHEN GUI
2021-08-25 12:34       ` Bill Schmidt
2021-08-26  1:19         ` HAO CHEN GUI
2021-09-06  6:01           ` HAO CHEN GUI
2021-10-11 15:55           ` Segher Boessenkool
2021-10-11 16:07             ` Segher Boessenkool

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=20211020161900.GS614@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guihaoc@linux.ibm.com \
    --cc=wschmidt@linux.ibm.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).