public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Xionghu Luo <luoxhu@linux.ibm.com>
Cc: will schmidt <will_schmidt@vnet.ibm.com>,
	gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com,
	dje.gcc@gmail.com, linkw@gcc.gnu.org
Subject: Re: Ping ^ 2: [PATCH] rs6000: Expand fmod and remainder when built with fast-math [PR97142]
Date: Fri, 3 Sep 2021 16:44:54 -0500	[thread overview]
Message-ID: <20210903214454.GO1583@gate.crashing.org> (raw)
In-Reply-To: <bb0d643d-9562-c53c-37da-9a110af421d1@linux.ibm.com>

Hi!

On Fri, Sep 03, 2021 at 10:31:24AM +0800, Xionghu Luo wrote:
> fmod/fmodf and remainder/remainderf could be expanded instead of library
> call when fast-math build, which is much faster.

Thank you very much for this patch.

Some trivial comments if you haven't commmitted it yet:

> +(define_expand "fmod<mode>3"
> +  [(use (match_operand:SFDF 0 "gpc_reg_operand"))
> +	(use (match_operand:SFDF 1 "gpc_reg_operand"))
> +	(use (match_operand:SFDF 2 "gpc_reg_operand"))]
> +  "TARGET_HARD_FLOAT
> +  && TARGET_FPRND
> +  && flag_unsafe_math_optimizations"

It should have one extra space before each && here:

  "TARGET_HARD_FLOAT
   && TARGET_FPRND
   && flag_unsafe_math_optimizations"

(so that everything inside of the string aligns).

> +(define_expand "remainder<mode>3"

(same here).

> +/* { dg-final { scan-assembler-not {\mbl fmod\M} } } */
> +/* { dg-final { scan-assembler-not {\mbl fmodf\M} } } */
> +/* { dg-final { scan-assembler-not {\mbl remainder\M} } } */
> +/* { dg-final { scan-assembler-not {\mbl remainderf\M} } } */

These are negative tests, so won't spuriously fail, but this does not
test for the function prefixes we can have.  See
gcc.target/powerpc/builtins-1.c for example.

Again, thank you, and thanks to everyone else for the patch review
action :-)


Segher

  parent reply	other threads:[~2021-09-03 21:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16  7:10 Xiong Hu Luo
2021-05-06  2:36 ` Ping: " Xionghu Luo
2021-05-14  7:13   ` Xionghu Luo
2021-06-07  5:08     ` Ping^2: " Xionghu Luo
2021-06-30  1:44     ` Ping ^ 2: " Xionghu Luo
2021-07-09 18:40       ` will schmidt
2021-07-12  1:25         ` Xionghu Luo
2021-09-03  2:31           ` Xionghu Luo
2021-09-03 14:51             ` Bill Schmidt
2021-09-03 14:53             ` David Edelsohn
2021-09-03 21:44             ` Segher Boessenkool [this message]
2021-09-06  8:59               ` Xionghu Luo
2021-09-06 21:57                 ` 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=20210903214454.GO1583@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@gcc.gnu.org \
    --cc=luoxhu@linux.ibm.com \
    --cc=will_schmidt@vnet.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).