summaryrefslogtreecommitdiff
path: root/gcc/config/avr/predicates.md
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-07 03:45:24 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-07 03:45:24 +0000
commitd07b1e9e2f5140548f7d323980782e3eb22fa1d1 (patch)
treea1a4e39b164a18d47b91ca8cf42b38b86e873a2b /gcc/config/avr/predicates.md
parent60bcf3d46b2e2000a812c1c82db73181521c592a (diff)
downloadgcc-d07b1e9e2f5140548f7d323980782e3eb22fa1d1.tar.gz
* config/avr/avr-protos.h (call_insn_operand): Delete prototype.
* config/avr/avr.c (call_insn_operand): Delete function. * config/avr/avr.md (*pushqi, *pushhi, *pushsi, *pushsf): Use REG_SP instead of register number. Use predicates. * config/avr/predicates.md (const0_operand, reg_or_0_operand, call_insn_operand): Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120546 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/avr/predicates.md')
-rwxr-xr-xgcc/config/avr/predicates.md20
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/config/avr/predicates.md b/gcc/config/avr/predicates.md
index 9b9f8dafe85..4a0dd1c0cba 100755
--- a/gcc/config/avr/predicates.md
+++ b/gcc/config/avr/predicates.md
@@ -1,5 +1,5 @@
;; Predicate definitions for ATMEL AVR micro controllers.
-;; Copyright (C) 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
@@ -50,7 +50,17 @@
(and (match_code "const_int")
(match_test "INTVAL (op) >= 0x40
&& INTVAL (op) <= 0x60 - GET_MODE_SIZE (mode)")))
-
+
+;; Return 1 if OP is the zero constant for MODE.
+(define_predicate "const0_operand"
+ (and (match_code "const_int,const_double")
+ (match_test "op == CONST0_RTX (mode)")))
+
+;; Returns true if OP is either the constant zero or a register.
+(define_predicate "reg_or_0_operand"
+ (ior (match_operand 0 "register_operand")
+ (match_operand 0 "const0_operand")))
+
;; Returns 1 if OP is a SYMBOL_REF.
(define_predicate "symbol_ref_operand"
(match_code "symbol_ref"))
@@ -83,3 +93,9 @@
(define_predicate "simple_comparison_operator"
(and (match_operand 0 "comparison_operator")
(not (match_code "gt,gtu,le,leu"))))
+
+;; Return true if OP is a valid call operand.
+(define_predicate "call_insn_operand"
+ (and (match_code "mem")
+ (ior (match_test "register_operand (XEXP (op, 0), mode)")
+ (match_test "CONSTANT_ADDRESS_P (XEXP (op, 0))"))))