bfin.md (subsi3): Lose expander, change previously unnamed pattern into subsi3.

* 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
This commit is contained in:
Bernd Schmidt 2006-10-05 10:46:41 +00:00 committed by Bernd Schmidt
parent afd4a54a00
commit d4e8505009
4 changed files with 20 additions and 10 deletions

View 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.

View 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) \

View File

@ -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;",

View File

@ -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"