Commit 6bec29c9 by Denis Chertykov Committed by Denis Chertykov

avr-protos.h: (avr_output_ascii) Removed.

	* config/avr/avr-protos.h: (avr_output_ascii) Removed.
	(avr_progmem_p): New prototype.
	(output_movsisf): Prototype declaration changed.
	(output_movqi): New prototype.
	(output_movhi): New prototype.
	(call_insn_operand): Likewise.
	(final_prescan_insn): Likewise.
	(avr_simplify_comparision_p): Likewise.
	(avr_normalize_condition): Likewise.
	(compare_eq_p): Likewise.
	(out_shift_with_cnt): Likewise.
	(const_int_pow2_p): Likewise.
	(output_reload_inhi): Prototype declaration changed.

	* config/avr/avr.c: (debug_hard_reg_set): Prototype declared.
	(ldi_reg_rtx): New. rtx for r31.
	(avr_init_stack): Initialize as "__stack".
	(function_prologue): Use it.
	Replace all TARGET_ENHANCED with AVR_ENHANCED.
	(avr_mcu_name): Initialize as "avr2".
	(avr_enhanced_p, avr_mega_p): New variables.
	(mcu_types, avr_override_options): Handle all known MCU types.
	Also handle avr1 (only preprocess, assemble and link).
	(print_operand): Using of `%K' in output template removed.
	(out_movqi_r_mr): Optimized.
	(out_movhi_r_mr): Likewise.
	(output_movqi): New function.
	(output_movhi): Likewise.
	(out_movsi_r_mr): Optimized.
	(output_movsisf): Compute insn length for `adjust_insn_length'
	(out_movqi_mr_r): Optimized.
	(out_movhi_mr_r): Optimized.
	(adjust_insn_length): Use output_movsisf, output_movqi,
	output_movhi for insn length adjusting.
	(reg_unused_after): Use dead_or_set_p.
	(preferred_reload_class): Now havn't any restriction.
	(reg_was_0): New function.
	(io_address_p): Likewise.
	(const_int_pow2_p): Likewise.
	(output_reload_inhi): Likewise.
	(output_reload_insisf): Likewise.

	* config/avr/avr.h (MULTILIB_DEFAULTS): Define.
	(LIB_SPEC): Use -lc for all supported devices.
	(LIBGCC_SPEC): Use -lgcc for all supported devices.
	(AVR_MEGA): Define as avr_mega_p.
	(AVR_ENHANCED): New, define as avr_enhanced_p.
	(TARGET_SWITCHES): Remove -menhanced, now handled by -mmcu=...
	(CPP_SPEC, LINK_SPEC): Handle all known MCU types.
	(CRT_BINUTILS_SPECS): Handle all known MCU types.
	Rename gcrt1-*.o to make file names unique on 8.3 filesystems.
	(EXTRA_SPECS): Add CPP_AVR[1-5]_SPEC.
	(ASM_SPEC): Pass -mmcu=... to the assembler.
	Change all -DAVR_* to -D__AVR_*__.
	(INIT_TARGET_OPTABS), config/avr/libgcc.S:
	Rename library functions to start with two underscores.
	(ASM_OUTPUT_COMMON): Outputs `.comm VAR,VAR-SIZE,1' to avoid
	alignment.
	(ASM_WEAKEN_LABEL): Declared for __attribute__((weak)).
	(SUPPORTS_WEAK): Likewise.
	(LDI_REG_REGNO): New. Register r31 will be used as temporary
	register for loading constants to r0-r14.

	* config/avr/avr.md: Replace all TARGET_ENHANCED with
	AVR_ENHANCED.
	(*mov_r_sp): Removed. Handled by output_movhi.
	(*mov_sp_r): Likewise.
	(*mov_sp_r_no_interrupts): Likewise
	(*mov_sp_r_tiny): Likewise.
	(*movqi): Use output_movqi.
	(*reload_inqi): New.
	(*movhi): Use output_movhi.
	(*reload_inhi): New.
	(*negsi2): Optimized.
	(*negsf2): Likewise.
	Added peepholes (define_peephole2) for loading constants to r0-r14
	and for using `cpse' command.

	* config/avr/libgcc.S: Rename library functions to start with two
	underscores.
	Add support for enhanced core.
	(_moqhi3): Fix typo, now _modqi3.
	(__divsi_raw): Use __zero_reg__ as loop counter, smaller by 1 word.
	(__prologue_saves__): Remove test for stack adjust by 0.
	(__tablejump__): New.

	* config/avr/t-avr: Build libgcc2 with -mcall-prologues.
	Add multilib support.

