aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordenisc <denisc@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-17 15:08:35 +0000
committerdenisc <denisc@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-17 15:08:35 +0000
commit088bd08888bfc4eac5a236cf25c53bf8d4b4169a (patch)
treec2859a91f71b5f0b6d4f1b2bd4d0989111b38be1
parentcf1f3b68fd02521da7b496319f3adda77e457e7a (diff)
* config/avr/avr.md ("mcu_enhanced"): New attribute.
("mcu_mega"): Likewise. ("extendhisi2"): Use "mcu_enhanced". ("zero_extendhisi2"): Likewise. ("call_insn"): Use "mcu_enhanced" and "mcu_mega". ("call_value_insn"): Likewise. ("*sbrx_branch"): Use "mcu_mega". ("*sbrx_and_branchsi"): Likewise. ("*sbrx_and_branchhi"): Likewise. ("*tablejump_lib"): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36474 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/avr/avr.md151
2 files changed, 81 insertions, 83 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4eca4b1f21c..42fe52bbcb0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+Sun Sep 17 18:48:32 2000 Denis Chertykov <denisc@overta.ru>
+
+ * config/avr/avr.md ("mcu_enhanced"): New attribute.
+ ("mcu_mega"): Likewise.
+ ("extendhisi2"): Use "mcu_enhanced".
+ ("zero_extendhisi2"): Likewise.
+ ("call_insn"): Use "mcu_enhanced" and "mcu_mega".
+ ("call_value_insn"): Likewise.
+ ("*sbrx_branch"): Use "mcu_mega".
+ ("*sbrx_and_branchsi"): Likewise.
+ ("*sbrx_and_branchhi"): Likewise.
+ ("*tablejump_lib"): Likewise.
+
Sun Sep 17 10:46:17 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* c-decl.c (grokdeclarator): Reorder tests to avoid looking at
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index fbd00a56ef8..e48dab7b269 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -28,6 +28,17 @@
(define_attr "type" "branch,branch1,arith"
(const_string "arith"))
+(define_attr "mcu_enhanced" "yes,no"
+ (const (if_then_else (symbol_ref "AVR_ENHANCED")
+ (const_string "yes")
+ (const_string "no"))))
+
+(define_attr "mcu_mega" "yes,no"
+ (const (if_then_else (symbol_ref "AVR_MEGA")
+ (const_string "yes")
+ (const_string "no"))))
+
+
;; The size of instructions in bytes.
;; XXX may depend from "cc"
@@ -1086,15 +1097,11 @@
"@
clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0
{mov %A0,%A1\;mov %B0,%B1|movw %A0,%A1}\;clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0"
- [(set (attr "length")
- (if_then_else
- (eq (symbol_ref "AVR_ENHANCED") (const_int 0))
- (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
- (const_int 4)
- (const_int 6))
- (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
- (const_int 4)
- (const_int 5))))
+ [(set_attr_alternative "length"
+ [(const_int 4)
+ (if_then_else (eq_attr "mcu_enhanced" "yes")
+ (const_int 5)
+ (const_int 6))])
(set_attr "cc" "clobber,clobber")])
;; xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x
@@ -1127,15 +1134,11 @@
"@
clr %C0\;clr %D0
{mov %A0,%A1\;mov %B0,%B1|movw %A0,%B0}\;clr %C0\;clr %D0"
- [(set (attr "length")
- (if_then_else
- (eq (symbol_ref "AVR_ENHANCED") (const_int 0))
- (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
- (const_int 2)
- (const_int 4))
- (if_then_else (eq (symbol_ref "which_alternative") (const_int 0))
- (const_int 2)
- (const_int 3))))
+ [(set_attr_alternative "length"
+ [(const_int 2)
+ (if_then_else (eq_attr "mcu_enhanced" "yes")
+ (const_int 3)
+ (const_int 4))])
(set_attr "cc" "set_n,set_n")])
;;<=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=>
@@ -1438,15 +1441,13 @@
return (AS1 (rjmp,_PC_+4) CR_TAB
AS1 (jmp,%3));
}"
- [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 3))
- (const_int -2046))
- (le (minus (pc) (match_dup 3))
- (const_int 2046)))
- (const_int 2)
- (if_then_else (eq (symbol_ref "AVR_MEGA")
- (const_int 0))
- (const_int 2)
- (const_int 4))))
+ [(set (attr "length")
+ (if_then_else (and (ge (minus (pc) (match_dup 3)) (const_int -2046))
+ (le (minus (pc) (match_dup 3)) (const_int 2046)))
+ (const_int 2)
+ (if_then_else (eq_attr "mcu_mega" "no")
+ (const_int 2)
+ (const_int 4))))
(set_attr "cc" "clobber")])
(define_insn "*sbrx_and_branchsi"
@@ -1477,15 +1478,13 @@
return (AS1 (rjmp,_PC_+4) CR_TAB
AS1 (jmp,%3));
}"
- [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 3))
- (const_int -2046))
- (le (minus (pc) (match_dup 3))
- (const_int 2046)))
- (const_int 2)
- (if_then_else (eq (symbol_ref "AVR_MEGA")
- (const_int 0))
- (const_int 2)
- (const_int 4))))
+ [(set (attr "length")
+ (if_then_else (and (ge (minus (pc) (match_dup 3)) (const_int -2046))
+ (le (minus (pc) (match_dup 3)) (const_int 2046)))
+ (const_int 2)
+ (if_then_else (eq_attr "mcu_mega" "no")
+ (const_int 2)
+ (const_int 4))))
(set_attr "cc" "clobber")])
(define_insn "*sbrx_and_branchhi"
@@ -1516,15 +1515,13 @@
return (AS1 (rjmp,_PC_+4) CR_TAB
AS1 (jmp,%3));
}"
- [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 3))
- (const_int -2046))
- (le (minus (pc) (match_dup 3))
- (const_int 2046)))
- (const_int 2)
- (if_then_else (eq (symbol_ref "AVR_MEGA")
- (const_int 0))
- (const_int 2)
- (const_int 4))))
+ [(set (attr "length")
+ (if_then_else (and (ge (minus (pc) (match_dup 3)) (const_int -2046))
+ (le (minus (pc) (match_dup 3)) (const_int 2046)))
+ (const_int 2)
+ (if_then_else (eq_attr "mcu_mega" "no")
+ (const_int 2)
+ (const_int 4))))
(set_attr "cc" "clobber")])
;; ************************************************************************
@@ -1601,15 +1598,14 @@
""
"*{
if (AVR_MEGA && get_attr_length (insn) != 1)
- return \"jmp %0\";
- return \"rjmp %0\";
+ return AS1 (jmp,%0);
+ return AS1 (rjmp,%0);
}"
- [(set (attr "length") (if_then_else (and (ge (minus (pc) (match_dup 0))
- (const_int -2047))
- (le (minus (pc) (match_dup 0))
- (const_int 2047)))
- (const_int 1)
- (const_int 2)))
+ [(set (attr "length")
+ (if_then_else (and (ge (minus (pc) (match_dup 0)) (const_int -2047))
+ (le (minus (pc) (match_dup 0)) (const_int 2047)))
+ (const_int 1)
+ (const_int 2)))
(set_attr "cc" "none")])
;; call
@@ -1655,18 +1651,14 @@
return AS1(call,%c0);
}"
[(set_attr "cc" "clobber,clobber,clobber")
- (set (attr "length")
- (cond [(eq (symbol_ref "which_alternative") (const_int 0))
- (const_int 1)
- (eq (symbol_ref "(which_alternative == 1 && AVR_ENHANCED)")
- (const_int 1))
- (const_int 2)
- (eq (symbol_ref "(which_alternative == 1 && !AVR_ENHANCED)")
- (const_int 1))
- (const_int 3)
- (eq (symbol_ref "!AVR_MEGA") (const_int 0))
- (const_int 2)]
- (const_int 1)))])
+ (set_attr_alternative "length"
+ [(const_int 1)
+ (if_then_else (eq_attr "mcu_enhanced" "yes")
+ (const_int 2)
+ (const_int 3))
+ (if_then_else (eq_attr "mcu_mega" "yes")
+ (const_int 2)
+ (const_int 1))])])
(define_insn "call_value_insn"
[(set (match_operand 0 "register_operand" "=r,r,r")
@@ -1694,19 +1686,14 @@
return AS1(call,%c1);
}"
[(set_attr "cc" "clobber,clobber,clobber")
- (set (attr "length")
- (cond [(eq (symbol_ref "which_alternative") (const_int 0))
- (const_int 1)
- (eq (symbol_ref "(which_alternative == 1 && AVR_ENHANCED)")
- (const_int 1))
- (const_int 2)
- (eq (symbol_ref "(which_alternative == 1 && !AVR_ENHANCED)")
- (const_int 1))
- (const_int 3)
- (eq (symbol_ref "!AVR_MEGA")
- (const_int 0))
- (const_int 2)]
- (const_int 1)))])
+ (set_attr_alternative "length"
+ [(const_int 1)
+ (if_then_else (eq_attr "mcu_enhanced" "yes")
+ (const_int 2)
+ (const_int 3))
+ (if_then_else (eq_attr "mcu_mega" "yes")
+ (const_int 2)
+ (const_int 1))])])
(define_insn "nop"
[(const_int 0)]
@@ -1746,11 +1733,9 @@
: AS1 (rjmp,__tablejump__));
}"
[(set_attr "cc" "clobber")
- (set (attr "length")
- (if_then_else (eq (symbol_ref "AVR_MEGA")
- (const_int 0))
- (const_int 3)
- (const_int 4)))])
+ (set (attr "length") (if_then_else (eq_attr "mcu_mega" "no")
+ (const_int 3)
+ (const_int 4)))])
(define_insn "*tablejump_enh"