public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, palmer@sifive.com, andrew@sifive.com,
	jimw@sifive.com
Subject: [07/11] [riscv] Fix ambiguous .md attribute uses
Date: Fri, 05 Jul 2019 15:20:00 -0000	[thread overview]
Message-ID: <mpttvc0wlui.fsf@arm.com> (raw)
In-Reply-To: <mpty31cy10w.fsf@arm.com> (Richard Sandiford's message of "Fri,	05 Jul 2019 16:05:51 +0100")

This patch is part of a series that fixes ambiguous attribute
uses in .md files, i.e. cases in which attributes didn't use
<ITER:ATTR> to specify an iterator, and in which <ATTR> could
have different values depending on the iterator chosen.

No behavioural change -- produces the same code as before.


2019-07-05  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/riscv/pic.md (*local_pic_load_s<mode>)
	(*local_pic_load_u<mode>): Explicitly specify the mode iterator
	referenced by <mode>, giving...
	(*local_pic_load_s<SUBX:mode>, *local_pic_load_u<SUBX:mode>): ...these.
	* config/riscv/riscv.md (*sge<u>_<X:mode><GPR:mode>)
	(*slt<u>_<X:mode><GPR:mode>, *sle<u>_<X:mode><GPR:mode>): Explicitly
	use <X:MODE> for the mode attribute.

Index: gcc/config/riscv/pic.md
===================================================================
--- gcc/config/riscv/pic.md	2019-03-08 18:15:38.084735089 +0000
+++ gcc/config/riscv/pic.md	2019-07-05 15:07:46.695310028 +0100
@@ -29,14 +29,14 @@ (define_insn "*local_pic_load<mode>"
   "<default_load>\t%0,%1"
   [(set (attr "length") (const_int 8))])
 
-(define_insn "*local_pic_load_s<mode>"
+(define_insn "*local_pic_load_s<SUBX:mode>"
   [(set (match_operand:SUPERQI 0 "register_operand" "=r")
 	(sign_extend:SUPERQI (mem:SUBX (match_operand 1 "absolute_symbolic_operand" ""))))]
   "USE_LOAD_ADDRESS_MACRO (operands[1])"
   "<SUBX:load>\t%0,%1"
   [(set (attr "length") (const_int 8))])
 
-(define_insn "*local_pic_load_u<mode>"
+(define_insn "*local_pic_load_u<SUBX:mode>"
   [(set (match_operand:SUPERQI 0 "register_operand" "=r")
 	(zero_extend:SUPERQI (mem:SUBX (match_operand 1 "absolute_symbolic_operand" ""))))]
   "USE_LOAD_ADDRESS_MACRO (operands[1])"
Index: gcc/config/riscv/riscv.md
===================================================================
--- gcc/config/riscv/riscv.md	2019-07-01 09:37:06.632529410 +0100
+++ gcc/config/riscv/riscv.md	2019-07-05 15:07:46.699309994 +0100
@@ -2054,7 +2054,7 @@ (define_insn "*sge<u>_<X:mode><GPR:mode>
   ""
   "slt%i2<u>\t%0,zero,%1"
   [(set_attr "type" "slt")
-   (set_attr "mode" "<MODE>")])
+   (set_attr "mode" "<X:MODE>")])
 
 (define_insn "*slt<u>_<X:mode><GPR:mode>"
   [(set (match_operand:GPR           0 "register_operand" "= r")
@@ -2063,7 +2063,7 @@ (define_insn "*slt<u>_<X:mode><GPR:mode>
   ""
   "slt%i2<u>\t%0,%1,%2"
   [(set_attr "type" "slt")
-   (set_attr "mode" "<MODE>")])
+   (set_attr "mode" "<X:MODE>")])
 
 (define_insn "*sle<u>_<X:mode><GPR:mode>"
   [(set (match_operand:GPR           0 "register_operand" "=r")
@@ -2075,7 +2075,7 @@ (define_insn "*sle<u>_<X:mode><GPR:mode>
   return "slt%i2<u>\t%0,%1,%2";
 }
   [(set_attr "type" "slt")
-   (set_attr "mode" "<MODE>")])
+   (set_attr "mode" "<X:MODE>")])
 
 ;;
 ;;  ....................

  parent reply	other threads:[~2019-07-05 15:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 15:08 [00/11] Diagnose " Richard Sandiford
2019-07-05 15:10 ` [01/11] [arch64] Fix " Richard Sandiford
2019-07-05 15:12 ` [02/11] [arm] " Richard Sandiford
2019-07-05 15:52   ` Kyrill Tkachov
2019-07-05 15:13 ` [03/11] [amdgcn] " Richard Sandiford
2019-07-05 15:43   ` Andrew Stubbs
2019-07-05 15:15 ` [04/11] [h8300] " Richard Sandiford
2019-07-05 17:23   ` Jeff Law
2019-07-05 15:17 ` [05/11] [i386] " Richard Sandiford
2019-07-05 15:45   ` Uros Bizjak
2019-07-05 15:19 ` [06/11] [mips] " Richard Sandiford
2019-07-12  8:24   ` Ping: " Richard Sandiford
2019-07-15 20:24     ` Jim Wilson
2019-07-05 15:20 ` Richard Sandiford [this message]
2019-07-08  4:41   ` [07/11] [riscv] " Jim Wilson
2019-07-05 15:22 ` [08/11] [rs6000] " Richard Sandiford
2019-07-05 16:03   ` Segher Boessenkool
2019-07-05 16:38     ` Richard Sandiford
2019-07-05 17:26       ` Segher Boessenkool
2019-07-05 17:38         ` Richard Sandiford
2019-07-05 15:27 ` [09/11] [s390] " Richard Sandiford
2019-07-05 15:59   ` Andreas Krebbel
2019-07-05 15:31 ` [10/11] Use file_location for md_reader's ptr_loc Richard Sandiford
2019-07-05 15:39 ` [11/11] Report ambiguous uses of .md attributes Richard Sandiford

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=mpttvc0wlui.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=andrew@sifive.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jimw@sifive.com \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@sifive.com \
    /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).