diff options
author | Denis Chertykov <denisc@overta.ru> | 2000-09-13 18:13:49 +0000 |
---|---|---|
committer | Denis Chertykov <denisc@gcc.gnu.org> | 2000-09-13 22:13:49 +0400 |
commit | 1ca04dc8b6480d22d9f20620b14f16e5870c600d (patch) | |
tree | f6206ef381a3c388a03f99db4850173c3765b9ef | |
parent | 18a53ffedb9c36db0b505afd249b02056156448d (diff) | |
download | gcc-1ca04dc8b6480d22d9f20620b14f16e5870c600d.zip gcc-1ca04dc8b6480d22d9f20620b14f16e5870c600d.tar.gz gcc-1ca04dc8b6480d22d9f20620b14f16e5870c600d.tar.bz2 |
avr.h (ASSEMBLER_DIALECT): New macro declared.
* config/avr/avr.h (ASSEMBLER_DIALECT): New macro declared.
* config/avr/avr.md (*movstrqi_insn): Cleanup output template.
(*clrstrqi): Likewise.
(xorhi3,xorsi3,absqi2): Likewise.
(one_cmplhi2,one_cmplsi2): Likewise.
(addsi3): Two stupid constraint alternatives removed.
(extendhisi2): Use `movw' for enhanced avr cores.
(zero_extendhisi2): Likewise.
From-SVN: r36390
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/avr/avr-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/avr/avr.c | 2 | ||||
-rw-r--r-- | gcc/config/avr/avr.h | 25 | ||||
-rw-r--r-- | gcc/config/avr/avr.md | 61 |
5 files changed, 74 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 15f235d..ef68665 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +Tue Sep 12 13:51:13 2000 Denis Chertykov <denisc@overta.ru> + + * config/avr/avr.h (ASSEMBLER_DIALECT): New macro declared. + * config/avr/avr.md (*movstrqi_insn): Cleanup output template. + (*clrstrqi): Likewise. + (xorhi3,xorsi3,absqi2): Likewise. + (one_cmplhi2,one_cmplsi2): Likewise. + (addsi3): Two stupid constraint alternatives removed. + (extendhisi2): Use `movw' for enhanced avr cores. + (zero_extendhisi2): Likewise. + Wed Sep 13 02:31:23 EDT 2000 John Wehle (john@feith.com) * alias.c (find_base_term): Use frame_pointer_rtx diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h index 8193d23..6c34cf3 100644 --- a/gcc/config/avr/avr-protos.h +++ b/gcc/config/avr/avr-protos.h @@ -42,8 +42,6 @@ extern int mask_one_bit_p PARAMS ((HOST_WIDE_INT mask)); extern void gas_output_limited_string PARAMS ((FILE *file, const char *str)); extern void gas_output_ascii PARAMS ((FILE *file, const char *str, size_t length)); - - #ifdef TREE_CODE extern void asm_output_external PARAMS ((FILE *file, tree decl, char *name)); diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 6f2ba18..fca29f9 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -4666,5 +4666,3 @@ output_reload_insisf (insn, operands, len) } return ""; } - - diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 18f84f3..48fea8b 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -2656,6 +2656,31 @@ sprintf (STRING, "*.%s%d", PREFIX, NUM) formats. In that case, the various `tm.h' files can define these macros differently. */ +#define ASSEMBLER_DIALECT AVR_ENHANCED +/* If your target supports multiple dialects of assembler language + (such as different opcodes), define this macro as a C expression + that gives the numeric index of the assembler language dialect to + use, with zero as the first variant. + + If this macro is defined, you may use constructs of the form + `{option0|option1|option2...}' in the output templates of patterns + (*note Output Template::.) or in the first argument of + `asm_fprintf'. This construct outputs `option0', `option1' or + `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one + or two, etc. Any special characters within these strings retain + their usual meaning. + + If you do not define this macro, the characters `{', `|' and `}' + do not have any special meaning when used in templates or operands + to `asm_fprintf'. + + Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX', + `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the + variations in assembler language syntax with that mechanism. + Define `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax + if the syntax variant are larger and involve such things as + different opcodes or operand order. */ + #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \ { \ if (REGNO > 31) \ diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index ba456ff..fbd00a5 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -340,8 +340,7 @@ (clobber (match_dup 0)) (clobber (match_dup 1))] "" - " - ld __tmp_reg__,%a1+ + "ld __tmp_reg__,%a1+ st %a0+,__tmp_reg__ dec %2 brne _PC_-8" @@ -409,8 +408,7 @@ (clobber (match_dup 1)) (clobber (match_dup 0))] "" - " - st %a0+,__zero_reg__ + "st %a0+,__zero_reg__ dec %1 brne _PC_-6" [(set_attr "length" "3") @@ -555,12 +553,11 @@ [(set_attr "length" "2,1,1,2,3,3") (set_attr "cc" "set_n,set_czn,set_czn,set_czn,set_n,set_n")]) -;; TODO: use "movw" if available (define_insn "addsi3" - [(set (match_operand:SI 0 "register_operand" "=r,!w,!w,d,r,r,&*!w,&*!w") + [(set (match_operand:SI 0 "register_operand" "=r,!w,!w,d,r,r") (plus:SI - (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0,r,r") - (match_operand:SI 2 "nonmemory_operand" "r,I,J,i,P,N,#I,#J")))] + (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0") + (match_operand:SI 2 "nonmemory_operand" "r,I,J,i,P,N")))] "" "@ add %A0,%A2\;adc %B0,%B2\;adc %C0,%C2\;adc %D0,%D2 @@ -568,11 +565,9 @@ sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__ subi %0,lo8(-(%2))\;sbci %B0,hi8(-(%2))\;sbci %C0,hlo8(-(%2))\;sbci %D0,hhi8(-(%2)) sec\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__ - sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__ - mov %A0,%A1\;mov %B0,%B1\;mov %C0,%C1\;mov %D0,%D1\;adiw %0,%2\;adc %C0,__zero_reg__\;adc %D0,__zero_reg__ - mov %A0,%A1\;mov %B0,%B1\;mov %C0,%C1\;mov %D0,%D1\;sbiw %0,%n2\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__" - [(set_attr "length" "4,3,3,4,5,5,7,7") - (set_attr "cc" "set_n,set_n,set_czn,set_czn,set_n,set_n,set_n,set_czn")]) + sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__\;sbc %C0,__zero_reg__\;sbc %D0,__zero_reg__" + [(set_attr "length" "4,3,3,4,5,5") + (set_attr "cc" "set_n,set_n,set_czn,set_czn,set_n,set_n")]) ;----------------------------------------------------------------------------- ; sub bytes @@ -852,7 +847,8 @@ (xor:HI (match_operand:HI 1 "register_operand" "%0") (match_operand:HI 2 "register_operand" "r")))] "" - "eor %0,%2\;eor %B0,%B2" + "eor %0,%2 + eor %B0,%B2" [(set_attr "length" "2") (set_attr "cc" "set_n")]) @@ -971,7 +967,8 @@ [(set (match_operand:QI 0 "register_operand" "=r") (abs:QI (match_operand:QI 1 "register_operand" "0")))] "" - "sbrc %0,7\;neg %0" + "sbrc %0,7 + neg %0" [(set_attr "length" "2") (set_attr "cc" "clobber")]) @@ -1043,7 +1040,8 @@ [(set (match_operand:HI 0 "register_operand" "=r") (not:HI (match_operand:HI 1 "register_operand" "0")))] "" - "com %0\;com %B0" + "com %0 + com %B0" [(set_attr "length" "2") (set_attr "cc" "set_n")]) @@ -1051,7 +1049,10 @@ [(set (match_operand:SI 0 "register_operand" "=r") (not:SI (match_operand:SI 1 "register_operand" "0")))] "" - "com %0\;com %B0\;com %C0\;com %D0" + "com %0 + com %B0 + com %C0 + com %D0" [(set_attr "length" "4") (set_attr "cc" "set_n")]) @@ -1078,15 +1079,22 @@ [(set_attr "length" "5,6") (set_attr "cc" "clobber,clobber")]) -;; TODO: use "movw" if available (define_insn "extendhisi2" [(set (match_operand:SI 0 "register_operand" "=r,&r") (sign_extend:SI (match_operand:HI 1 "register_operand" "0,*r")))] "" "@ clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0 - mov %A0,%A1\;mov %B0,%B1\;clr %C0\;sbrc %B0,7\;com %C0\;mov %D0,%C0" - [(set_attr "length" "4,6") + {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 "cc" "clobber,clobber")]) ;; xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x xx<---x @@ -1112,15 +1120,22 @@ [(set_attr "length" "3,4") (set_attr "cc" "set_n,set_n")]) -;; TODO: use "movw" if available (define_insn "zero_extendhisi2" [(set (match_operand:SI 0 "register_operand" "=r,&r") (zero_extend:SI (match_operand:HI 1 "register_operand" "0,*r")))] "" "@ clr %C0\;clr %D0 - mov %A0,%A1\;mov %B0,%B1\;clr %C0\;clr %D0" - [(set_attr "length" "2,4") + {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 "cc" "set_n,set_n")]) ;;<=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=> |