mn10300: Add attribute enabled.
authorRichard Henderson <rth@redhat.com>
Tue, 11 Jan 2011 18:26:16 +0000 (10:26 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 11 Jan 2011 18:26:16 +0000 (10:26 -0800)
This will allow merging am33 and mn103 patterns for which the
set of alternatives can't be merged via constraint letters.

From-SVN: r168674

gcc/ChangeLog
gcc/config/mn10300/mn10300.md

index ddcb3bc826f963168edcade692bb0be76242df4b..8d5fb422d7795992c97f2ea2ece53a3ecfdabea6 100644 (file)
@@ -1,5 +1,8 @@
 2011-01-11  Richard Henderson  <rth@redhat.com>
 
+       * config/mn10300/mn10300.md (isa): New attribute.
+       (enabled): New attribute.
+
        * config/mn10300/mn10300.md (absdf2, negdf2): Remove.
        (abssf2, negsf2): Define only for hardware fp.
        (sqrtsf2): Reformat.
index 3a266960ffea78de12a4c234ff7a9510ab7e0bcb..bfa453f17c088b6a209da5d9a821f3f346d5d51b 100644 (file)
 (define_attr "cpu" "mn10300,am33,am33_2,am34"
   (const (symbol_ref "(enum attr_cpu) mn10300_tune_cpu")))
 
+;; Used to control the "enabled" attribute on a per-instruction basis.
+(define_attr "isa" "base,am33,am33_2,am34"
+  (const_string "base"))
+
+(define_attr "enabled" ""
+  (cond [(eq_attr "isa" "base")
+         (const_int 1)
+
+         (and (eq_attr "isa" "am33")
+             (ne (symbol_ref "TARGET_AM33") (const_int 0)))
+         (const_int 1)
+
+         (and (eq_attr "isa" "am33_2")
+             (ne (symbol_ref "TARGET_AM33_2") (const_int 0)))
+         (const_int 1)
+        
+         (and (eq_attr "isa" "am34")
+             (ne (symbol_ref "TARGET_AM34") (const_int 0)))
+         (const_int 1)
+       ]
+       (const_int 0))
+)
 \f
 ;; Pipeline description.