From patchwork Sat Feb 16 12:10:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 1043419 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-496377-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ruU4be/o"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GW9kIRps"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 441pqn6QGJz9s4Z for ; Sat, 16 Feb 2019 23:10:41 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=Fp3c2BIrtGDqmSjJJZCmCr3hacEem0jlg/Ynkj7NOtCpDk/Cb2 5ZYzzyo37RyIC9qw0/mOEh8JYYncTpgGosRKPZZiwnXuU7nrBVEg5xDjBuijMm7J KPg6eg7lupMez04phx7qlMf6LqPgbG0hLJGOVhQlQfR7Yl65GE5Jf81B8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=wQfpyDX2yZSOrI+fPSWDeOxI58M=; b=ruU4be/o5WVC6RIev/nO GRMVlb4r39o4JX9C5D2m3zHbcL0AXyCaoJHJx5LrEALEavNxHM9O10yZLnw/wjnY ch+oVGwiqxKTQ2hSuxQlsP0vUDoGNFeKkvObiJLAefuRWFdarrXu6vRQSkKGNKrT PqdOMmlurBio2OSdeN5UU7s= Received: (qmail 26474 invoked by alias); 16 Feb 2019 12:10:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26460 invoked by uid 89); 16 Feb 2019 12:10:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=rs6000md, UD:rs6000.md, rs6000.md, 89271 X-HELO: mail-pl1-f195.google.com Received: from mail-pl1-f195.google.com (HELO mail-pl1-f195.google.com) (209.85.214.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 16 Feb 2019 12:10:30 +0000 Received: by mail-pl1-f195.google.com with SMTP id f90so6306999plb.10 for ; Sat, 16 Feb 2019 04:10:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=RmwFDHdlm/izinNcQY9sfzKFpAr5ql0xWzts01jh2pc=; b=GW9kIRpsMTn2mV8EBhQ7rtf87lMvlXd190WDAljj1m5/7U1vwvCb6+HEb8PDxmVAsH hp+hUOf/1bIILZlaKAkq2BZCa/q76Tl59834/A9MTWtnoTkPVr4oSfm496Y2wCDuO8gp lc8QVyTWNYHsZkYkJh1wektldW18D1tB+dgCkNvyFhNbEQvyuw9q4i2sl4rVlPzS7Spo 2HlHCqPNWU7gHMS14p8IT9MwB541XDwkNMVdu1SM/f+o9JfDqaxypseHPGZlKQOgoJqd Uqkv8kw9EPWRk32OshTsPDj6mixLy9FLc88botEuIVkV/8JFZOJUH3EVc3CCwos1ZnZz EoUQ== Received: from bubble.grove.modra.org ([58.175.241.133]) by smtp.gmail.com with ESMTPSA id d11sm12404097pgi.25.2019.02.16.04.10.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Feb 2019 04:10:27 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 1B17F8070C; Sat, 16 Feb 2019 22:40:24 +1030 (ACDT) Date: Sat, 16 Feb 2019 22:40:24 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [RS6000] Fix _ and tf_ splitters Message-ID: <20190216121023.GD3179@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes This patch fixes a bug that can result in "insn does not satisfy its constraints" if these splitters fire due to not getting ctr for the jump insn. Since the jump insn can have any of r,m,d,wi,c,l as the decremented count output, it's not sufficient to check for gpc_reg_operand (which matches VSX regs for example). Seen after correcting register_move_cost when the cost of gpr <-> vsx is much lower. Since this is a prerequisite to fixing PR89271, I'm mentioning that PR in the ChangeLog. The tf_ split had a further bug in that it wouldn't match if the count output was m,d,wi, or l. Bootstrapped etc. powerpc64le-linux. OK? PR target/89271 * config/rs6000/rs6000.md (_ split): Check for an int output reg on add insn. (tf_ split): Likewise. Match predicates with insn. diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 9dd222dc5d7..51b6b7a9660 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -12525,7 +12525,7 @@ (define_split const0_rtx); emit_insn (gen_rtx_SET (operands[3], gen_rtx_COMPARE (CCmode, operands[1], const1_rtx))); - if (gpc_reg_operand (operands[0], mode)) + if (int_reg_operand (operands[0], mode)) emit_insn (gen_add3 (operands[0], operands[1], constm1_rtx)); else { @@ -12603,7 +12603,7 @@ (define_split (const_int 0)])) (match_operand 4) (match_operand 5))) - (set (match_operand:P 6 "int_reg_operand") + (set (match_operand:P 6 "nonimmediate_operand") (plus:P (match_dup 0) (const_int -1))) (clobber (match_scratch:P 7)) @@ -12636,7 +12636,7 @@ (define_split else emit_insn (gen_cceq_ior_compare_complement (operands[9], andexpr, ctrcmpcc, operands[8], cccmp, ccin)); - if (gpc_reg_operand (operands[0], mode)) + if (int_reg_operand (ctrout, mode)) emit_insn (gen_add3 (ctrout, ctr, constm1_rtx)); else {