public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: HAO CHEN GUI <guihaoc@linux.ibm.com>
Cc: Alexandre Oliva <oliva@adacore.com>,
	HAO CHEN GUI via Gcc-patches <gcc-patches@gcc.gnu.org>,
	Bill Schmidt <wschmidt@linux.ibm.com>, David <dje.gcc@gmail.com>
Subject: Re: Ping^2 [PATCH, rs6000] Correct match pattern in pr56605.c
Date: Tue, 19 Apr 2022 16:06:44 -0500	[thread overview]
Message-ID: <20220419210644.GJ25951@gate.crashing.org> (raw)
In-Reply-To: <f4e5b3f6-ae12-288e-3e5a-19e14c430334@linux.ibm.com>

On Tue, Apr 19, 2022 at 04:05:06PM +0800, HAO CHEN GUI wrote:
>    I tested the test case on Linux and AIX with both big and little endian.
> The test case requires lp64 target, so it won't be tested on 32-bit targets.
> 
> On big endian (both AIX and Linux), it should match
> (compare:CC (and:SI (subreg:SI (reg:DI 207) 4)
> 
> On little endian (both AIX and Linux), it should match
> (compare:CC (and:SI (subreg:SI (reg:DI 207) 0)
> 
> So, the pattern in my patch should work fine.
> 
> /* { dg-final { scan-rtl-dump-times {\(compare:CC \(and:SI \(subreg:SI \(reg:DI} 1 "combine" } } */

On powerpc64-linux:

FAIL: gcc.target/powerpc/pr56605.c scan-rtl-dump-times combine "\\(compare:CC \\((?:and|zero_extend):(?:[SD]I) \\((?:sub)?reg:[SD]I" 1

It matches twice instead of once, namely:

(insn 19 18 20 2 (parallel [
            (set (reg:CC 208)
                (compare:CC (and:SI (subreg:SI (reg:DI 207) 4)
                        (const_int 3 [0x3]))
                    (const_int 0 [0])))
            (set (reg:SI 129 [ prolog_loop_niters.5 ])
                (and:SI (subreg:SI (reg:DI 207) 4)
                    (const_int 3 [0x3])))
        ]) 208 {*andsi3_imm_mask_dot2}
     (nil))

(insn 81 80 82 11 (parallel [
            (set (reg:CC 232)
                (compare:CC (and:DI (subreg:DI (reg:SI 136 [ niters.6 ]) 0)
                        (const_int 7 [0x7]))
                    (const_int 0 [0])))
            (clobber (scratch:DI))
        ]) 207 {*anddi3_imm_mask_dot}
     (expr_list:REG_DEAD (reg:SI 136 [ niters.6 ])
        (nil)))

The paradoxical subreg in the latter wasn't expected :-)


Segher

  reply	other threads:[~2022-04-19 21:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28  3:17 HAO CHEN GUI
2022-03-15  2:06 ` Ping^1 " HAO CHEN GUI
2022-04-08  1:34   ` Ping^2 " HAO CHEN GUI
2022-04-11 23:54     ` Alexandre Oliva
2022-04-12 17:20       ` Segher Boessenkool
2022-04-13 21:30       ` Segher Boessenkool
2022-04-13 21:34         ` Segher Boessenkool
2022-04-19  8:05         ` HAO CHEN GUI
2022-04-19 21:06           ` Segher Boessenkool [this message]
2022-04-20  1:01             ` HAO CHEN GUI
2022-04-08 16:48 ` will schmidt
2022-04-11  2:47   ` HAO CHEN GUI
2022-04-12 17:23     ` Segher Boessenkool
2022-04-08 19:36 ` Segher Boessenkool
2022-04-11  5:26   ` 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=20220419210644.GJ25951@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guihaoc@linux.ibm.com \
    --cc=oliva@adacore.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).