public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Ellcey <sellcey@imgtec.com>
To: "Kumar, Venkataramanan" <Venkataramanan.Kumar@amd.com>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
	"Jeff Law (law@redhat.com)" <law@redhat.com>,
	"gcc-patches@gcc.gnu.org"	<gcc-patches@gcc.gnu.org>,
	"maxim.kuvyrkov@linaro.org"	<maxim.kuvyrkov@linaro.org>,
	Matthew Fortune <Matthew.Fortune@imgtec.com>,
	clm <clm@codesourcery.com>
Subject: RE: [RFC]: Remove Mem/address type assumption in combiner
Date: Tue, 12 May 2015 16:57:00 -0000	[thread overview]
Message-ID: <1431449431.14613.240.camel@ubuntu-sellcey> (raw)
In-Reply-To: <7794A52CE4D579448B959EED7DD0A4723DD02CD7@satlexdag06.amd.com>

On Tue, 2015-05-12 at 05:21 +0000, Kumar, Venkataramanan wrote:
> Hi Steve, 
> 
> Yes this is expected.  As Segher pointed out, we need to change .md patterns in
> target to be based on shifts instead of mults.
> 
> Regards,
> Venkat.

Here is my patch to change this.  I tested it with the
mips-mti-linux-gnu and mips-mti-elf targets and it fixed the MIPS
specific tests that were scanning for an lsa instruction and it also had
no regressions.

Since the lsa instruction was the only one using the 'y' operand code
and my change got rid of the only use of it, I removed it as part of
this patch.

Matthew or Catherine is this OK to checkin?

2015-05-12  Steve Ellcey  <sellcey@imgtec.com>

	* config/mips/mips.c (mips_print_operand): Remove 'y' operand code.
	* config/mips/mips.md (<GPR:d>lsa): Rewrite with shift operator.
	* config/mips/predicates.md (const_immlsa_operand): Remove log call.

diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 16ed5f0..82d55b6 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -8440,7 +8440,6 @@ mips_print_operand_punct_valid_p (unsigned char code)
    'x'	Print the low 16 bits of CONST_INT OP in hexadecimal format.
    'd'	Print CONST_INT OP in decimal.
    'm'	Print one less than CONST_INT OP in decimal.
-   'y'	Print exact log2 of CONST_INT OP in decimal.
    'h'	Print the high-part relocation associated with OP, after stripping
 	  any outermost HIGH.
    'R'	Print the low-part relocation associated with OP.
@@ -8504,19 +8503,6 @@ mips_print_operand (FILE *file, rtx op, int letter)
 	output_operand_lossage ("invalid use of '%%%c'", letter);
       break;
 
-    case 'y':
-      if (CONST_INT_P (op))
-	{
-	  int val = exact_log2 (INTVAL (op));
-	  if (val != -1)
-	    fprintf (file, "%d", val);
-	  else
-	    output_operand_lossage ("invalid use of '%%%c'", letter);
-	}
-      else
-	output_operand_lossage ("invalid use of '%%%c'", letter);
-      break;
-
     case 'h':
       if (code == HIGH)
 	op = XEXP (op, 0);
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 76f2108..f6921c6 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -5528,11 +5528,11 @@
 
 (define_insn "<GPR:d>lsa"
  [(set (match_operand:GPR 0 "register_operand" "=d")
-       (plus:GPR (mult:GPR (match_operand:GPR 1 "register_operand" "d")
-			   (match_operand 2 "const_immlsa_operand" ""))
+       (plus:GPR (ashift:GPR (match_operand:GPR 1 "register_operand" "d")
+			     (match_operand 2 "const_immlsa_operand" ""))
 		(match_operand:GPR 3 "register_operand" "d")))]
  "ISA_HAS_<GPR:D>LSA"
- "<GPR:d>lsa\t%0,%1,%3,%y2"
+ "<GPR:d>lsa\t%0,%1,%3,%2"
  [(set_attr "type" "arith")
   (set_attr "mode" "<GPR:MODE>")])
 
diff --git a/gcc/config/mips/predicates.md b/gcc/config/mips/predicates.md
index fa17ac7..4929c3d 100644
--- a/gcc/config/mips/predicates.md
+++ b/gcc/config/mips/predicates.md
@@ -35,7 +35,7 @@
 
 (define_predicate "const_immlsa_operand"
   (and (match_code "const_int")
-         (match_test "IN_RANGE (exact_log2 (INTVAL (op)), 1, 4)")))
+         (match_test "IN_RANGE (INTVAL (op), 1, 4)")))
 
 (define_predicate "const_uimm6_operand"
   (and (match_code "const_int")


  reply	other threads:[~2015-05-12 16:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29  9:29 Kumar, Venkataramanan
2015-04-29 17:38 ` Segher Boessenkool
2015-04-29 19:23   ` Jeff Law
2015-05-01 15:18   ` Segher Boessenkool
2015-05-05 16:14     ` Kumar, Venkataramanan
2015-05-05 17:15       ` Segher Boessenkool
2015-05-07 11:01         ` Kumar, Venkataramanan
2015-05-11 17:50           ` Steve Ellcey
2015-05-11 18:27             ` Segher Boessenkool
2015-05-11 19:44               ` Steve Ellcey
2015-05-11 19:46                 ` Jeff Law
2015-05-11 19:46                   ` Jeff Law
2015-05-11 20:17                     ` Matthew Fortune
2015-05-11 20:30                       ` Segher Boessenkool
2015-05-11 20:54                         ` Matthew Fortune
2015-05-12  6:43             ` Kumar, Venkataramanan
2015-05-12 16:57               ` Steve Ellcey [this message]
2015-05-12 22:02                 ` Moore, Catherine
2015-05-16  6:09     ` Hans-Peter Nilsson
2015-05-16 14:36       ` Segher Boessenkool
2015-05-16 16:43         ` Hans-Peter Nilsson
2015-05-16 17:40           ` Segher Boessenkool
2015-05-17  8:53             ` Hans-Peter Nilsson
2015-05-17 13:32               ` Segher Boessenkool
2015-05-17 13:48                 ` Hans-Peter Nilsson
2015-05-19 17:30               ` Jeff Law
2015-04-29 19:22 ` Jeff Law
2015-04-29 19:31 ` Jeff Law

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=1431449431.14613.240.camel@ubuntu-sellcey \
    --to=sellcey@imgtec.com \
    --cc=Matthew.Fortune@imgtec.com \
    --cc=Venkataramanan.Kumar@amd.com \
    --cc=clm@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=segher@kernel.crashing.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).