Commit 25f2e176 by Marek Michalkiewicz Committed by Marek Michalkiewicz

avr.c (avr_mcu_types): Update for new devices.


	* config/avr/avr.c (avr_mcu_types): Update for new devices.
	* config/avr/avr.h (TARGET_SWITCHES, AVR_MEGA): Add -mshort-calls.
	(LINK_SPEC, CRT_BINUTILS_SPECS): Update for new devices.
	* config/avr/avr.md ("type" and "length" attributes): New type
	"xcall", length 1 or 2 if AVR_MEGA.  Use in all patterns that
	output a single "call" or "rcall" insn depending on device size.
	* config/avr/t-avr (MULTILIB_MATCHES): Update for new devices.

From-SVN: r54410
parent 6ef0903d
2002-06-09 Marek Michalkiewicz <marekm@amelek.gda.pl>
* config/avr/avr.c (avr_mcu_types): Update for new devices.
* config/avr/avr.h (TARGET_SWITCHES, AVR_MEGA): Add -mshort-calls.
(LINK_SPEC, CRT_BINUTILS_SPECS): Update for new devices.
* config/avr/avr.md ("type" and "length" attributes): New type
"xcall", length 1 or 2 if AVR_MEGA. Use in all patterns that
output a single "call" or "rcall" insn depending on device size.
* config/avr/t-avr (MULTILIB_MATCHES): Update for new devices.
2002-06-09 David Edelsohn <edelsohn@gnu.org> 2002-06-09 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/{aix43.h,aix5.1} (ASM_CPU_SPEC): Add power3 * config/rs6000/{aix43.h,aix5.1} (ASM_CPU_SPEC): Add power3
......
...@@ -171,6 +171,7 @@ static const struct mcu_type_s avr_mcu_types[] = { ...@@ -171,6 +171,7 @@ static const struct mcu_type_s avr_mcu_types[] = {
{ "at90s8515", 2, "__AVR_AT90S8515__" }, { "at90s8515", 2, "__AVR_AT90S8515__" },
{ "at90c8534", 2, "__AVR_AT90C8534__" }, { "at90c8534", 2, "__AVR_AT90C8534__" },
{ "at90s8535", 2, "__AVR_AT90S8535__" }, { "at90s8535", 2, "__AVR_AT90S8535__" },
{ "at86rf401", 2, "__AVR_AT86RF401__" },
/* Classic, > 8K. */ /* Classic, > 8K. */
{ "avr3", 3, NULL }, { "avr3", 3, NULL },
{ "atmega103", 3, "__AVR_ATmega103__" }, { "atmega103", 3, "__AVR_ATmega103__" },
...@@ -182,12 +183,14 @@ static const struct mcu_type_s avr_mcu_types[] = { ...@@ -182,12 +183,14 @@ static const struct mcu_type_s avr_mcu_types[] = {
{ "avr4", 4, NULL }, { "avr4", 4, NULL },
{ "atmega8", 4, "__AVR_ATmega8__" }, { "atmega8", 4, "__AVR_ATmega8__" },
{ "atmega8515", 4, "__AVR_ATmega8515__" }, { "atmega8515", 4, "__AVR_ATmega8515__" },
{ "atmega8535", 4, "__AVR_ATmega8535__" },
/* Enhanced, > 8K. */ /* Enhanced, > 8K. */
{ "avr5", 5, NULL }, { "avr5", 5, NULL },
{ "atmega16", 5, "__AVR_ATmega16__" }, { "atmega16", 5, "__AVR_ATmega16__" },
{ "atmega161", 5, "__AVR_ATmega161__" }, { "atmega161", 5, "__AVR_ATmega161__" },
{ "atmega162", 5, "__AVR_ATmega162__" }, { "atmega162", 5, "__AVR_ATmega162__" },
{ "atmega163", 5, "__AVR_ATmega163__" }, { "atmega163", 5, "__AVR_ATmega163__" },
{ "atmega169", 5, "__AVR_ATmega169__" },
{ "atmega32", 5, "__AVR_ATmega32__" }, { "atmega32", 5, "__AVR_ATmega32__" },
{ "atmega323", 5, "__AVR_ATmega323__" }, { "atmega323", 5, "__AVR_ATmega323__" },
{ "atmega64", 5, "__AVR_ATmega64__" }, { "atmega64", 5, "__AVR_ATmega64__" },
......
...@@ -58,6 +58,7 @@ extern int target_flags; ...@@ -58,6 +58,7 @@ extern int target_flags;
#define MASK_NO_INTERRUPTS 0x00020000 #define MASK_NO_INTERRUPTS 0x00020000
#define MASK_CALL_PROLOGUES 0x00040000 #define MASK_CALL_PROLOGUES 0x00040000
#define MASK_TINY_STACK 0x00080000 #define MASK_TINY_STACK 0x00080000
#define MASK_SHORT_CALLS 0x00100000
#define TARGET_ORDER_1 (target_flags & MASK_ORDER_1) #define TARGET_ORDER_1 (target_flags & MASK_ORDER_1)
#define TARGET_ORDER_2 (target_flags & MASK_ORDER_2) #define TARGET_ORDER_2 (target_flags & MASK_ORDER_2)
...@@ -67,6 +68,7 @@ extern int target_flags; ...@@ -67,6 +68,7 @@ extern int target_flags;
#define TARGET_CALL_PROLOGUES (target_flags & MASK_CALL_PROLOGUES) #define TARGET_CALL_PROLOGUES (target_flags & MASK_CALL_PROLOGUES)
#define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK) #define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK)
#define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP) #define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP)
#define TARGET_SHORT_CALLS (target_flags & MASK_SHORT_CALLS)
/* Dump each assembler insn's rtl into the output file. /* Dump each assembler insn's rtl into the output file.
This is for debugging the compiler itself. */ This is for debugging the compiler itself. */
...@@ -86,6 +88,8 @@ extern int target_flags; ...@@ -86,6 +88,8 @@ extern int target_flags;
N_("Change only the low 8 bits of the stack pointer") }, \ N_("Change only the low 8 bits of the stack pointer") }, \
{ "no-tablejump", MASK_NO_TABLEJUMP, \ { "no-tablejump", MASK_NO_TABLEJUMP, \
N_("Do not generate tablejump insns") }, \ N_("Do not generate tablejump insns") }, \
{ "short-calls", MASK_SHORT_CALLS, \
N_("Use rjmp/rcall (limited range) on >8K devices") }, \
{ "rtl", MASK_RTL_DUMP, NULL }, \ { "rtl", MASK_RTL_DUMP, NULL }, \
{ "size", MASK_INSN_SIZE_DUMP, \ { "size", MASK_INSN_SIZE_DUMP, \
N_("Output instruction sizes to the asm file") }, \ N_("Output instruction sizes to the asm file") }, \
...@@ -101,7 +105,7 @@ extern int avr_mega_p; ...@@ -101,7 +105,7 @@ extern int avr_mega_p;
extern int avr_enhanced_p; extern int avr_enhanced_p;
extern int avr_asm_only_p; extern int avr_asm_only_p;
#define AVR_MEGA (avr_mega_p) #define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS)
#define AVR_ENHANCED (avr_enhanced_p) #define AVR_ENHANCED (avr_enhanced_p)
#define TARGET_OPTIONS { \ #define TARGET_OPTIONS { \
...@@ -2585,11 +2589,11 @@ extern int avr_case_values_threshold; ...@@ -2585,11 +2589,11 @@ extern int avr_case_values_threshold;
#define LINK_SPEC " %{!mmcu*:-m avr2}\ #define LINK_SPEC " %{!mmcu*:-m avr2}\
%{mmcu=at90s1200|mmcu=attiny1*|mmcu=attiny28:-m avr1} \ %{mmcu=at90s1200|mmcu=attiny1*|mmcu=attiny28:-m avr1} \
%{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*:-m avr2}\ %{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401:-m avr2}\
%{mmcu=atmega103|mmcu=atmega603|mmcu=at43*|mmcu=at76*:-m avr3}\ %{mmcu=atmega103|mmcu=atmega603|mmcu=at43*|mmcu=at76*:-m avr3}\
%{mmcu=atmega8*:-m avr4}\ %{mmcu=atmega8*:-m avr4}\
%{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega64|mmcu=atmega128|mmcu=at94k:-m avr5}\ %{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega64|mmcu=atmega128|mmcu=at94k:-m avr5}\
%{mmcu=atmega64|mmcu=atmega128|mmcu=atmega162: -Tdata 0x800100} " %{mmcu=atmega64|mmcu=atmega128|mmcu=atmega162|mmcu=atmega169: -Tdata 0x800100} "
/* A C string constant that tells the GNU CC driver program options to /* A C string constant that tells the GNU CC driver program options to
pass to the linker. It can also specify how to translate options pass to the linker. It can also specify how to translate options
...@@ -2653,6 +2657,7 @@ extern int avr_case_values_threshold; ...@@ -2653,6 +2657,7 @@ extern int avr_case_values_threshold;
%{mmcu=at90s4434:crts4434.o%s} \ %{mmcu=at90s4434:crts4434.o%s} \
%{mmcu=at90c8534:crtc8534.o%s} \ %{mmcu=at90c8534:crtc8534.o%s} \
%{mmcu=at90s8535:crts8535.o%s} \ %{mmcu=at90s8535:crts8535.o%s} \
%{mmcu=at86rf401:crt86401.o%s} \
%{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \ %{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \
%{mmcu=atmega603:crtm603.o%s} \ %{mmcu=atmega603:crtm603.o%s} \
%{mmcu=at43usb320:crt43320.o%s} \ %{mmcu=at43usb320:crt43320.o%s} \
...@@ -2660,10 +2665,12 @@ extern int avr_case_values_threshold; ...@@ -2660,10 +2665,12 @@ extern int avr_case_values_threshold;
%{mmcu=at76c711:crt76711.o%s} \ %{mmcu=at76c711:crt76711.o%s} \
%{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \ %{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
%{mmcu=atmega8515:crtm8515.o%s} \ %{mmcu=atmega8515:crtm8515.o%s} \
%{mmcu=atmega8535:crtm8535.o%s} \
%{mmcu=atmega16:crtm16.o%s} \ %{mmcu=atmega16:crtm16.o%s} \
%{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \ %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
%{mmcu=atmega162:crtm162.o%s} \ %{mmcu=atmega162:crtm162.o%s} \
%{mmcu=atmega163:crtm163.o%s} \ %{mmcu=atmega163:crtm163.o%s} \
%{mmcu=atmega169:crtm169.o%s} \
%{mmcu=atmega32:crtm32.o%s} \ %{mmcu=atmega32:crtm32.o%s} \
%{mmcu=atmega323:crtm323.o%s} \ %{mmcu=atmega323:crtm323.o%s} \
%{mmcu=atmega64:crtm64.o%s} \ %{mmcu=atmega64:crtm64.o%s} \
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
(define_attr "cc" "none,set_czn,set_zn,set_n,compare,clobber" (define_attr "cc" "none,set_czn,set_zn,set_n,compare,clobber"
(const_string "none")) (const_string "none"))
(define_attr "type" "branch,branch1,arith" (define_attr "type" "branch,branch1,arith,xcall"
(const_string "arith")) (const_string "arith"))
(define_attr "mcu_enhanced" "yes,no" (define_attr "mcu_enhanced" "yes,no"
...@@ -80,7 +80,11 @@ ...@@ -80,7 +80,11 @@
(le (minus (pc) (match_dup 0)) (le (minus (pc) (match_dup 0))
(const_int 2043))) (const_int 2043)))
(const_int 3) (const_int 3)
(const_int 4)))] (const_int 4)))
(eq_attr "type" "xcall")
(if_then_else (eq_attr "mcu_mega" "no")
(const_int 1)
(const_int 2))]
(const_int 2))) (const_int 2)))
(define_insn "*pop1" (define_insn "*pop1"
...@@ -718,9 +722,7 @@ ...@@ -718,9 +722,7 @@
(clobber (reg:QI 22))] (clobber (reg:QI 22))]
"!AVR_ENHANCED" "!AVR_ENHANCED"
"%~call __mulqi3" "%~call __mulqi3"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
(define_insn "mulqihi3" (define_insn "mulqihi3"
...@@ -790,9 +792,7 @@ ...@@ -790,9 +792,7 @@
(clobber (reg:QI 21))] (clobber (reg:QI 21))]
"!AVR_ENHANCED" "!AVR_ENHANCED"
"%~call __mulhi3" "%~call __mulhi3"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
;; Operand 2 (reg:SI 18) not clobbered on the enhanced core. ;; Operand 2 (reg:SI 18) not clobbered on the enhanced core.
...@@ -813,9 +813,7 @@ ...@@ -813,9 +813,7 @@
(clobber (reg:HI 30))] (clobber (reg:HI 30))]
"AVR_ENHANCED" "AVR_ENHANCED"
"%~call __mulsi3" "%~call __mulsi3"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
; / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % ; / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / % / %
...@@ -845,9 +843,7 @@ ...@@ -845,9 +843,7 @@
(clobber (reg:QI 23))] (clobber (reg:QI 23))]
"" ""
"%~call __divmodqi4" "%~call __divmodqi4"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
(define_expand "udivmodqi4" (define_expand "udivmodqi4"
...@@ -867,9 +863,7 @@ ...@@ -867,9 +863,7 @@
(clobber (reg:QI 23))] (clobber (reg:QI 23))]
"" ""
"%~call __udivmodqi4" "%~call __udivmodqi4"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
(define_expand "divmodhi4" (define_expand "divmodhi4"
...@@ -891,9 +885,7 @@ ...@@ -891,9 +885,7 @@
(clobber (reg:QI 21))] (clobber (reg:QI 21))]
"" ""
"%~call __divmodhi4" "%~call __divmodhi4"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
(define_expand "udivmodhi4" (define_expand "udivmodhi4"
...@@ -915,9 +907,7 @@ ...@@ -915,9 +907,7 @@
(clobber (reg:QI 21))] (clobber (reg:QI 21))]
"" ""
"%~call __udivmodhi4" "%~call __udivmodhi4"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
(define_expand "divmodsi4" (define_expand "divmodsi4"
...@@ -939,9 +929,7 @@ ...@@ -939,9 +929,7 @@
(clobber (reg:HI 30))] (clobber (reg:HI 30))]
"" ""
"%~call __divmodsi4" "%~call __divmodsi4"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
(define_expand "udivmodsi4" (define_expand "udivmodsi4"
...@@ -963,9 +951,7 @@ ...@@ -963,9 +951,7 @@
(clobber (reg:HI 30))] (clobber (reg:HI 30))]
"" ""
"%~call __udivmodsi4" "%~call __udivmodsi4"
[(set (attr "length") (if_then_else (eq_attr "mcu_mega" "no") [(set_attr "type" "xcall")
(const_int 1)
(const_int 2)))
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
......
...@@ -49,9 +49,11 @@ MULTILIB_MATCHES = \ ...@@ -49,9 +49,11 @@ MULTILIB_MATCHES = \
mmcu?avr3=mmcu?atmega103 mmcu?avr3=mmcu?atmega603 \ mmcu?avr3=mmcu?atmega103 mmcu?avr3=mmcu?atmega603 \
mmcu?avr3=mmcu?at43usb320 mmcu?avr3=at43usb355 \ mmcu?avr3=mmcu?at43usb320 mmcu?avr3=at43usb355 \
mmcu?avr3=mmcu?at76c711 \ mmcu?avr3=mmcu?at76c711 \
mmcu?avr4=mmcu?atmega8515 mmcu?avr4=mmcu?atmega8 \ mmcu?avr4=mmcu?atmega8515 mmcu?avr4=mmcu?atmega8535 \
mmcu?avr4=mmcu?atmega8 \
mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega162 \ mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega162 \
mmcu?avr5=mmcu?atmega163 mmcu?avr5=mmcu?atmega16 \ mmcu?avr5=mmcu?atmega163 mmcu?avr5=mmcu?atmega169 \
mmcu?avr5=mmcu?atmega16 \
mmcu?avr5=mmcu?atmega323 mmcu?avr5=mmcu?atmega32 \ mmcu?avr5=mmcu?atmega323 mmcu?avr5=mmcu?atmega32 \
mmcu?avr5=mmcu?atmega64 mmcu?avr5=mmcu?atmega128 \ mmcu?avr5=mmcu?atmega64 mmcu?avr5=mmcu?atmega128 \
mmcu?avr5=mmcu?at94k mmcu?avr5=mmcu?at94k
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment