bfin.md (subsi3): Lose expander, change previously unnamed pattern into subsi3.
authorBernd Schmidt <bernd.schmidt@analog.com>
Thu, 5 Oct 2006 10:46:41 +0000 (10:46 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 5 Oct 2006 10:46:41 +0000 (10:46 +0000)
* config/bfin/bfin.md (subsi3): Lose expander, change previously
unnamed pattern into subsi3.  Use correct constraints/predicates.
* config/bfin/bfin.h (CONST_OK_FOR_K): Handle "KN7".
* config/bfin/predicates.md (reg_or_neg7bit_operand_p): New.

From-SVN: r117455

gcc/ChangeLog
gcc/config/bfin/bfin.h
gcc/config/bfin/bfin.md
gcc/config/bfin/predicates.md

index 513e7c76be831ef75db1bcf1186736eda4a93359..49a3409001a9a4407fdb06c3a609084d0b03c43f 100644 (file)
@@ -1,3 +1,10 @@
+2006-10-05  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       * config/bfin/bfin.md (subsi3): Lose expander, change previously
+       unnamed pattern into subsi3.  Use correct constraints/predicates.
+       * config/bfin/bfin.h (CONST_OK_FOR_K): Handle "KN7".
+       * config/bfin/predicates.md (reg_or_neg7bit_operand_p): New.
+
 2006-10-05  Ira Rosen  <irar@il.ibm.com>
 
        * doc/loop.texi: Add data references analysis description.
index 1631a3797e1a6e5efa9e39e61cf2c816f0796143..6f270ce3c62d46e9043db69aa700ce38b6996d73 100644 (file)
@@ -1063,6 +1063,9 @@ do {                                              \
      : (STR)[1] == 'n'                                 \
      ? ((STR)[2] == '7' ? CONST_7NBIT_IMM_P (VALUE)    \
        : 0)                                            \
+     : (STR)[1] == 'N'                                 \
+     ? ((STR)[2] == '7' ? CONST_7BIT_IMM_P (-(VALUE))  \
+       : 0)                                            \
      : 0)
 
 #define CONST_OK_FOR_M(VALUE, STR)                     \
index c22663cf9716342848bf27f5c285e45d0987151b..03747e8c85f5f7c9d47622459517ac19b2bdd783 100644 (file)
   "%0 = %1 + %2 (S);"
   [(set_attr "type" "dsp32")])
 
-(define_expand "subsi3"
-  [(set (match_operand:SI 0 "register_operand" "")
-       (minus:SI (match_operand:SI 1 "register_operand" "")
-                 (match_operand:SI 2 "reg_or_7bit_operand" "")))]
-  ""
-  "")
-
-(define_insn ""
+(define_insn "subsi3"
   [(set (match_operand:SI 0 "register_operand" "=da,d,a")
        (minus:SI (match_operand:SI 1 "register_operand" "0,d,0")
-                 (match_operand:SI 2 "reg_or_7bit_operand" "Ks7,d,a")))]
-  "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -64"
+                 (match_operand:SI 2 "reg_or_neg7bit_operand" "KN7,d,a")))]
+  ""
 {
   static const char *const strings_subsi3[] = {
     "%0 += -%2;",
index 1415ea0ab06b5dc4464fa3a0e3740b898344a575..933b7f8e1b6cb1da220ca9ac0ceadf0134db6013 100644 (file)
   (ior (match_operand 0 "nondp_register_operand")
        (match_operand 0 "memory_operand")))
 
+;; Return nonzero if OP is a register or, when negated, a 7 bit signed
+;; constant.
+(define_predicate "reg_or_neg7bit_operand"
+  (ior (match_operand 0 "register_operand")
+       (and (match_code "const_int")
+           (match_test "CONST_7BIT_IMM_P (-INTVAL (op))"))))
+
 ;; Used for secondary reloads, this function returns 1 if OP is of the
 ;; form (plus (fp) (const_int)).
 (define_predicate "fp_plus_const_operand"