public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xionghu Luo <luoxhu@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
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: Mon, 6 Sep 2021 16:59:27 +0800	[thread overview]
Message-ID: <cf137b37-5b31-83b8-eb19-cb4dcf9f69b8@linux.ibm.com> (raw)
In-Reply-To: <20210903214454.GO1583@gate.crashing.org>



On 2021/9/4 05:44, Segher Boessenkool wrote:
> 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:

OK.

> 
>    "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.

Thanks.  Verified that different calls are generated on different platforms
without this patch.

P8BE-64: bl __fmodf_finite
P8BE-32: b __fmodf_finite
P8LE-64:  bl fmodf

"l", "__" and "_finite" are optional, so is it OK to check them with below patterns?

+/* { dg-final { scan-assembler-not {\mbl? (__)?fmod(_finite)?\M} } } */
+/* { dg-final { scan-assembler-not {\mbl? (__)?fmodf(_finite)?\M} } } */
+/* { dg-final { scan-assembler-not {\mbl? (__)?remainder(_finite)?\M} } } */
+/* { dg-final { scan-assembler-not {\mbl? (__)?remainderf(_finite)?\M} } } */


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

-- 
Thanks,
Xionghu

  reply	other threads:[~2021-09-06  8:59 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
2021-09-06  8:59               ` Xionghu Luo [this message]
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=cf137b37-5b31-83b8-eb19-cb4dcf9f69b8@linux.ibm.com \
    --to=luoxhu@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --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).