mn10300: Define the A and D constraints.
authorRichard Henderson <rth@redhat.com>
Tue, 11 Jan 2011 18:28:59 +0000 (10:28 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 11 Jan 2011 18:28:59 +0000 (10:28 -0800)
This will allow combining am33 and mn103 alternatives
without having to resort to the enabled attribute.

The existing 'A' constraint renamed to 'c'.  Thankfully
this existing accumulator constraint doesn't appear in
either newlib or eglibc sources.

From-SVN: r168675

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

index 8d5fb422d7795992c97f2ea2ece53a3ecfdabea6..5b290b788cfc658e7bf0e776270d78fa5a6c426c 100644 (file)
@@ -1,5 +1,10 @@
 2011-01-11  Richard Henderson  <rth@redhat.com>
 
+       * config/mn10300/constraints.md ("c"): Rename from "A".
+       ("A", "D"): New constraint letters.
+       * config/mn10300/mn10300.md (fmasf4): Use the "c" constraint.
+       (fmssf4, fnmasf4, fnmssf4): Likewise.
+
        * config/mn10300/mn10300.md (isa): New attribute.
        (enabled): New attribute.
 
index 509970cd4b608247d2fcdf231a81664bc5fedea6..c9863fc508c40ec0c903e5f2e18b4f2370df12b3 100644 (file)
 (define_register_constraint "a" "ADDRESS_REGS"
   "An address register.")
 
+;; This can be used for QI/HImode memory operations, and most arithmetic.
+;; AM33 supports these on all registers, where MN103 needs DATA_REGS.
+(define_register_constraint "D" "TARGET_AM33 ? GENERAL_REGS : DATA_REGS"
+  "A general register for AM33, and a data register otherwise.")
+
+;; Similarly for ADDRESS_REGS vs GENERAL_REGS.
+(define_register_constraint "A" "TARGET_AM33 ? GENERAL_REGS : ADDRESS_REGS"
+  "A general register for AM33, and an address register otherwise.")
+
 (define_register_constraint "y" "SP_REGS"
   "An SP register (if available).")
 
@@ -32,7 +41,7 @@
 (define_register_constraint "f" "TARGET_AM33_2 ? FP_REGS : NO_REGS"
   "A floating point register.")
 
-(define_register_constraint "A" "TARGET_AM33_2 ? FP_ACC_REGS : NO_REGS"
+(define_register_constraint "c" "TARGET_AM33_2 ? FP_ACC_REGS : NO_REGS"
   "A floating point accumulator register.")
 
 (define_memory_constraint "Q"
index bfa453f17c088b6a209da5d9a821f3f346d5d51b..1773a03624baecaf230b6c8fee920a385f083deb 100644 (file)
 )
 
 (define_insn "fmasf4"
-  [(set (match_operand:SF         0 "register_operand" "=A")
+  [(set (match_operand:SF         0 "register_operand" "=c")
        (fma:SF (match_operand:SF 1 "register_operand" "f")
                (match_operand:SF 2 "register_operand" "f")
                (match_operand:SF 3 "register_operand" "f")))
 )
 
 (define_insn "fmssf4"
-  [(set (match_operand:SF                 0 "register_operand" "=A")
+  [(set (match_operand:SF                 0 "register_operand" "=c")
        (fma:SF (match_operand:SF         1 "register_operand" "f")
                (match_operand:SF         2 "register_operand" "f")
                (neg:SF (match_operand:SF 3 "register_operand" "f"))))
 )
 
 (define_insn "fnmasf4"
-  [(set (match_operand:SF                 0 "register_operand" "=A")
+  [(set (match_operand:SF                 0 "register_operand" "=c")
        (fma:SF (neg:SF (match_operand:SF 1 "register_operand" "f"))
                (match_operand:SF         2 "register_operand" "f")
                (match_operand:SF         3 "register_operand" "f")))
 )
 
 (define_insn "fnmssf4"
-  [(set (match_operand:SF                 0 "register_operand" "=A")
+  [(set (match_operand:SF                 0 "register_operand" "=c")
        (fma:SF (neg:SF (match_operand:SF 1 "register_operand" "f"))
                (match_operand:SF         2 "register_operand" "f")
                (neg:SF (match_operand:SF 3 "register_operand" "f"))))