From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 2E50E3858D3C for ; Tue, 19 Apr 2022 21:08:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E50E3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 23JL6k41019151; Tue, 19 Apr 2022 16:06:46 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 23JL6jc2019150; Tue, 19 Apr 2022 16:06:45 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 19 Apr 2022 16:06:44 -0500 From: Segher Boessenkool To: HAO CHEN GUI Cc: Alexandre Oliva , HAO CHEN GUI via Gcc-patches , Bill Schmidt , David Subject: Re: Ping^2 [PATCH, rs6000] Correct match pattern in pr56605.c Message-ID: <20220419210644.GJ25951@gate.crashing.org> References: <78123ff3-b69b-5b87-97c5-bea894e0601f@linux.ibm.com> <366b1a50-4a31-1983-dfe6-aa85a8d7506c@linux.ibm.com> <20220413213036.GG614@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2022 21:08:49 -0000 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