public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: HAO CHEN GUI <guihaoc@linux.ibm.com>, David <dje.gcc@gmail.com>,
	Peter Bergner <bergner@linux.ibm.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, rs6000] Add multiply-add expand pattern [PR103109]
Date: Mon, 1 Aug 2022 12:23:00 -0500	[thread overview]
Message-ID: <20220801172300.GG25951@gate.crashing.org> (raw)
In-Reply-To: <5a55cacd-539d-e3d6-3b3d-c7c30a76a564@linux.ibm.com>

On Mon, Aug 01, 2022 at 02:19:32PM +0800, Kewen.Lin wrote:
> > new file mode 100644
> > index 00000000000..256e05d5677
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.target/powerpc/pr103109.c
> > @@ -0,0 +1,16 @@
> > +/* { dg-do compile { target { lp64 } } } */
> 
> Since the guard is TARGET_POWERPC64, should use has_arch_ppc64?

Yes, we should almost never have lp64 in testcases anymore, since now we
have has_arch_ppc64.  Previously we had only has_powerpc64, which is a
very different thing unfortunately.

> > +/* { dg-require-effective-target powerpc_p9modulo_ok } */
> 
> Need effective target int128 as well?

Yes.  This was hidden by the lp64 test, which skips on -m32 already :-)

> > +/* { dg-options "-mdejagnu-cpu=power9 -O2" } */
> > +/* { dg-final { scan-assembler-times {\mmaddld\M} 2 } } */
> > +/* { dg-final { scan-assembler-times {\mmaddhd\M} 1 } } */
> > +/* { dg-final { scan-assembler-times {\mmaddhdu\M} 1 } } */
> > +
> > +__int128 test (long a, long b, long c)
> > +{
> > +  return (__int128) a * (__int128) b + (__int128) c;
> > +}
> > +
> > +unsigned __int128 testu (unsigned long a, unsigned long b, unsigned long c)
> > +{
> > +  return (unsigned __int128) a * (unsigned __int128) b + (unsigned __int128) c;
> > +}

(You only need to cast the first here always, the rest is promoted
automatically).

> Not sure there is some coverage for this kind of multiply-add (promoted first
> then mul and add), if no, it seems better to add one runnable test case.

Good point.  We won't automatically see it from the compiler build
itself for example, int128 isn't used there.


Segher

  reply	other threads:[~2022-08-01 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25  5:11 HAO CHEN GUI
2022-08-01  2:01 ` Ping " HAO CHEN GUI
2022-08-01  6:19 ` Kewen.Lin
2022-08-01 17:23   ` Segher Boessenkool [this message]
2022-08-01 17:13 ` Segher Boessenkool
2022-08-01 21:10 ` 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=20220801172300.GG25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guihaoc@linux.ibm.com \
    --cc=linkw@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).