From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
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 v2, rs6000] Add multiply-add expand pattern [PR103109]
Date: Wed, 10 Aug 2022 15:37:13 +0800 [thread overview]
Message-ID: <856dfcb9-1fd5-8f3c-825b-635ee35df9dd@linux.ibm.com> (raw)
In-Reply-To: <20220809213408.GU25951@gate.crashing.org>
on 2022/8/10 05:34, Segher Boessenkool wrote:
> On Tue, Aug 09, 2022 at 11:14:16AM +0800, Kewen.Lin wrote:
>> on 2022/8/8 14:04, HAO CHEN GUI wrote:
>>> +/* { dg-do run { target { has_arch_ppc64 } } } */
>>> +/* { dg-options "-O2 -mdejagnu-cpu=power9 -save-temps" } */
>>> +/* { dg-require-effective-target int128 } */
>>> +/* { dg-require-effective-target p9modulo_hw } */
>>> +/* { dg-final { scan-assembler-times {\mmaddld\M} 2 } } */
>>> +/* { dg-final { scan-assembler-times {\mmaddhd\M} 1 } } */
>>> +/* { dg-final { scan-assembler-times {\mmaddhdu\M} 1 } } */
>>> +
>>
>> Maybe it's good to split this case into two, one for compiling and the other for running.
>> Since the generated asm is a test point here, with one separated case for compiling, we
>> can still have that part of test coverage on hosts which are unable to run this case.
>> You can move functions multiply_add and multiply_addu into one common header file, then
>> include it in both source files.
>
> Yeah, good point. You cannot make dg-do do different things on
> different targets. Fortunatelt just duplicating this test and then
> removing the things not relevant to run resp. compile testing makes
> things even more clear :-)
>
>> Nit: better to add one explicit "return 0;" to avoid possible warning.
>
> This is in main(), the C standard requires this to work without return
> (and it is common). But, before C99 the implicit return value from
> main() was undefined, so yes, it could warn then. Does it?
>
Yes, exactly, with explicit -std=c89 -Wreturn-type it will have a warning:
warning: control reaches end of non-void function...
BR,
Kewen
next prev parent reply other threads:[~2022-08-10 7:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-08 6:04 HAO CHEN GUI
2022-08-09 3:14 ` Kewen.Lin
2022-08-09 21:34 ` Segher Boessenkool
2022-08-10 7:37 ` Kewen.Lin [this message]
2022-08-09 21:43 ` Segher Boessenkool
2022-08-10 5:20 ` HAO CHEN GUI
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=856dfcb9-1fd5-8f3c-825b-635ee35df9dd@linux.ibm.com \
--to=linkw@linux.ibm.com \
--cc=bergner@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=guihaoc@linux.ibm.com \
--cc=segher@kernel.crashing.org \
/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).