public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: John David Anglin <dave@hiauly1.hia.nrc.ca>
To: gcc-patches@gcc.gnu.org
Subject: [committed] Fix PA ior expanders
Date: Sun, 27 Mar 2011 23:22:00 -0000	[thread overview]
Message-ID: <20110327221734.GA997@hiauly1.hia.nrc.ca> (raw)

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
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2011-03-27  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR target/48288
	* config/pa/predicates.md (reg_or_ior_operand): New predicate.
	* config/pa/pa.md (iordi3): Use new predicate in expander.
	(iorsi3): Likewise.

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

             reply	other threads:[~2011-03-27 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27 23:22 John David Anglin [this message]
2011-03-28 22:13 ` Richard Henderson
2011-03-28 22:17   ` Richard Henderson
2011-03-29  0:49     ` John David Anglin
2011-04-16 16:11     ` [committed] PA predicate cleanup John David Anglin

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=20110327221734.GA997@hiauly1.hia.nrc.ca \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=dave.anglin@nrc-cnrc.gc.ca \
    --cc=gcc-patches@gcc.gnu.org \
    /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).