public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Monk Chiang <monk.chiang@sifive.com>,
	gcc-patches@gcc.gnu.org, rguenther@suse.de,
	kito.cheng@sifive.com
Subject: Re: [PATCH v2] RISC-V: Add split pattern to generate SFB instructions. [PR113095]
Date: Mon, 22 Jan 2024 21:24:09 -0700	[thread overview]
Message-ID: <ffa993a8-e955-480a-bcf3-6c68cb2438c6@gmail.com> (raw)
In-Reply-To: <20240122061239.83409-1-monk.chiang@sifive.com>



On 1/21/24 23:12, Monk Chiang wrote:
> Since the match.pd transforms (zero_one == 0) ? y : z <op> y,
> into ((typeof(y))zero_one * z) <op> y. Add splitters to recongize
> this expression to generate SFB instructions.
> 
> gcc/ChangeLog:
> 	PR target/113095
> 	* config/riscv/sfb.md: New splitters to rewrite single bit
> 	sign extension as the condition to SFB instructions.
> 
> gcc/testsuite/ChangeLog:
>          * gcc.target/riscv/sfb.c: New test.
> 	* gcc.target/riscv/pr113095.c: New test.
So the 113095 test is going to fail to link on rv64 causing a testsuite 
failure.  I would suggest it have these dg-options lines instead of the 
one you provided:

/* { dg-options "-O2 -march=rv32gc -mabi=ilp32d -mtune=sifive-7-series" 
{ target { rv32 } } } */
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -mtune=sifive-7-series" { 
target { rv64 } } } */


A similar change is not strictly needed for the new sfb.c test since it 
only does a compile (but not a link) test.

You still didn't indicating what testing was done for this patch. 
Standard practice is to build the compiler and run the testsuite with 
and without your change and verify there are no regressions.  Ideally 
new tests should pass as well.

I made the change above locally to pr113095.c to fix those failures on 
rv64.   So this is OK with the adjustment to the dg-options line in the 
new pr113095 test.

Jeff


  reply	other threads:[~2024-01-23  4:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  6:12 Monk Chiang
2024-01-23  4:24 ` Jeff Law [this message]
2024-01-24 12:04   ` Monk Chiang

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=ffa993a8-e955-480a-bcf3-6c68cb2438c6@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kito.cheng@sifive.com \
    --cc=monk.chiang@sifive.com \
    --cc=rguenther@suse.de \
    /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).