]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
constraints.md (CnL): New constraint.
authorJoern Rennecke <joern.rennecke@embecosm.com>
Mon, 8 Apr 2013 15:52:44 +0000 (15:52 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Mon, 8 Apr 2013 15:52:44 +0000 (16:52 +0100)
        * config/epiphany/constraints.md (CnL): New constraint.
        * config/epiphany/epiphany.md (addsi3_i): Add r/r/CnL alternative.
        * config/epiphany/predicates.md (add_operand): Allow 1024.

From-SVN: r197588

gcc/ChangeLog
gcc/config/epiphany/constraints.md
gcc/config/epiphany/epiphany.md
gcc/config/epiphany/predicates.md

index 35188224b8d6d38b64fa7bef6d0ba261cda93202..3ad208c8daa3cf450f2c706547e101d3012ca5a6 100644 (file)
        * config/epiphany/epiphany.md (cmpsf_ord): Make pattern
        unconditional.
 
+       * config/epiphany/constraints.md (CnL): New constraint.
+       * config/epiphany/epiphany.md (addsi3_i): Add r/r/CnL alternative.
+       * config/epiphany/predicates.md (add_operand): Allow 1024.
+
 2013-04-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/34949
index bd3d935a2751e590024d46c564ab199f94c6c4cc..d4d6049fe67de9905302429c1c4f5df7d4c383ca 100644 (file)
   (and (match_code "const_int")
        (match_test "SIMM11 (ival)")))
 
+(define_constraint "CnL"
+  "A negated signed 11-bit constant."
+  (and (match_code "const_int")
+       (match_test "SIMM11 (-ival)")))
+
 (define_constraint "Cm1"
   "A signed 11-bit constant added to -1"
   (and (match_code "const_int")
index 7c21a349c0c54b7b85559e152b5f1699ee89dac8..e4750eeaab01f61bb5e1a0f70b8da242bf45cd99 100644 (file)
   DONE;
 }")
 
+; The default case of epiphany_print_operand emits IMMEDIATE_PREFIX
+; where appropriate; however, 'n' is processed by output_asm_insn
+; which doesn't, so we have to explicitly emit the '# in the
+; r/r/CnL output template alternative.
 (define_insn "addsi3_i"
-  [(set (match_operand:SI 0 "add_reg_operand" "=r")
-       (plus:SI (match_operand:SI 1 "add_reg_operand" "%r")
-                (match_operand:SI 2 "add_operand" "rL")))
+  [(set (match_operand:SI 0 "add_reg_operand" "=r,r")
+       (plus:SI (match_operand:SI 1 "add_reg_operand" "%r,r")
+                (match_operand:SI 2 "add_operand" "rL,CnL")))
    (clobber (reg:CC CC_REGNUM))]
   ""
-  "add %0,%1,%2"
+  "@
+   add %0,%1,%2
+   sub %0,%1,#%n2"
 [(set_attr "type" "misc")])
 
 ; We use a clobber of UNKNOWN_REGNUM here so that the peephole optimizers
index 1ae5824f337f5be45806a2cc91ac800c7b3cc499..af60d7c73f709418ea22900108b233ece1c8f7f5 100644 (file)
@@ -98,7 +98,7 @@
 {
   if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
     return add_reg_operand (op, mode);
-  return satisfies_constraint_L (op);
+  return satisfies_constraint_L (op) || satisfies_constraint_CnL (op);
 })
 
 ;; Ordinary 3rd operand for arithmetic operations