diff mbox

Remove unnecessary sparc code attr.

Message ID 20110929.040155.2215828562764445252.davem@davemloft.net
State New
Headers show

Commit Message

David Miller Sept. 29, 2011, 8:01 a.m. UTC
Thanks to Uros Bizjak for pointing this out.

Committed to trunk.

	* config/sparc/sparc.md (gcond_name): Delete unnecessary code attr.
	(VIS pixel-compare insn): Just use <gcond:name>.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179335 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog             |    3 +++
 gcc/config/sparc/sparc.md |    5 ++---
 2 files changed, 5 insertions(+), 3 deletions(-)

Comments

Jakub Jelinek Sept. 29, 2011, 8:12 a.m. UTC | #1
On Thu, Sep 29, 2011 at 04:01:55AM -0400, David Miller wrote:
> --- a/gcc/config/sparc/sparc.md
> +++ b/gcc/config/sparc/sparc.md
> @@ -8148,17 +8148,16 @@
>    [(set_attr "type" "edge")])
>  
>  (define_code_iterator gcond [le ne gt eq])
> -(define_code_attr gcond_name [(le "le") (ne "ne") (gt "gt") (eq "eq")])
>  (define_mode_iterator GCM [V4HI V2SI])
>  (define_mode_attr gcm_name [(V4HI "16") (V2SI "32")])
>  
> -(define_insn "fcmp<gcond_name><gcm_name><P:mode>_vis"
> +(define_insn "fcmp<gcond:code><gcm_name><P:mode>_vis"
>    [(set (match_operand:P 0 "register_operand" "=r")
>    	(unspec:P [(gcond:GCM (match_operand:GCM 1 "register_operand" "e")
>  		              (match_operand:GCM 2 "register_operand" "e"))]
>  	 UNSPEC_FCMP))]
>    "TARGET_VIS"
> -  "fcmp<gcond_name><gcm_name>\t%1, %2, %0"
> +  "fcmp<gcond:code><gcm_name>\t%1, %2, %0"
>    [(set_attr "type" "fpmul")
>     (set_attr "fptype" "double")])

On the other side, I'm surprised you don't need to prefix gcm_name with GCM:
- when you have more than one mode iterator in a pattern, IMHO you should
make it clear which mode you are talking about.  Maybe it works, but which
one it is?  The first mode_iterator declared in the *.md files (and used in
the pattern), the last one, the first mode_iterator encountered in the
pattern, the last one?
So IMHO it should be <GCM:gcm_name> in both cases.

And there is just one code iterator, can't you use just <code> instead of
<gcond:code>?

	Jakub
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f4b9c8a..0e65631 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -14,6 +14,9 @@ 
 	__vis_array32): New.
 	* doc/extend.texi: Document new VIS builtins.
 
+	* config/sparc/sparc.md (gcond_name): Delete unnecessary code attr.
+	(VIS pixel-compare insn): Just use <gcond:name>.
+
 2011-09-29  Iain Sandoe  <iains@gcc.gnu.org>
 
 	* config/darwin9.h (STACK_CHECK_STATIC_BUILTIN): Enable for
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index ee772d6..d9bcd31 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -8148,17 +8148,16 @@ 
   [(set_attr "type" "edge")])
 
 (define_code_iterator gcond [le ne gt eq])
-(define_code_attr gcond_name [(le "le") (ne "ne") (gt "gt") (eq "eq")])
 (define_mode_iterator GCM [V4HI V2SI])
 (define_mode_attr gcm_name [(V4HI "16") (V2SI "32")])
 
-(define_insn "fcmp<gcond_name><gcm_name><P:mode>_vis"
+(define_insn "fcmp<gcond:code><gcm_name><P:mode>_vis"
   [(set (match_operand:P 0 "register_operand" "=r")
   	(unspec:P [(gcond:GCM (match_operand:GCM 1 "register_operand" "e")
 		              (match_operand:GCM 2 "register_operand" "e"))]
 	 UNSPEC_FCMP))]
   "TARGET_VIS"
-  "fcmp<gcond_name><gcm_name>\t%1, %2, %0"
+  "fcmp<gcond:code><gcm_name>\t%1, %2, %0"
   [(set_attr "type" "fpmul")
    (set_attr "fptype" "double")])