From-SVN: r36047
parent 20bd7bfa
Tue Aug 29 22:29:58 2000 Denis Chertykov <denisc@overta.ru> & Marek Michalkiewicz <marekm@linux.org.pl>
* config/avr/avr-protos.h: (avr_output_ascii) Removed.
(avr_progmem_p): New prototype.
(output_movsisf): Prototype declaration changed.
(output_movqi): New prototype.
(output_movhi): New prototype.
(call_insn_operand): Likewise.
(final_prescan_insn): Likewise.
(avr_simplify_comparision_p): Likewise.
(avr_normalize_condition): Likewise.
(compare_eq_p): Likewise.
(out_shift_with_cnt): Likewise.
(const_int_pow2_p): Likewise.
(output_reload_inhi): Prototype declaration changed.
* config/avr/avr.c: (debug_hard_reg_set): Prototype declared.
(ldi_reg_rtx): New. rtx for r31.
(avr_init_stack): Initialize as "__stack".
(function_prologue): Use it.
Replace all TARGET_ENHANCED with AVR_ENHANCED.
(avr_mcu_name): Initialize as "avr2".
(avr_enhanced_p, avr_mega_p): New variables.
(mcu_types, avr_override_options): Handle all known MCU types.
Also handle avr1 (only preprocess, assemble and link).
(print_operand): Using of `%K' in output template removed.
(out_movqi_r_mr): Optimized.
(out_movhi_r_mr): Likewise.
(output_movqi): New function.
(output_movhi): Likewise.
(out_movsi_r_mr): Optimized.
(output_movsisf): Compute insn length for `adjust_insn_length'
(out_movqi_mr_r): Optimized.
(out_movhi_mr_r): Optimized.
(adjust_insn_length): Use output_movsisf, output_movqi,
output_movhi for insn length adjusting.
(reg_unused_after): Use dead_or_set_p.
(preferred_reload_class): Now havn't any restriction.
(reg_was_0): New function.
(io_address_p): Likewise.
(const_int_pow2_p): Likewise.
(output_reload_inhi): Likewise.
(output_reload_insisf): Likewise.
* config/avr/avr.h (MULTILIB_DEFAULTS): Define.
(LIB_SPEC): Use -lc for all supported devices.
(LIBGCC_SPEC): Use -lgcc for all supported devices.
(AVR_MEGA): Define as avr_mega_p.
(AVR_ENHANCED): New, define as avr_enhanced_p.
(TARGET_SWITCHES): Remove -menhanced, now handled by -mmcu=...
(CPP_SPEC, LINK_SPEC): Handle all known MCU types.
(CRT_BINUTILS_SPECS): Handle all known MCU types.
Rename gcrt1-*.o to make file names unique on 8.3 filesystems.
(EXTRA_SPECS): Add CPP_AVR[1-5]_SPEC.
(ASM_SPEC): Pass -mmcu=... to the assembler.
Change all -DAVR_* to -D__AVR_*__.
(INIT_TARGET_OPTABS), config/avr/libgcc.S:
Rename library functions to start with two underscores.
(ASM_OUTPUT_COMMON): Outputs `.comm VAR,VAR-SIZE,1' to avoid
alignment.
(ASM_WEAKEN_LABEL): Declared for __attribute__((weak)).
(SUPPORTS_WEAK): Likewise.
(LDI_REG_REGNO): New. Register r31 will be used as temporary
register for loading constants to r0-r14.
* config/avr/avr.md: Replace all TARGET_ENHANCED with
AVR_ENHANCED.
(*mov_r_sp): Removed. Handled by output_movhi.
(*mov_sp_r): Likewise.
(*mov_sp_r_no_interrupts): Likewise
(*mov_sp_r_tiny): Likewise.
(*movqi): Use output_movqi.
(*reload_inqi): New.
(*movhi): Use output_movhi.
(*reload_inhi): New.
(*negsi2): Optimized.
(*negsf2): Likewise.
Added peepholes (define_peephole2) for loading constants to r0-r14
and for using `cpse' command.
* config/avr/libgcc.S: Rename library functions to start with two
underscores.
Add support for enhanced core.
(_moqhi3): Fix typo, now _modqi3.
(__divsi_raw): Use __zero_reg__ as loop counter, smaller by 1 word.
(__prologue_saves__): Remove test for stack adjust by 0.
(__tablejump__): New.
* config/avr/t-avr: Build libgcc2 with -mcall-prologues.
Add multilib support.
Tue Aug 29 15:17:54 EDT 2000 John Wehle (john@feith.com) Tue Aug 29 15:17:54 EDT 2000 John Wehle (john@feith.com)
* loop.c (prescan_loop): Don't check unknown_address_altered * loop.c (prescan_loop): Don't check unknown_address_altered
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
extern void avr_output_ascii PARAMS ((FILE *file,
const char *p,
int size));
extern int function_arg_regno_p PARAMS ((int r)); extern int function_arg_regno_p PARAMS ((int r));
extern void asm_file_start PARAMS ((FILE *file)); extern void asm_file_start PARAMS ((FILE *file));
extern void asm_file_end PARAMS ((FILE *file)); extern void asm_file_end PARAMS ((FILE *file));
...@@ -35,14 +32,17 @@ extern enum reg_class class_likely_spilled_p PARAMS ((int c)); ...@@ -35,14 +32,17 @@ extern enum reg_class class_likely_spilled_p PARAMS ((int c));
extern enum reg_class avr_regno_reg_class PARAMS ((int r)); extern enum reg_class avr_regno_reg_class PARAMS ((int r));
extern enum reg_class avr_reg_class_from_letter PARAMS ((int c)); extern enum reg_class avr_reg_class_from_letter PARAMS ((int c));
extern int frame_pointer_required_p PARAMS ((void)); extern int frame_pointer_required_p PARAMS ((void));
extern void asm_globalize_label PARAMS ((FILE *file, extern void asm_globalize_label PARAMS ((FILE *file, const char *name));
const char *name)); extern void order_regs_for_local_alloc PARAMS ((void));
extern void order_regs_for_local_alloc PARAMS ((void)); extern int initial_elimination_offset PARAMS ((int from, int to));
extern int initial_elimination_offset PARAMS ((int from, int to)); extern void function_prologue PARAMS ((FILE *file, int size));
extern void function_prologue PARAMS ((FILE *file, int size)); extern void function_epilogue PARAMS ((FILE *file, int size));
extern void function_epilogue PARAMS ((FILE *file, int size)); extern void progmem_section PARAMS ((void));
extern void progmem_section PARAMS ((void)); extern int mask_one_bit_p PARAMS ((HOST_WIDE_INT mask));
extern int mask_one_bit_p PARAMS ((HOST_WIDE_INT mask)); extern void gas_output_limited_string PARAMS ((FILE *file, char *str));
extern void gas_output_ascii PARAMS ((FILE *file, char * str,
size_t length));
#ifdef TREE_CODE #ifdef TREE_CODE
extern void asm_output_external PARAMS ((FILE *file, tree decl, extern void asm_output_external PARAMS ((FILE *file, tree decl,
...@@ -58,6 +58,9 @@ extern int valid_machine_type_attribute PARAMS ((tree type, tree attributes, ...@@ -58,6 +58,9 @@ extern int valid_machine_type_attribute PARAMS ((tree type, tree attributes,
extern int valid_machine_decl_attribute PARAMS ((tree decl, tree attributes, extern int valid_machine_decl_attribute PARAMS ((tree decl, tree attributes,
tree attr, tree args)); tree attr, tree args));
extern int avr_progmem_p PARAMS ((tree decl));
#ifdef RTX_CODE /* inside TREE_CODE */ #ifdef RTX_CODE /* inside TREE_CODE */
extern rtx avr_function_value PARAMS ((tree type, tree func)); extern rtx avr_function_value PARAMS ((tree type, tree func));
extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *cum, extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *cum,
...@@ -83,14 +86,15 @@ extern int legitimate_address_p PARAMS ((enum machine_mode mode, rtx x, ...@@ -83,14 +86,15 @@ extern int legitimate_address_p PARAMS ((enum machine_mode mode, rtx x,
int strict)); int strict));
extern void machine_dependent_reorg PARAMS ((rtx first_insn)); extern void machine_dependent_reorg PARAMS ((rtx first_insn));
extern int compare_diff_p PARAMS ((rtx insn)); extern int compare_diff_p PARAMS ((rtx insn));
extern char * output_movqi PARAMS ((rtx insn, rtx operands[], int *l));
extern char * output_movhi PARAMS ((rtx insn, rtx operands[], int *l));
extern char * out_movqi_r_mr PARAMS ((rtx insn, rtx op[], int *l)); extern char * out_movqi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movqi_mr_r PARAMS ((rtx insn, rtx op[], int *l)); extern char * out_movqi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movhi_r_mr PARAMS ((rtx insn, rtx op[], int *l)); extern char * out_movhi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movhi_mr_r PARAMS ((rtx insn, rtx op[], int *l)); extern char * out_movhi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movsi_r_mr PARAMS ((rtx insn, rtx op[], int *l)); extern char * out_movsi_r_mr PARAMS ((rtx insn, rtx op[], int *l));
extern char * out_movsi_mr_r PARAMS ((rtx insn, rtx op[], int *l)); extern char * out_movsi_mr_r PARAMS ((rtx insn, rtx op[], int *l));
extern char * output_movsisf PARAMS ((rtx insn, rtx operands[], extern char * output_movsisf PARAMS ((rtx insn, rtx operands[], int *l));
int which_alternative));
extern char * out_tstsi PARAMS ((rtx insn, int *l)); extern char * out_tstsi PARAMS ((rtx insn, int *l));
extern char * out_tsthi PARAMS ((rtx insn, int *l)); extern char * out_tsthi PARAMS ((rtx insn, int *l));
extern char * ret_cond_branch PARAMS ((RTX_CODE cond, int len)); extern char * ret_cond_branch PARAMS ((RTX_CODE cond, int len));
...@@ -116,7 +120,7 @@ extern rtx legitimize_address PARAMS ((rtx x, rtx oldx, ...@@ -116,7 +120,7 @@ extern rtx legitimize_address PARAMS ((rtx x, rtx oldx,
extern int adjust_insn_length PARAMS ((rtx insn, int len)); extern int adjust_insn_length PARAMS ((rtx insn, int len));
extern rtx avr_libcall_value PARAMS ((enum machine_mode mode)); extern rtx avr_libcall_value PARAMS ((enum machine_mode mode));
extern char * output_reload_inhi PARAMS ((rtx insn, rtx *operands, extern char * output_reload_inhi PARAMS ((rtx insn, rtx *operands,
int which_alternative)); int *len));
extern char * output_reload_insisf PARAMS ((rtx insn, rtx *operands, extern char * output_reload_insisf PARAMS ((rtx insn, rtx *operands,
int which_alternative)); int which_alternative));
extern int default_rtx_costs PARAMS ((rtx X, RTX_CODE code, extern int default_rtx_costs PARAMS ((rtx X, RTX_CODE code,
...@@ -140,6 +144,16 @@ extern int jump_over_one_insn_p PARAMS ((rtx insn, rtx dest)); ...@@ -140,6 +144,16 @@ extern int jump_over_one_insn_p PARAMS ((rtx insn, rtx dest));
extern int avr_hard_regno_mode_ok PARAMS ((int regno, extern int avr_hard_regno_mode_ok PARAMS ((int regno,
enum machine_mode mode)); enum machine_mode mode));
extern int call_insn_operand PARAMS ((rtx op, enum machine_mode mode));
extern void final_prescan_insn PARAMS ((rtx insn, rtx *operand,
int num_operands));
extern int avr_simplify_comparision_p PARAMS ((enum machine_mode mode,
RTX_CODE operator, rtx x));
extern RTX_CODE avr_normalize_condition PARAMS ((RTX_CODE condition));
extern int compare_eq_p PARAMS ((rtx insn));
extern void out_shift_with_cnt PARAMS ((char * template, rtx insn,
rtx operands[], int *len));
extern int const_int_pow2_p PARAMS ((rtx x));
#endif /* RTX_CODE */ #endif /* RTX_CODE */
#ifdef HAVE_MACHINE_MODES #ifdef HAVE_MACHINE_MODES
...@@ -151,6 +165,4 @@ extern int class_max_nregs PARAMS ((enum reg_class class, ...@@ -151,6 +165,4 @@ extern int class_max_nregs PARAMS ((enum reg_class class,
extern void asm_output_float PARAMS ((FILE *file, REAL_VALUE_TYPE n)); extern void asm_output_float PARAMS ((FILE *file, REAL_VALUE_TYPE n));
#endif #endif
...@@ -621,18 +621,48 @@ __epilogue_restores__: ...@@ -621,18 +621,48 @@ __epilogue_restores__:
out __SP_H__,r29 out __SP_H__,r29
out __SREG__,__tmp_reg__ out __SREG__,__tmp_reg__
out __SP_L__,r28 out __SP_L__,r28
#if defined (__AVR_ENHANCED__)
movw r28, r26
#else
mov r28,r26 mov r28,r26
mov r29,r27 mov r29,r27
#endif
ret ret
#endif /* defined (Lepilogue) */ .endfunc
#endif /* defined (L_epilogue) */
#ifdef L__exit #ifdef L_exit
.weak _exit .weak _exit
.func _exit .func _exit
_exit: _exit:
rjmp _exit rjmp _exit
.endfunc
#endif /* defined (L_exit) */
#ifdef L_cleanup
.weak _cleanup .weak _cleanup
.func _cleanup
_cleanup: _cleanup:
ret ret
.endfunc .endfunc
#endif /* defined (L_cleanup) */
#ifdef L_tablejump
.global __tablejump__
.func __tablejump__
__tablejump__:
#if defined (__AVR_ENHANCED__)
lpm __tmp_reg__, Z+
lpm r31, Z
mov r30, __tmp_reg__
ijmp
#else
lpm
push r0
adiw r30, 1
lpm
push r0
ret
.endfunc
#endif #endif
#endif /* defined (L_tablejump) */
...@@ -5,31 +5,34 @@ RANLIB_FOR_TARGET = avr-ranlib ...@@ -5,31 +5,34 @@ RANLIB_FOR_TARGET = avr-ranlib
CROSS_LIBGCC1 = libgcc1-asm.a CROSS_LIBGCC1 = libgcc1-asm.a
LIB1ASMSRC = avr/libgcc.S LIB1ASMSRC = avr/libgcc.S
LIB1ASMFUNCS = \ LIB1ASMFUNCS = \
mulqi3 \ _mulqi3 \
mulhi3 \ _mulhi3 \
mulsi3 \ _mulsi3 \
umodqi3 \ _umodqi3 \
udivqi3 \ _udivqi3 \
modqi3 \ _modqi3 \
divqi3 \ _divqi3 \
umodhi3 \ _umodhi3 \
udivhi3 \ _udivhi3 \
modhi3 \ _modhi3 \
divhi3 \ _divhi3 \
umodsi3 \ _umodsi3 \
udivsi3 \ _udivsi3 \
modsi3 \ _modsi3 \
divsi3 \ _divsi3 \
prologue \ _prologue \
epilogue \ _epilogue \
__exit _exit \
_cleanup \
_tablejump
# libgcc... # libgcc...
LIBGCC1_TEST = LIBGCC1_TEST =
# We do not have DF type # We do not have the DF type.
TARGET_LIBGCC2_CFLAGS = -DDF=SF -Dinhibit_libc # Most of the C functions in libgcc2 use almost all registers,
#LIBGCC2 = $(LIBGCC1) # so use -mcall-prologues for smaller code size.
TARGET_LIBGCC2_CFLAGS = -DDF=SF -Dinhibit_libc -mcall-prologues
fp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/avr/t-avr fp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/avr/t-avr
echo '#define FLOAT' > fp-bit.c echo '#define FLOAT' > fp-bit.c
...@@ -44,5 +47,17 @@ fp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/avr/t-avr ...@@ -44,5 +47,17 @@ fp-bit.c: $(srcdir)/config/fp-bit.c $(srcdir)/config/avr/t-avr
FPBIT = fp-bit.c FPBIT = fp-bit.c
MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr3/mmcu=avr4/mmcu=avr5
MULTILIB_DIRNAMES = avr2 avr3 avr4 avr5
# The many avr2 matches are not listed here - this is the default.
MULTILIB_MATCHES = \
mmcu?avr3=mmcu?atmega103 mmcu?avr3=mmcu?atmega603 \
mmcu?avr4=mmcu?atmega83 mmcu?avr4=mmcu?atmega85 \
mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega163 \
mmcu?avr5=mmcu?atmega32 mmcu?avr5=mmcu?at94k
MULTILIB_EXCEPTIONS =
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
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