From patchwork Sun Mar 27 22:17:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 88526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C641BB6F82 for ; Mon, 28 Mar 2011 09:17:44 +1100 (EST) Received: (qmail 22963 invoked by alias); 27 Mar 2011 22:17:42 -0000 Received: (qmail 22955 invoked by uid 22791); 27 Mar 2011 22:17:41 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.10.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Mar 2011 22:17:37 +0000 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id A4E7C47E2; Sun, 27 Mar 2011 18:17:35 -0400 (EDT) Date: Sun, 27 Mar 2011 18:17:35 -0400 From: John David Anglin To: gcc-patches@gcc.gnu.org Subject: [committed] Fix PA ior expanders Message-ID: <20110327221734.GA997@hiauly1.hia.nrc.ca> Reply-To: John David Anglin MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) 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 The following patch fixes a thinko in the iordi3 expander -- the expander didn't allow register operands. I also changed the iorsi3 expander to use the new predicate. Tested on hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu with no regressions. Committed to trunk. Dave Index: config/pa/predicates.md =================================================================== --- config/pa/predicates.md (revision 171556) +++ config/pa/predicates.md (working copy) @@ -409,6 +409,15 @@ || (GET_CODE (op) == CONST_INT && and_mask_p (INTVAL (op)))); }) +;; True iff OP can be used to compute (reg | OP). + +(define_predicate "reg_or_ior_operand" + (match_code "subreg,reg,const_int") +{ + return (register_operand (op, mode) + || (GET_CODE (op) == CONST_INT && ior_mask_p (INTVAL (op)))); +}) + ;; True iff depi can be used to compute (reg | OP). (define_predicate "ior_operand" Index: config/pa/pa.md =================================================================== --- config/pa/pa.md (revision 171556) +++ config/pa/pa.md (working copy) @@ -5686,7 +5686,7 @@ (define_expand "iordi3" [(set (match_operand:DI 0 "register_operand" "") (ior:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "ior_operand" "")))] + (match_operand:DI 2 "reg_or_ior_operand" "")))] "" " { @@ -5726,14 +5726,9 @@ (define_expand "iorsi3" [(set (match_operand:SI 0 "register_operand" "") (ior:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "arith32_operand" "")))] + (match_operand:SI 2 "reg_or_ior_operand" "")))] "" - " -{ - if (! (ior_operand (operands[2], SImode) - || register_operand (operands[2], SImode))) - operands[2] = force_reg (SImode, operands[2]); -}") + "") (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r,r")