public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [x86] Replace REGNO with reg_or_subregno in pre_reload splitter.
@ 2022-06-20  7:27 liuhongt
  2022-06-20  7:42 ` Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: liuhongt @ 2022-06-20  7:27 UTC (permalink / raw)
  To: gcc-patches

The patch is similar to [1], but use reg_or_subregno instead of REGNO.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596804.html

Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
Ok for trunk?

gcc/ChangeLog:

	PR target/105993
	* config/i386/sse.md (sse4_2_pcmpestr): Replace REGNO with
	reg_or_subregno.
	(sse4_2_pcmpistr): Ditto.
---
 gcc/config/i386/sse.md | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 64ac490d272..083a7e8885a 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -23250,8 +23250,8 @@ (define_insn_and_split "sse4_2_pcmpestr"
   "&& 1"
   [(const_int 0)]
 {
-  int ecx = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[0]));
-  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[1]));
+  int ecx = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[0]));
+  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[1]));
   int flags = !find_regno_note (curr_insn, REG_UNUSED, FLAGS_REG);
 
   if (ecx)
@@ -23386,8 +23386,8 @@ (define_insn_and_split "sse4_2_pcmpistr"
   "&& 1"
   [(const_int 0)]
 {
-  int ecx = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[0]));
-  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[1]));
+  int ecx = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[0]));
+  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[1]));
   int flags = !find_regno_note (curr_insn, REG_UNUSED, FLAGS_REG);
 
   if (ecx)
-- 
2.18.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [x86] Replace REGNO with reg_or_subregno in pre_reload splitter.
  2022-06-20  7:27 [PATCH] [x86] Replace REGNO with reg_or_subregno in pre_reload splitter liuhongt
@ 2022-06-20  7:42 ` Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2022-06-20  7:42 UTC (permalink / raw)
  To: liuhongt; +Cc: gcc-patches

On Mon, Jun 20, 2022 at 9:27 AM liuhongt <hongtao.liu@intel.com> wrote:
>
> The patch is similar to [1], but use reg_or_subregno instead of REGNO.
>
> [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596804.html
>
> Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
> Ok for trunk?
>
> gcc/ChangeLog:
>
>         PR target/105993
>         * config/i386/sse.md (sse4_2_pcmpestr): Replace REGNO with
>         reg_or_subregno.
>         (sse4_2_pcmpistr): Ditto.

OK, but I think that reg_or_subregno should be improved to return
INVALID_REGNUM when the subreg of memory is processed.

Thanks,
Uros.

> ---
>  gcc/config/i386/sse.md | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> index 64ac490d272..083a7e8885a 100644
> --- a/gcc/config/i386/sse.md
> +++ b/gcc/config/i386/sse.md
> @@ -23250,8 +23250,8 @@ (define_insn_and_split "sse4_2_pcmpestr"
>    "&& 1"
>    [(const_int 0)]
>  {
> -  int ecx = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[0]));
> -  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[1]));
> +  int ecx = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[0]));
> +  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[1]));
>    int flags = !find_regno_note (curr_insn, REG_UNUSED, FLAGS_REG);
>
>    if (ecx)
> @@ -23386,8 +23386,8 @@ (define_insn_and_split "sse4_2_pcmpistr"
>    "&& 1"
>    [(const_int 0)]
>  {
> -  int ecx = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[0]));
> -  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[1]));
> +  int ecx = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[0]));
> +  int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, reg_or_subregno (operands[1]));
>    int flags = !find_regno_note (curr_insn, REG_UNUSED, FLAGS_REG);
>
>    if (ecx)
> --
> 2.18.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-20  7:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20  7:27 [PATCH] [x86] Replace REGNO with reg_or_subregno in pre_reload splitter liuhongt
2022-06-20  7:42 ` Uros Bizjak

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