summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-05 10:46:41 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-05 10:46:41 +0000
commit8c9eef637d050eb1a7fa8298762a89da7183e2a3 (patch)
treebc7c6de7412c74ece5803d83d4ecf409c2c1ae1c
parentb2f717e8d96740c7c18198f0befd6a87e2000aab (diff)
downloadgcc-8c9eef637d050eb1a7fa8298762a89da7183e2a3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117455 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/bfin/bfin.h3
-rw-r--r--gcc/config/bfin/bfin.md13
-rw-r--r--gcc/config/bfin/predicates.md7
4 files changed, 20 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 513e7c76be8..49a3409001a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index 1631a3797e1..6f270ce3c62 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -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) \
diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md
index c22663cf971..03747e8c85f 100644
--- a/gcc/config/bfin/bfin.md
+++ b/gcc/config/bfin/bfin.md
@@ -1083,18 +1083,11 @@
"%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;",
diff --git a/gcc/config/bfin/predicates.md b/gcc/config/bfin/predicates.md
index 1415ea0ab06..933b7f8e1b6 100644
--- a/gcc/config/bfin/predicates.md
+++ b/gcc/config/bfin/predicates.md
@@ -114,6 +114,13 @@
(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"